diff options
author | Andy Staudacher <andy.st@gmail.com> | 2009-11-15 19:44:47 -0800 |
---|---|---|
committer | Andy Staudacher <andy.st@gmail.com> | 2009-11-15 19:44:47 -0800 |
commit | 0733dc37fda27a5ba35f9020edf3c66aa41a95a0 (patch) | |
tree | 6877946232f1b01b1c8709054c689f6658cef34f /lib | |
parent | 218493c50be9362d4abed6900a816308fee5d978 (diff) | |
parent | 9379308f91a476f790fb8d444536719535c584e4 (diff) |
Merge commit 'upstream/master'
Conflicts:
modules/gallery/tests/xss_data.txt
Diffstat (limited to 'lib')
26 files changed, 935 insertions, 166 deletions
diff --git a/lib/gallery.common.css b/lib/gallery.common.css index f4d46a4e..1ebeadbe 100644 --- a/lib/gallery.common.css +++ b/lib/gallery.common.css @@ -1,38 +1,233 @@ /** - * Gallery 3 commonly reused screen styles + * Gallery 3 commonly re-used screen styles * * Sheet organization: + * * 1) Text - * 2) States and interactions - * 3) Positioning and order - * 4) Reusable containers/widgets + * 2) Forms + * 3) Dimension and scale + * 4) States and interactions + * 5) Positioning and order + * 6) Containers/widgets + * 7) Right to left language styles + * + * @todo Update .g-message-block, don't force it to 100%, bad things happen is themes when you do. */ /** ******************************************************************* * 1) Text **********************************************************************/ +.g-text-small { + font-size: .8em; +} + +.g-text-big { + font-size: 1.2em; +} + +.g-text-right { + text-align: right; +} + +/** ******************************************************************* + * 2) Forms + **********************************************************************/ + +form { + margin: 0; +} + +fieldset { + border: 1px solid #ccc; + padding: 0 1em .8em 1em; +} + +#g-banner fieldset, +#g-sidebar fieldset { + border: none; + padding: 0; +} + +legend { + font-weight: bold; + margin: 0; + padding: 0 .2em; +} + +#g-banner legend, +#g-sidebar legend, +input[type="hidden"] { + display: none; +} + +input.textbox, +input[type="text"], +input[type="password"], +textarea { + border: 1px solid #e8e8e8; + border-top-color: #ccc; + border-left-color: #ccc; + clear: both; + color: #333; + width: 50%; +} + +textarea { + height: 12em; + width: 97%; +} + +input:focus, +input.textbox:focus, +input[type=text]:focus, +textarea:focus, +option:focus { + background-color: #ffc; + color: #000; +} + +input.checkbox, +input[type=checkbox], +input.radio, +input[type=radio] { + float: left; + margin-right: .4em; +} + +/* Form layout ~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +form li { + margin: 0; + padding: 0 0 .2em 0; +} + +form ul { + margin-top: 0; +} + +form ul ul { + clear: both; +} + +form ul ul li { + float: left; +} + +input, +select, +textarea { + display: block; + clear: both; + padding: .2em; +} + +input[type="submit"], +input[type="reset"] { + display: inline; + clear: none; + float: left; +} + +/* Forms in dialogs and panels ~~~~~~~~~ */ + +#g-dialog ul li { + padding-bottom: .8em; +} + +#g-dialog fieldset, +#g-panel fieldset { + border: none; + padding: 0; +} + +#g-panel legend { + display: none; +} + +#g-dialog input.textbox, +#g-dialog input[type=text], +#g-dialog input[type=password], +#g-dialog textarea { + width: 97%; +} + +/* Short forms ~~~~~~~~~~~~~~~~~~~~~~~ */ + +.g-short-form legend, +.g-short-form label { + display: none; +} + +.g-short-form fieldset { + border: none; + padding: 0; +} + +.g-short-form li { + float: left; + margin: 0 !important; + padding: .4em 0; +} + +.g-short-form .textbox, +.g-short-form input[type=text] { + color: #666; + padding: .3em .6em; + width: 100%; +} + +.g-short-form .textbox.g-error { + border: 1px solid #f00; + color: #f00; + padding-left: 24px; +} + +.g-short-form .g-cancel { + display: block; + padding: .2em .8em; +} + +#g-sidebar .g-short-form li { + padding-left: 0; + padding-right: 0; +} + +/** ******************************************************************* + * 3) Dimension and scale + **********************************************************************/ + +.g-one-quarter { + width: 25%; +} + +.g-one-third { + width: 33%; +} + +.g-one-half { + width: 50%; +} -.g-txt-small { - font-size: .8em; +.g-two-thirds { + width: 66%; } -.g-txt-big { - font-size: 1.2em; +.g-three-quarters { + width: 75%; } -.g-txt-right { - text-align: right; +.g-whole { + width: 100%; } /** ******************************************************************* - * 2) States and interactions + * 4) States and interactions **********************************************************************/ .g-active, .g-enabled, .g-available, -.g-editable, .g-selected, .g-highlight { font-weight: bold; @@ -43,42 +238,80 @@ .g-unavailable, .g-uneditable, .g-locked, -.g-unselected, +.g-deselected, .g-understate { color: #ccc; font-weight: normal; } +.g-editable { + padding: .2em .3em; +} + +.g-editable:hover { + background-color: #ffc; + cursor: text; +} + .g-error, .g-info, .g-success, .g-warning { - background-position: .4em 50%; - background-repeat: no-repeat; - padding: .4em .5em .4em 30px; + padding-left: 30px; +} + +form li.g-error, +form li.g-info, +form li.g-success, +form li.g-warning { + background-image: none; + padding: .3em .8em .3em 1em; +} + +.g-short-form li.g-error { + padding: .3em 0 .3em 0; +} + +form.g-error input[type="text"], +li.g-error input[type="text"], +form.g-error input[type="password"], +li.g-error input[type="password"], +form.g-error input[type="checkbox"], +li.g-error input[type="checkbox"], +form.g-error input[type="radio"], +li.g-error input[type="radio"], +form.g-error textarea, +li.g-error textarea, +form.g-error select, +li.g-error select { + border: 2px solid #f00; + margin-bottom: .2em; } .g-error, -.g-denied { - background-color: #f6cbca; +.g-denied, +tr.g-error td.g-error { + background: #f6cbca url('images/ico-error.png') no-repeat .4em 50%; color: #f00; - background-image: url('lib/images/ico-error.png'); } .g-info { - background-color: #e8e8e8; - background-image: url('lib/images/ico-info.png'); + background: #e8e8e8 url('images/ico-info.png') no-repeat .4em 50%; } .g-success, -.g-allowed { - background-color: #d9efc2; - background-image: url('lib/images/ico-success.png'); +.g-allowed, +tr.g-success td.g-success { + background: #d9efc2 url('images/ico-success.png') no-repeat .4em 50%; } -.g-warning { - background-color: #fcf9ce; - background-image: url('lib/images/ico-warning.png'); +tr.g-success td.g-success { + background-color: transparent; +} + +.g-warning, +tr.g-warning td.g-warning { + background: #fcf9ce url('images/ico-warning.png') no-repeat .4em 50%; } form .g-error { @@ -92,29 +325,55 @@ form .g-error { } .g-installed { + background-color: #eeeeee; } .g-default { + background-color: #c5dbec; + font-weight: bold; +} + +.g-draggable { + cursor: move; +} + +.g-draggable:hover { + border: 1px dashed #000; +} + +.ui-sortable .g-target, +.ui-state-highlight { + background-color: #fcf9ce; + border: 2px dotted #999; + height: 2em; + margin: 1em 0; } -.g-draggable, -.ui-draggable { - cursor: move; +/* Ajax loading indicator ~~~~~~~~~~~~~~~~ */ + +.g-loading-large, +.g-dialog-loading-large { + background: #e8e8e8 url('images/loading-large.gif') no-repeat center center; + font-size: 0; } -.g-target { +.g-loading-small { + background: #e8e8e8 url('images/loading-small.gif') no-repeat center center; + font-size: 0; } /** ******************************************************************* - * 3) Positioning and order + * 5) Positioning and order **********************************************************************/ -.g-right { - float: right; +.g-left { + clear: none; + float: left; } -.g-left { - float: left; +.g-right { + clear: none; + float: right; } .g-first { @@ -123,39 +382,346 @@ form .g-error { .g-last { } -.g-even-row { +.g-even { + background-color: #fff; } -.g-odd-row { +.g-odd { + background-color: #eee; } /** ******************************************************************* - * 4) Reusable containers/widgets + * 6) Containers/widgets **********************************************************************/ -.g-dialog { +/* Generic block container ~~~~~~~~~~~~~~~ */ + +.g-block { + clear: both; + margin-bottom: 2.5em; } +.g-block-content { +} + +/* Superfish menu overrides ~~~~~~~~~~~~~~ */ + +.sf-menu ul { + width: 12em; +} + +ul.sf-menu li li:hover ul, +ul.sf-menu li li.sfHover ul { + left: 12em; +} + +ul.sf-menu li li li:hover ul, +ul.sf-menu li li li.sfHover ul { + left: 12em; +} + +/* jQuery UI Dialog ~~~~~~~~~~~~~~~~~~~~~~ */ + +.ui-widget-overlay { + background: #000; + opacity: .7; +} + +/* Buttons ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + .g-button { + display: inline-block; + margin: 0 4px 0 0; + padding: .2em .4em; } -.g-progressbar { +.g-button, +.g-button:hover, +.g-button:active { + cursor: pointer !important; + outline: 0; + text-decoration: none; + -moz-outline-style: none; } -.g-block { +/* jQuery UI ThemeRoller buttons ~~~~~~~~~ */ + +.g-buttonset { + padding-left: 1px; +} + +.g-buttonset li { + float: left; +} + +.g-buttonset .g-button { + margin: 0; +} + +.ui-icon-left .ui-icon { + float: left; + margin-right: .2em; +} + +.ui-icon-right .ui-icon { + float: right; + margin-left: .2em; +} + +/* Rotate icon, ThemeRoller only provides one of these */ + +.ui-icon-rotate-ccw { + background-position: -192px -64px; +} + +.ui-icon-rotate-cw { + background-position: -208px -64px; } -.g-message-box { +.g-progress-bar { + height: 1em; width: 100%; + margin-top: .5em; + display: inline-block; } -.g-message { +/* Status and validation messages ~~~~ */ + +.g-message-block { border: 1px solid #ccc; - margin-bottom: .4em; + padding: 0 !important; + width: 100%; +} + +#g-action-status { + margin-bottom: 1em; } +#g-action-status li, +p#g-action-status, +div#g-action-status { + padding-top: .4em; + padding-bottom: .3em; +} + +#g-site-status li { + border-bottom: 1px solid #ccc; + padding: .3em .3em .3em 30px; +} + +.g-module-status { + clear: both; + margin-bottom: 1em; +} + +/* Breadcrumbs ~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +.g-breadcrumbs { + clear: both; + padding: 0 20px; +} + +.g-breadcrumbs li { + background: transparent url('images/ico-separator.gif') no-repeat scroll left center; + float: left; + padding: 1em 8px 1em 18px; +} + +.g-breadcrumbs .g-first { + background: none; + padding-left: 0; +} + +.g-breadcrumbs li a, +.g-breadcrumbs li span { + display: block; +} + +#g-dialog ul.g-breadcrumbs { + margin-left: 0; + padding-left: 0; +} + +/* Pagination ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + .g-pager { + padding: .2em 0; + width: 100%; +} + +.g-pager li { + float: left; + width: 30%; +} + +.g-pager .g-info { + background: none; + padding: .2em 0; + text-align: center; + width: 40%; +} + +/* Dialogs and panels ~~~~~~~~~~~~~~~~~~ */ + +#g-dialog { + text-align: left; +} + +#g-dialog legend { + display: none; +} + +#g-dialog .g-cancel { + margin: .4em 1em; +} + +#g-panel { + display: none; + padding: 1em; +} + +/* Inline layout ~~~~~~~~~~ */ + +.g-inline li { + float: left; + margin-left: 1.8em; + padding-left: 0 !important; +} + +.g-inline li.g-first { + margin-left: 0; +} + +/* Simple uploader ~~~~~~~~~~~~~~~~~~~~~~~ */ + +#g-add-photos-canvas { + border: 1px solid #ccc; + height: 200px; + margin: .5em 0; + overflow: auto; + width: 469px; +} + +#g-add-photos-status { + border: 1px solid #ccc; + height: 125px; + margin: .5em 0; + overflow: auto; + width: 469px; +} + +#g-add-photos button { + float: right; + margin-bottom: .5em; + margin-left: .5em; +} + +#g-add-photos-status li { + text-align: left; + padding-left: 2em; +} + +#g-add-photos-status li.g-success { + background: #d9efc2 url('images/ico-success.png') no-repeat .4em 50%; +} + +#g-add-photos-status li.g-error { + background: #f6cbca url('images/ico-error.png') no-repeat .4em 50%; +/* color: #f00;*/ +} + +#g-add-photos-button { + background: #DFEFFC; + border: 1px solid #C5DBEC; + color: #2E6E9E +} + +#g-add-photos p { + margin: 0 +} + +#g-add-photos .g-breadcrumbs li { + padding-top: .5em; +} + +/** ******************************************************************* + * 7) Right to left language styles + **********************************************************************/ + +.rtl { + direction: rtl; +} + +.rtl #g-header, +.rtl #g-content, +.rtl #g-sidebar, +.rtl #g-footer, +.rtl caption, +.rtl th, +.rtl #g-dialog, +.rtl .g-context-menu li a, +.rtl .g-message-box li, +.rtl #g-site-status li { + text-align: right; +} + +.rtl .g-text-right { + text-align: left; +} + +.rtl .g-error, +.rtl .g-info, +.rtl .g-success, +.rtl .g-warning { + background-position: center right; + padding-right: 30px !important; +} + +.rtl .g-left, +.rtl .g-inline li, +.rtl form ul ul li, +.rtl input[type="submit"], +.rtl input[type="reset"], +.rtl #g-content #g-album-grid .g-item, +.rtl .sf-menu li, +.rtl .g-breadcrumbs li, +.rtl .g-pager li, +.rtl .g-buttonset li, +.rtl .ui-icon-left .ui-icon, +.rtl input.checkbox { + float: right; +} + +.rtl .g-right, +.rtl .ui-icon-right .ui-icon { + float: left; +} + +.rtl .g-inline li { + margin-right: 1em; +} + +.rtl .g-inline li.g-first { + margin-right: 0; +} + +.rtl .g-breadcrumbs li { + background-position: right center; + padding: 1em 18px 1em 8px; +} + +.rtl .g-breadcrumbs .g-first { + padding-right: 0; +} + +.rtl .g-pager .g-info { + width: 35%; +} + +.rtl .g-pager .g-text-right { + margin-left: 0; } -.g-list-horizontal { +.rtl input.checkbox { + margin-right: .4em; } diff --git a/lib/gallery.common.js b/lib/gallery.common.js index c6a619c1..9aaac1ce 100644 --- a/lib/gallery.common.js +++ b/lib/gallery.common.js @@ -1,9 +1,21 @@ (function ($) { - $.fn.gallery_show_message = function(message) { + + // Fade in action status message background color + $.fn.gallery_show_message = function() { return this.each(function(i){ - $(this).effect("highlight", {"color": "white"}, 3000); - $(this).animate({opacity: 1.0}, 6000); + $(this).hide().fadeIn(3000) + }); + }; + + // Make the height of all items the same as the tallest item within the set + $.fn.equal_heights = function() { + var tallest_height = 0; + $(this).each(function(){ + if ($(this).height() > tallest_height) { + tallest_height = $(this).height(); + } }); + return $(this).height(tallest_height); }; // Vertically align a block element's content @@ -12,8 +24,8 @@ if (container == null) { container = 'div'; } - $(this).html("<" + container + " class=\"gValign\">" + $(this).html() + "</" + container + ">"); - var el = $(this).children(container + ".gValign"); + $(this).html("<" + container + " class=\"g-valign\">" + $(this).html() + "</" + container + ">"); + var el = $(this).children(container + ".g-valign"); var elh = $(el).height(); var ph = $(this).height(); var nh = (ph - elh) / 2; @@ -35,21 +47,21 @@ /** * Toggle the processing indicator, both large and small - * @param elementID Target ID, including #, to apply .gLoadingSize + * @param elementID Target ID, including #, to apply .g-loading-size */ $.fn.gallery_show_loading = function() { return this.each(function(i){ var size; switch ($(this).attr("id")) { - case "#gDialog": - case "#gPanel": - size = "Large"; + case "#g-dialog": + case "#g-panel": + size = "large"; break; default: - size = "Small"; + size = "small"; break; } - $(this).toggleClass("gLoading" + size); + $(this).toggleClass("g-loading" + size); }); }; @@ -77,7 +89,7 @@ */ $.fn.gallery_get_photo = function() { var photo = $(this).find("img").filter(function() { - return this.id.match(/gPhotoId-\d+/); + return this.id.match(/g-photo-id-\d+/); }); return photo; }; @@ -111,24 +123,29 @@ $(thumb).attr({src: data.src, width: data.width, height: data.height}); }; + // Initialize context menus $.fn.gallery_context_menu = function() { - var in_progress = 0; - $(".gContextMenu *").removeAttr('title'); - $(".gContextMenu ul").hide(); - $(".gContextMenu").hover( - function() { - if (in_progress == 0) { - $(this).find("ul").slideDown("fast", function() { in_progress = 1; }); - $(this).find(".gDialogLink").gallery_dialog(); - $(this).find(".gAjaxLink").gallery_ajax(); + if ($(".g-context-menu li").length) { + var hover_target = ".g-context-menu"; + var in_progress = 0; + $(hover_target + " *").removeAttr('title'); + $(hover_target + " ul").hide(); + $(hover_target).hover( + function() { + if (in_progress == 0) { + $(this).find("ul").slideDown("fast", function() { in_progress = 1; }); + $(this).find(".g-dialog-link").gallery_dialog(); + $(this).find(".g-ajax-link").gallery_ajax(); + } + }, + function() { + $(this).find("ul").slideUp("slow", function() { in_progress = 0; }); } - }, - function() { - $(this).find("ul").slideUp("slow", function() { in_progress = 0; }); - } - ); + ); + } }; + // Size a container to fit within the browser window $.gallery_auto_fit_window = function(imageWidth, imageHeight) { var size = $.gallery_get_viewport_size(); var width = size.width() - 6, @@ -154,4 +171,40 @@ }; }; + // Initialize a short form. Short forms may contain only one text input. + $.fn.gallery_short_form = function() { + return this.each(function(i){ + var label = $(this).find("label:first"); + var input = $(this).find("input[type=text]:first"); + var button = $(this).find("input[type=submit]"); + + $(".g-short-form").addClass("ui-helper-clearfix"); + $(".g-short-form input[type=text]").addClass("ui-corner-left"); + $(".g-short-form input[type=submit]").addClass("ui-state-default ui-corner-right"); + + // Set the input value equal to label text + if (input.val() == "") { + input.val(label.html()); + button.enable(false); + } + + // Attach event listeners to the input + input.bind("focus", function(e) { + // Empty input value if it equals it's label + if ($(this).val() == label.html()) { + $(this).val(""); + } + button.enable(true); + }); + + input.bind("blur", function(e){ + // Reset the input value if it's empty + if ($(this).val() == "") { + $(this).val(label.html()); + button.enable(false); + } + }); + }); + }; + })(jQuery); diff --git a/lib/gallery.dialog.js b/lib/gallery.dialog.js index 39c451e3..3587108c 100644 --- a/lib/gallery.dialog.js +++ b/lib/gallery.dialog.js @@ -15,75 +15,75 @@ _show: function(sHref) { var self = this; - var eDialog = '<div id="gDialog"></div>'; + var eDialog = '<div id="g-dialog"></div>'; $("body").append(eDialog); if (!self.options.close) { self.options.close = self.close_dialog; } - $("#gDialog").dialog(self.options); + $("#g-dialog").dialog(self.options); - $("#gDialog").gallery_show_loading(); + $("#g-dialog").gallery_show_loading(); $.get(sHref, function(data) { - $("#gDialog").html(data).gallery_show_loading(); + $("#g-dialog").html(data).gallery_show_loading(); - if ($("#gDialog form").length) { - self.form_loaded(null, $("#gDialog form")); + if ($("#g-dialog form").length) { + self.form_loaded(null, $("#g-dialog form")); } self._layout(); - $("#gDialog").dialog("open"); + $("#g-dialog").dialog("open"); // Remove titlebar for progress dialogs or set title - if ($("#gDialog #gProgress").length) { + if ($("#g-dialog #g-progress").length) { $(".ui-dialog-titlebar").remove(); - } else if ($("#gDialog h1").length) { - $("#gDialog").dialog('option', 'title', $("#gDialog h1:eq(0)").html()); - } else if ($("#gDialog fieldset legend").length) { - $("#gDialog").dialog('option', 'title', $("#gDialog fieldset legend:eq(0)").html()); + } else if ($("#g-dialog h1").length) { + $("#g-dialog").dialog('option', 'title', $("#g-dialog h1:eq(0)").html()); + } else if ($("#g-dialog fieldset legend").length) { + $("#g-dialog").dialog('option', 'title', $("#g-dialog fieldset legend:eq(0)").html()); } - if ($("#gDialog form").length) { + if ($("#g-dialog form").length) { self._ajaxify_dialog(); } }); - $("#gDialog").dialog("option", "self", self); + $("#g-dialog").dialog("option", "self", self); }, _layout: function() { var dialogWidth; - var dialogHeight = $("#gDialog").height(); - var cssWidth = new String($("#gDialog form").css("width")); + var dialogHeight = $("#g-dialog").height(); + var cssWidth = new String($("#g-dialog form").css("width")); var childWidth = cssWidth.replace(/[^0-9]/g,""); var size = $.gallery_get_viewport_size(); - if ($("#gDialog iframe").length) { + if ($("#g-dialog iframe").length) { dialogWidth = size.width() - 100; // Set the iframe width and height - $("#gDialog iframe").width("100%").height(size.height() - 100); - } else if ($("#gDialog .gDialogPanel").length) { + $("#g-dialog iframe").width("100%").height(size.height() - 100); + } else if ($("#g-dialog .g-dialog-panel").length) { dialogWidth = size.width() - 100; - $("#gDialog").dialog("option", "height", size.height() - 100); + $("#g-dialog").dialog("option", "height", size.height() - 100); } else if (childWidth == "" || childWidth > 300) { dialogWidth = 500; } - $("#gDialog").dialog('option', 'width', dialogWidth); + $("#g-dialog").dialog('option', 'width', dialogWidth); }, form_loaded: function(event, ui) { // Should be defined (and localized) in the theme MSG_CANCEL = MSG_CANCEL || 'Cancel'; - var eCancel = '<a href="#" class="gCancel">' + MSG_CANCEL + '</a>'; - if ($("#gDialog .submit").length) { - $("#gDialog .submit").addClass("ui-state-default ui-corner-all"); + var eCancel = '<a href="#" class="g-cancel g-left">' + MSG_CANCEL + '</a>'; + if ($("#g-dialog .submit").length) { + $("#g-dialog .submit").addClass("ui-state-default ui-corner-all"); $.fn.gallery_hover_init(); - $("#gDialog .submit").parent().append(eCancel); - $("#gDialog .gCancel").click(function(event) { - $("#gDialog").dialog("close"); + $("#g-dialog .submit").parent().append(eCancel); + $("#g-dialog .g-cancel").click(function(event) { + $("#g-dialog").dialog("close"); event.preventDefault(); }); } - $("#gDialog .ui-state-default").hover( + $("#g-dialog .ui-state-default").hover( function() { $(this).addClass("ui-state-hover"); }, @@ -94,23 +94,31 @@ }, close_dialog: function(event, ui) { - var self = $("#gDialog").dialog("option", "self"); - if ($("#gDialog form").length) { - self._trigger("form_closing", null, $("#gDialog form")); + var self = $("#g-dialog").dialog("option", "self"); + if ($("#g-dialog form").length) { + self._trigger("form_closing", null, $("#g-dialog form")); } - self._trigger("dialog_closing", null, $("#gDialog")); - $("#gDialog").dialog("destroy").remove(); + self._trigger("dialog_closing", null, $("#g-dialog")); + $("#g-dialog").dialog("destroy").remove(); }, _ajaxify_dialog: function() { var self = this; - $("#gDialog form").ajaxForm({ + $("#g-dialog form").ajaxForm({ dataType: "json", + beforeSubmit: function(formData, form, options) { + form.find(":submit") + .addClass("ui-state-disabled") + .attr("disabled", "disabled"); + return true; + }, success: function(data) { if (data.form) { - $("#gDialog form").replaceWith(data.form); + $("#g-dialog form").replaceWith(data.form); + $("#g-dialog form :submit").removeClass("ui-state-disabled") + .attr("disabled", null); self._ajaxify_dialog(); - self.form_loaded(null, $("#gDialog form")); + self.form_loaded(null, $("#g-dialog form")); if (typeof data.reset == 'function') { eval(data.reset + '()'); } diff --git a/lib/gallery.form.js b/lib/gallery.form.js deleted file mode 100644 index 77ce3b7d..00000000 --- a/lib/gallery.form.js +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Initialize a short form. Short forms may contain only one text input. - * - * @param form_id string The form's CSS id - */ -function short_form_init(form_id) { - var form = $(form_id); - var label = form.find("label:first"); - var input = form.find("input[type=text]:first"); - var button = form.find("input[type=submit]"); - - // Set the input value equal to label text - if (input.val() == "") { - input.val(label.html()); - button.enable(false); - } - - // Attach event listeners to the input - input.bind("focus", function(e) { - // Empty input value if it equals it's label - if ($(this).val() == label.html()) { - $(this).val(""); - } - button.enable(true); - }); - - input.bind("blur", function(e){ - // Reset the input value if it's empty - if ($(this).val() == "") { - $(this).val(label.html()); - button.enable(false); - } - }); -} diff --git a/lib/gallery.in_place_edit.js b/lib/gallery.in_place_edit.js new file mode 100644 index 00000000..681688e5 --- /dev/null +++ b/lib/gallery.in_place_edit.js @@ -0,0 +1,78 @@ +(function($) { + $.widget("ui.gallery_in_place_edit", { + _init: function() { + var self = this; + this.element.click(function(event) { + event.preventDefault(); + self._show(event.currentTarget); + return false; + }); + }, + + _show: function(target) { + var self = this; + var tag_width = $(target).width(); + $(self).data("tag_width", tag_width); + + var form = $("#g-in-place-edit-form"); + if (form.length > 0) { + self._cancel(); + } + + $.get(self.options.form_url.replace("__ID__", $(target).attr('rel')), function(data) { + var parent = $(target).parent(); + parent.children().hide(); + parent.append(data); + parent.find("form :text") + .width(tag_width) + .focus(); + $(".g-short-form").gallery_short_form(); + parent.find("form .g-cancel").click(function(event) { + self._cancel(); + event.preventDefault(); + return false; + }); + self._ajaxify_edit(); + }); + + }, + + _cancel: function() { + var parent = $("#g-in-place-edit-form").parent(); + $(parent).find("form").remove(); + $(parent).children().show(); + $("#g-in-place-edit-message").remove(); + }, + + _ajaxify_edit: function() { + var self = this; + var form = $("#g-in-place-edit-form"); + $(form).ajaxForm({ + dataType: "json", + success: function(data) { + if (data.result == "success") { + window.location.reload(); + } else { + var parent = $(form).parent(); + $(form).replaceWith(data.form); + var width = $(self).data("tag_width"); + $(parent).find("form :text") + .width(width) + .focus(); + $(".g-short-form").gallery_short_form(); + $(parent).find("form .g-cancel").click(function(event) { + self._cancel(); + event.preventDefault(); + return false; + }); + self._ajaxify_edit(); + } + } + }); + } + }); + + $.extend($.ui.gallery_in_place_edit, { + defaults: {} + }); +})(jQuery); diff --git a/lib/gallery.panel.js b/lib/gallery.panel.js index 6115297d..8d627369 100644 --- a/lib/gallery.panel.js +++ b/lib/gallery.panel.js @@ -8,7 +8,7 @@ var parent = $(element).parent().parent(); var sHref = $(element).attr("href"); var parentClass = $(parent).attr("class"); - var ePanel = "<tr id=\"gPanel\"><td colspan=\"6\"></td></tr>"; + var ePanel = "<tr id=\"g-panel\"><td colspan=\"6\"></td></tr>"; // We keep track of the open vs. closed state by looking to see if there' // an orig_text attr. If that attr is missing, then the panel is closed @@ -16,12 +16,12 @@ var should_open = !$(element).attr("orig_text"); // Close any open panels and reset their button text - if ($("#gPanel").length) { - $("#gPanel").slideUp("slow").remove(); - $.each($(".gPanelLink"), + if ($("#g-panel").length) { + $("#g-panel").slideUp("slow").remove(); + $.each($(".g-panel-link"), function() { if ($(this).attr("orig_text")) { - $(this).children(".gButtonText").text($(this).attr("orig_text")); + $(this).children(".g-button-text").text($(this).attr("orig_text")); $(this).attr("orig_text", ""); } } @@ -30,15 +30,15 @@ if (should_open) { $(parent).after(ePanel); - $("#gPanel td").html(sHref); + $("#g-panel td").html(sHref); $.get(sHref, function(data) { - $("#gPanel td").html(data); + $("#g-panel td").html(data); self._ajaxify_panel(); if ($(element).attr("open_text")) { - $(element).attr("orig_text", $(element).children(".gButtonText").text()); - $(element).children(".gButtonText").text($(element).attr("open_text")); + $(element).attr("orig_text", $(element).children(".g-button-text").text()); + $(element).children(".g-button-text").text($(element).attr("open_text")); } - $("#gPanel").addClass(parentClass).show().slideDown("slow"); + $("#g-panel").addClass(parentClass).show().slideDown("slow"); }); } @@ -48,11 +48,17 @@ _ajaxify_panel: function () { var self = this; - $("#gPanel td form").ajaxForm({ + $("#g-panel td form").ajaxForm({ dataType: "json", + beforeSubmit: function(formData, form, options) { + form.find(":submit") + .addClass("ui-state-disabled") + .attr("disabled", "disabled"); + return true; + }, success: function(data) { if (data.form) { - $("#gPanel td form").replaceWith(data.form); + $("#g-panel td form").replaceWith(data.form); self._ajaxify_panel(); } if (data.result == "success") { diff --git a/lib/gallery.show_full_size.js b/lib/gallery.show_full_size.js index 7e826c32..49dc620a 100644 --- a/lib/gallery.show_full_size.js +++ b/lib/gallery.show_full_size.js @@ -7,7 +7,7 @@ var height = $(document).height(); var size = $.gallery_get_viewport_size(); - $("body").append('<div id="gFullsizeOverlay" class="ui-dialog-overlay" ' + + $("body").append('<div id="g-fullsize-overlay" class="ui-dialog-overlay" ' + 'style="border: none; margin: 0; padding: 0; background-color: #000; ' + 'position: absolute; top: 0px; left: 0px; ' + 'width: ' + width + 'px; height: ' + height + 'px;' + @@ -15,34 +15,43 @@ '-moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; ' + '-moz-background-inline-policy: -moz-initial; z-index: 1001;"> </div>'); - var image_size = $.gallery_auto_fit_window(image_width, image_height); + var image_size; + if (image_width >= size.width() - 6 || image_height >= size.height() - 6) { + image_size = $.gallery_auto_fit_window(image_width, image_height); + } else { + image_size = { + top: Number((height - image_height) / 2), left: Number((width - image_width) / 2), + width: Number(image_width), height: Number(image_height) + }; + } + - $("body").append('<div id="gFullsize" class="ui-dialog ui-widget" ' + + $("body").append('<div id="g-fullsize" class="ui-dialog ui-widget" ' + 'style="overflow: hidden; display: block; ' + 'position: absolute; z-index: 1002; outline-color: -moz-use-text-color; ' + 'outline-style: none; outline-width: 0px; ' + 'height: ' + image_size.height + 'px; ' + 'width: ' + image_size.width + 'px; ' + 'top: ' + image_size.top + 'px; left: ' + image_size.left + 'px;">' + - '<img id="gFullSizeImage" src="' + image_url + '"' + + '<img id="g-fullsize-image" src="' + image_url + '"' + 'height="' + image_size.height + '" width="' + image_size.width + '"/></div>'); $().click(function() { - $("#gFullsizeOverlay*").remove(); - $("#gFullsize").remove(); + $("#g-fullsize-overlay*").remove(); + $("#g-fullsize").remove(); }); $().bind("keypress", function() { - $("#gFullsizeOverlay*").remove(); - $("#gFullsize").remove(); + $("#g-fullsize-overlay*").remove(); + $("#g-fullsize").remove(); }); $(window).resize(function() { - $("#gFullsizeOverlay").width($(document).width()).height($(document).height()); + $("#g-fullsize-overlay").width($(document).width()).height($(document).height()); image_size = $.gallery_auto_fit_window(image_width, image_height); - $("#gFullsize").height(image_size.height) + $("#g-fullsize").height(image_size.height) .width(image_size.width) .css("top", image_size.top) .css("left", image_size.left); - $("#gFullSizeImage").height(image_size.height).width(image_size.width); + $("#g-fullsize-image").height(image_size.height).width(image_size.width); }); }; })(jQuery); diff --git a/lib/images/ico-denied-inactive.png b/lib/images/ico-denied-inactive.png Binary files differnew file mode 100644 index 00000000..56db3ff5 --- /dev/null +++ b/lib/images/ico-denied-inactive.png diff --git a/lib/images/ico-denied-passive.png b/lib/images/ico-denied-passive.png Binary files differnew file mode 100644 index 00000000..1e992230 --- /dev/null +++ b/lib/images/ico-denied-passive.png diff --git a/lib/images/ico-denied.png b/lib/images/ico-denied.png Binary files differnew file mode 100644 index 00000000..08f24936 --- /dev/null +++ b/lib/images/ico-denied.png diff --git a/lib/images/ico-error.png b/lib/images/ico-error.png Binary files differnew file mode 100644 index 00000000..c37bd062 --- /dev/null +++ b/lib/images/ico-error.png diff --git a/lib/images/ico-info.png b/lib/images/ico-info.png Binary files differnew file mode 100644 index 00000000..12cd1aef --- /dev/null +++ b/lib/images/ico-info.png diff --git a/lib/images/ico-lock.png b/lib/images/ico-lock.png Binary files differnew file mode 100644 index 00000000..2ebc4f6f --- /dev/null +++ b/lib/images/ico-lock.png diff --git a/lib/images/ico-separator.gif b/lib/images/ico-separator.gif Binary files differnew file mode 100644 index 00000000..3de2d0d3 --- /dev/null +++ b/lib/images/ico-separator.gif diff --git a/lib/images/ico-success-inactive.png b/lib/images/ico-success-inactive.png Binary files differnew file mode 100644 index 00000000..74b2032f --- /dev/null +++ b/lib/images/ico-success-inactive.png diff --git a/lib/images/ico-success-passive.png b/lib/images/ico-success-passive.png Binary files differnew file mode 100644 index 00000000..dc8d1ded --- /dev/null +++ b/lib/images/ico-success-passive.png diff --git a/lib/images/ico-success.png b/lib/images/ico-success.png Binary files differnew file mode 100644 index 00000000..a9925a06 --- /dev/null +++ b/lib/images/ico-success.png diff --git a/lib/images/ico-warning.png b/lib/images/ico-warning.png Binary files differnew file mode 100644 index 00000000..628cf2da --- /dev/null +++ b/lib/images/ico-warning.png diff --git a/lib/jquery.autocomplete.js b/lib/jquery.autocomplete.js index 271014a2..02f2b54d 100644 --- a/lib/jquery.autocomplete.js +++ b/lib/jquery.autocomplete.js @@ -10,4 +10,4 @@ * Revision: $Id: jquery.autocomplete.js 5747 2008-06-25 18:30:55Z joern.zaefferer $ * */ -eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}(';(3($){$.31.1o({12:3(b,d){5 c=Y b=="1w";d=$.1o({},$.D.1L,{11:c?b:14,w:c?14:b,1D:c?$.D.1L.1D:10,Z:d&&!d.1x?10:3U},d);d.1t=d.1t||3(a){6 a};d.1q=d.1q||d.1K;6 I.K(3(){1E $.D(I,d)})},M:3(a){6 I.X("M",a)},1y:3(a){6 I.15("1y",[a])},20:3(){6 I.15("20")},1Y:3(a){6 I.15("1Y",[a])},1X:3(){6 I.15("1X")}});$.D=3(o,r){5 t={2N:38,2I:40,2D:46,2x:9,2v:13,2q:27,2d:3x,2j:33,2o:34,2e:8};5 u=$(o).3f("12","3c").P(r.24);5 p;5 m="";5 n=$.D.2W(r);5 s=0;5 k;5 h={1z:B};5 l=$.D.2Q(r,o,1U,h);5 j;$.1T.2L&&$(o.2K).X("3S.12",3(){4(j){j=B;6 B}});u.X(($.1T.2L?"3Q":"3N")+".12",3(a){k=a.2F;3L(a.2F){Q t.2N:a.1d();4(l.L()){l.2y()}A{W(0,C)}N;Q t.2I:a.1d();4(l.L()){l.2u()}A{W(0,C)}N;Q t.2j:a.1d();4(l.L()){l.2t()}A{W(0,C)}N;Q t.2o:a.1d();4(l.L()){l.2s()}A{W(0,C)}N;Q r.19&&$.1p(r.R)==","&&t.2d:Q t.2x:Q t.2v:4(1U()){a.1d();j=C;6 B}N;Q t.2q:l.U();N;3A:1I(p);p=1H(W,r.1D);N}}).1G(3(){s++}).3v(3(){s=0;4(!h.1z){2k()}}).2i(3(){4(s++>1&&!l.L()){W(0,C)}}).X("1y",3(){5 c=(1n.7>1)?1n[1]:14;3 23(q,a){5 b;4(a&&a.7){16(5 i=0;i<a.7;i++){4(a[i].M.O()==q.O()){b=a[i];N}}}4(Y c=="3")c(b);A u.15("M",b&&[b.w,b.H])}$.K(1g(u.J()),3(i,a){1R(a,23,23)})}).X("20",3(){n.18()}).X("1Y",3(){$.1o(r,1n[1]);4("w"2G 1n[1])n.1f()}).X("1X",3(){l.1u();u.1u();$(o.2K).1u(".12")});3 1U(){5 b=l.26();4(!b)6 B;5 v=b.M;m=v;4(r.19){5 a=1g(u.J());4(a.7>1){v=a.17(0,a.7-1).2Z(r.R)+r.R+v}v+=r.R}u.J(v);1l();u.15("M",[b.w,b.H]);6 C}3 W(b,c){4(k==t.2D){l.U();6}5 a=u.J();4(!c&&a==m)6;m=a;a=1k(a);4(a.7>=r.22){u.P(r.21);4(!r.1C)a=a.O();1R(a,2V,1l)}A{1B();l.U()}};3 1g(b){4(!b){6[""]}5 d=b.1Z(r.R);5 c=[];$.K(d,3(i,a){4($.1p(a))c[i]=$.1p(a)});6 c}3 1k(a){4(!r.19)6 a;5 b=1g(a);6 b[b.7-1]}3 1A(q,a){4(r.1A&&(1k(u.J()).O()==q.O())&&k!=t.2e){u.J(u.J()+a.48(1k(m).7));$.D.1N(o,m.7,m.7+a.7)}};3 2k(){1I(p);p=1H(1l,47)};3 1l(){5 c=l.L();l.U();1I(p);1B();4(r.2U){u.1y(3(a){4(!a){4(r.19){5 b=1g(u.J()).17(0,-1);u.J(b.2Z(r.R)+(b.7?r.R:""))}A u.J("")}})}4(c)$.D.1N(o,o.H.7,o.H.7)};3 2V(q,a){4(a&&a.7&&s){1B();l.2T(a,q);1A(q,a[0].H);l.1W()}A{1l()}};3 1R(f,d,g){4(!r.1C)f=f.O();5 e=n.2S(f);4(e&&e.7){d(f,e)}A 4((Y r.11=="1w")&&(r.11.7>0)){5 c={45:+1E 44()};$.K(r.2R,3(a,b){c[a]=Y b=="3"?b():b});$.43({42:"41",3Z:"12"+o.3Y,2M:r.2M,11:r.11,w:$.1o({q:1k(f),3X:r.Z},c),3W:3(a){5 b=r.1r&&r.1r(a)||1r(a);n.1h(f,b);d(f,b)}})}A{l.2J();g(f)}};3 1r(c){5 d=[];5 b=c.1Z("\\n");16(5 i=0;i<b.7;i++){5 a=$.1p(b[i]);4(a){a=a.1Z("|");d[d.7]={w:a,H:a[0],M:r.1v&&r.1v(a,a[0])||a[0]}}}6 d};3 1B(){u.1e(r.21)}};$.D.1L={24:"3R",2H:"3P",21:"3O",22:1,1D:3M,1C:B,1a:C,1V:B,1j:10,Z:3K,2U:B,2R:{},1S:C,1K:3(a){6 a[0]},1q:14,1A:B,E:0,19:B,R:", ",1t:3(b,a){6 b.2C(1E 3J("(?![^&;]+;)(?!<[^<>]*)("+a.2C(/([\\^\\$\\(\\)\\[\\]\\{\\}\\*\\.\\+\\?\\|\\\\])/2A,"\\\\$1")+")(?![^<>]*>)(?![^&;]+;)","2A"),"<2z>$1</2z>")},1x:C,1s:3I};$.D.2W=3(g){5 h={};5 j=0;3 1a(s,a){4(!g.1C)s=s.O();5 i=s.3H(a);4(i==-1)6 B;6 i==0||g.1V};3 1h(q,a){4(j>g.1j){18()}4(!h[q]){j++}h[q]=a}3 1f(){4(!g.w)6 B;5 f={},2w=0;4(!g.11)g.1j=1;f[""]=[];16(5 i=0,30=g.w.7;i<30;i++){5 c=g.w[i];c=(Y c=="1w")?[c]:c;5 d=g.1q(c,i+1,g.w.7);4(d===B)1P;5 e=d.3G(0).O();4(!f[e])f[e]=[];5 b={H:d,w:c,M:g.1v&&g.1v(c)||d};f[e].1O(b);4(2w++<g.Z){f[""].1O(b)}};$.K(f,3(i,a){g.1j++;1h(i,a)})}1H(1f,25);3 18(){h={};j=0}6{18:18,1h:1h,1f:1f,2S:3(q){4(!g.1j||!j)6 14;4(!g.11&&g.1V){5 a=[];16(5 k 2G h){4(k.7>0){5 c=h[k];$.K(c,3(i,x){4(1a(x.H,q)){a.1O(x)}})}}6 a}A 4(h[q]){6 h[q]}A 4(g.1a){16(5 i=q.7-1;i>=g.22;i--){5 c=h[q.3F(0,i)];4(c){5 a=[];$.K(c,3(i,x){4(1a(x.H,q)){a[a.7]=x}});6 a}}}6 14}}};$.D.2Q=3(e,g,f,k){5 h={G:"3E"};5 j,y=-1,w,1m="",1M=C,F,z;3 2r(){4(!1M)6;F=$("<3D/>").U().P(e.2H).T("3C","3B").1J(2p.2n);z=$("<3z/>").1J(F).3y(3(a){4(V(a).2m&&V(a).2m.3w()==\'2l\'){y=$("1F",z).1e(h.G).3u(V(a));$(V(a)).P(h.G)}}).2i(3(a){$(V(a)).P(h.G);f();g.1G();6 B}).3t(3(){k.1z=C}).3s(3(){k.1z=B});4(e.E>0)F.T("E",e.E);1M=B}3 V(a){5 b=a.V;3r(b&&b.3q!="2l")b=b.3p;4(!b)6[];6 b}3 S(b){j.17(y,y+1).1e(h.G);2h(b);5 a=j.17(y,y+1).P(h.G);4(e.1x){5 c=0;j.17(0,y).K(3(){c+=I.1i});4((c+a[0].1i-z.1c())>z[0].3o){z.1c(c+a[0].1i-z.3n())}A 4(c<z.1c()){z.1c(c)}}};3 2h(a){y+=a;4(y<0){y=j.1b()-1}A 4(y>=j.1b()){y=0}}3 2g(a){6 e.Z&&e.Z<a?e.Z:a}3 2f(){z.2B();5 b=2g(w.7);16(5 i=0;i<b;i++){4(!w[i])1P;5 a=e.1K(w[i].w,i+1,b,w[i].H,1m);4(a===B)1P;5 c=$("<1F/>").3m(e.1t(a,1m)).P(i%2==0?"3l":"3k").1J(z)[0];$.w(c,"2c",w[i])}j=z.3j("1F");4(e.1S){j.17(0,1).P(h.G);y=0}4($.31.2b)z.2b()}6{2T:3(d,q){2r();w=d;1m=q;2f()},2u:3(){S(1)},2y:3(){S(-1)},2t:3(){4(y!=0&&y-8<0){S(-y)}A{S(-8)}},2s:3(){4(y!=j.1b()-1&&y+8>j.1b()){S(j.1b()-1-y)}A{S(8)}},U:3(){F&&F.U();j&&j.1e(h.G);y=-1},L:3(){6 F&&F.3i(":L")},3h:3(){6 I.L()&&(j.2a("."+h.G)[0]||e.1S&&j[0])},1W:3(){5 a=$(g).3g();F.T({E:Y e.E=="1w"||e.E>0?e.E:$(g).E(),2E:a.2E+g.1i,1Q:a.1Q}).1W();4(e.1x){z.1c(0);z.T({29:e.1s,3e:\'3d\'});4($.1T.3b&&Y 2p.2n.3T.29==="3a"){5 c=0;j.K(3(){c+=I.1i});5 b=c>e.1s;z.T(\'3V\',b?e.1s:c);4(!b){j.E(z.E()-28(j.T("32-1Q"))-28(j.T("32-39")))}}}},26:3(){5 a=j&&j.2a("."+h.G).1e(h.G);6 a&&a.7&&$.w(a[0],"2c")},2J:3(){z&&z.2B()},1u:3(){F&&F.37()}}};$.D.1N=3(b,a,c){4(b.2O){5 d=b.2O();d.36(C);d.35("2P",a);d.4c("2P",c);d.4b()}A 4(b.2Y){b.2Y(a,c)}A{4(b.2X){b.2X=a;b.4a=c}}b.1G()}})(49);',62,261,'|||function|if|var|return|length|||||||||||||||||||||||||data||active|list|else|false|true|Autocompleter|width|element|ACTIVE|value|this|val|each|visible|result|break|toLowerCase|addClass|case|multipleSeparator|moveSelect|css|hide|target|onChange|bind|typeof|max||url|autocomplete||null|trigger|for|slice|flush|multiple|matchSubset|size|scrollTop|preventDefault|removeClass|populate|trimWords|add|offsetHeight|cacheLength|lastWord|hideResultsNow|term|arguments|extend|trim|formatMatch|parse|scrollHeight|highlight|unbind|formatResult|string|scroll|search|mouseDownOnSelect|autoFill|stopLoading|matchCase|delay|new|li|focus|setTimeout|clearTimeout|appendTo|formatItem|defaults|needsInit|Selection|push|continue|left|request|selectFirst|browser|selectCurrent|matchContains|show|unautocomplete|setOptions|split|flushCache|loadingClass|minChars|findValueCallback|inputClass||selected||parseInt|maxHeight|filter|bgiframe|ac_data|COMMA|BACKSPACE|fillList|limitNumberOfItems|movePosition|click|PAGEUP|hideResults|LI|nodeName|body|PAGEDOWN|document|ESC|init|pageDown|pageUp|next|RETURN|nullData|TAB|prev|strong|gi|empty|replace|DEL|top|keyCode|in|resultsClass|DOWN|emptyList|form|opera|dataType|UP|createTextRange|character|Select|extraParams|load|display|mustMatch|receiveData|Cache|selectionStart|setSelectionRange|join|ol|fn|padding|||moveStart|collapse|remove||right|undefined|msie|off|auto|overflow|attr|offset|current|is|find|ac_odd|ac_even|html|innerHeight|clientHeight|parentNode|tagName|while|mouseup|mousedown|index|blur|toUpperCase|188|mouseover|ul|default|absolute|position|div|ac_over|substr|charAt|indexOf|180|RegExp|100|switch|400|keydown|ac_loading|ac_results|keypress|ac_input|submit|style|150|height|success|limit|name|port||abort|mode|ajax|Date|timestamp||200|substring|jQuery|selectionEnd|select|moveEnd'.split('|'),0,{}))
\ No newline at end of file +eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}(';(3($){$.31.1o({12:3(b,d){5 c=Y b=="1w";d=$.1o({},$.D.1L,{11:c?b:14,w:c?14:b,1D:c?$.D.1L.1D:10,Z:d&&!d.1x?10:3U},d);d.1t=d.1t||3(a){6 a};d.1q=d.1q||d.1K;6 I.K(3(){1E $.D(I,d)})},M:3(a){6 I.X("M",a)},1y:3(a){6 I.15("1y",[a])},20:3(){6 I.15("20")},1Y:3(a){6 I.15("1Y",[a])},1X:3(){6 I.15("1X")}});$.D=3(o,r){5 t={2N:38,2I:40,2D:46,2x:9,2v:13,2q:27,2d:3x,2j:33,2o:34,2e:8};5 u=$(o).3f("12","3c").P(r.24);5 p;5 m="";5 n=$.D.2W(r);5 s=0;5 k;5 h={1z:B};5 l=$.D.2Q(r,o,1U,h);5 j;$.1T.2L&&$(o.2K).X("3S.12",3(){4(j){j=B;6 B}});u.X(($.1T.2L?"3Q":"3N")+".12",3(a){k=a.2F;3L(a.2F){Q t.2N:a.1d();4(l.L()){l.2y()}A{W(0,C)}N;Q t.2I:a.1d();4(l.L()){l.2u()}A{W(0,C)}N;Q t.2j:a.1d();4(l.L()){l.2t()}A{W(0,C)}N;Q t.2o:a.1d();4(l.L()){l.2s()}A{W(0,C)}N;Q r.19&&$.1p(r.R)==","&&t.2d:Q t.2x:Q t.2v:4(1U()){a.1d();j=C;6 B}N;Q t.2q:l.U();N;3A:1I(p);p=1H(W,r.1D);N}}).1G(3(){s++}).3v(3(){s=0;4(!h.1z){2k()}}).2i(3(){4(s++>1&&!l.L()){W(0,C)}}).X("1y",3(){5 c=(1n.7>1)?1n[1]:14;3 23(q,a){5 b;4(a&&a.7){16(5 i=0;i<a.7;i++){4(a[i].M.O()==q.O()){b=a[i];N}}}4(Y c=="3")c(b);A u.15("M",b&&[b.w,b.H])}$.K(1g(u.J()),3(i,a){1R(a,23,23)})}).X("20",3(){n.18()}).X("1Y",3(){$.1o(r,1n[1]);4("w"2G 1n[1])n.1f()}).X("1X",3(){l.1u();u.1u();$(o.2K).1u(".12")});3 1U(){5 b=l.26();4(!b)6 B;5 v=b.M;m=v;4(r.19){5 a=1g(u.J());4(a.7>1){v=a.17(0,a.7-1).2Z(r.R)+r.R+v}v+=r.R}u.J(v);1l();u.15("M",[b.w,b.H]);6 C}3 W(b,c){4(k==t.2D){l.U();6}5 a=u.J();4(!c&&a==m)6;m=a;a=1k(a);4(a.7>=r.22){u.P(r.21);4(!r.1C)a=a.O();1R(a,2V,1l)}A{1B();l.U()}};3 1g(b){4(!b){6[""]}5 d=b.1Z(r.R);5 c=[];$.K(d,3(i,a){4($.1p(a))c[i]=$.1p(a)});6 c}3 1k(a){4(!r.19)6 a;5 b=1g(a);6 b[b.7-1]}3 1A(q,a){4(r.1A&&(1k(u.J()).O()==q.O())&&k!=t.2e){u.J(u.J()+a.48(1k(m).7));$.D.1N(o,m.7,m.7+a.7)}};3 2k(){1I(p);p=1H(1l,47)};3 1l(){5 c=l.L();l.U();1I(p);1B();4(r.2U){u.1y(3(a){4(!a){4(r.19){5 b=1g(u.J()).17(0,-1);u.J(b.2Z(r.R)+(b.7?r.R:""))}A u.J("")}})}4(c)$.D.1N(o,o.H.7,o.H.7)};3 2V(q,a){4(a&&a.7&&s){1B();l.2T(a,q);1A(q,a[0].H);l.1W()}A{1l()}};3 1R(f,d,g){4(!r.1C)f=f.O();5 e=n.2S(f);4(e&&e.7){d(f,e)}A 4((Y r.11=="1w")&&(r.11.7>0)){5 c={45:+1E 44()};$.K(r.2R,3(a,b){c[a]=Y b=="3"?b():b});$.43({42:"41",3Z:"12"+o.3Y,2M:r.2M,11:r.11,w:$.1o({q:1k(f),3X:r.Z},c),3W:3(a){5 b=r.1r&&r.1r(a)||1r(a);n.1h(f,b);d(f,b)}})}A{l.2J();g(f)}};3 1r(c){5 d=[];5 b=c.1Z("\\n");16(5 i=0;i<b.7;i++){5 a=$.1p(b[i]);4(a){a=a.1Z("|");d[d.7]={w:a,H:a[0],M:r.1v&&r.1v(a,a[0])||a[0]}}}6 d};3 1B(){u.1e(r.21)}};$.D.1L={24:"3R",2H:"3P",21:"3O",22:1,1D:3M,1C:B,1a:C,1V:B,1j:10,Z:3K,2U:B,2R:{},1S:C,1K:3(a){6 a[0]},1q:14,1A:B,E:0,19:B,R:", ",1t:3(b,a){6 b.2C(1E 3J("(?![^&;]+;)(?!<[^<>]*)("+a.2C(/([\\^\\$\\(\\)\\[\\]\\{\\}\\*\\.\\+\\?\\|\\\\])/2A,"\\\\$1")+")(?![^<>]*>)(?![^&;]+;)","2A"),"<2z>$1</2z>")},1x:C,1s:3I};$.D.2W=3(g){5 h={};5 j=0;3 1a(s,a){4(!g.1C)s=s.O();5 i=s.3H(a);4(i==-1)6 B;6 i==0||g.1V};3 1h(q,a){4(j>g.1j){18()}4(!h[q]){j++}h[q]=a}3 1f(){4(!g.w)6 B;5 f={},2w=0;4(!g.11)g.1j=1;f[""]=[];16(5 i=0,30=g.w.7;i<30;i++){5 c=g.w[i];c=(Y c=="1w")?[c]:c;5 d=g.1q(c,i+1,g.w.7);4(d===B)1P;5 e=d.3G(0).O();4(!f[e])f[e]=[];5 b={H:d,w:c,M:g.1v&&g.1v(c)||d};f[e].1O(b);4(2w++<g.Z){f[""].1O(b)}};$.K(f,3(i,a){g.1j++;1h(i,a)})}1H(1f,25);3 18(){h={};j=0}6{18:18,1h:1h,1f:1f,2S:3(q){4(!g.1j||!j)6 14;4(!g.11&&g.1V){5 a=[];16(5 k 2G h){4(k.7>0){5 c=h[k];$.K(c,3(i,x){4(1a(x.H,q)){a.1O(x)}})}}6 a}A 4(h[q]){6 h[q]}A 4(g.1a){16(5 i=q.7-1;i>=g.22;i--){5 c=h[q.3F(0,i)];4(c){5 a=[];$.K(c,3(i,x){4(1a(x.H,q)){a[a.7]=x}});6 a}}}6 14}}};$.D.2Q=3(e,g,f,k){5 h={G:"3E"};5 j,y=-1,w,1m="",1M=C,F,z;3 2r(){4(!1M)6;F=$("<3D/>").U().P(e.2H).T("3C","3B").1J(2p.2n);z=$("<3z/>").1J(F).3y(3(a){4(V(a).2m&&V(a).2m.3w()==\'2l\'){y=$("1F",z).1e(h.G).3u(V(a));$(V(a)).P(h.G)}}).2i(3(a){$(V(a)).P(h.G);f();g.1G();6 B}).3t(3(){k.1z=C}).3s(3(){k.1z=B});4(e.E>0)F.T("E",e.E);1M=B}3 V(a){5 b=a.V;3r(b&&b.3q!="2l")b=b.3p;4(!b)6[];6 b}3 S(b){j.17(y,y+1).1e(h.G);2h(b);5 a=j.17(y,y+1).P(h.G);4(e.1x){5 c=0;j.17(0,y).K(3(){c+=I.1i});4((c+a[0].1i-z.1c())>z[0].3o){z.1c(c+a[0].1i-z.3n())}A 4(c<z.1c()){z.1c(c)}}};3 2h(a){y+=a;4(y<0){y=j.1b()-1}A 4(y>=j.1b()){y=0}}3 2g(a){6 e.Z&&e.Z<a?e.Z:a}3 2f(){z.2B();5 b=2g(w.7);16(5 i=0;i<b;i++){4(!w[i])1P;5 a=e.1K(w[i].w,i+1,b,w[i].H,1m);4(a===B)1P;5 c=$("<1F/>").3m(e.1t(a,1m)).P(i%2==0?"3l":"3k").1J(z)[0];$.w(c,"2c",w[i])}j=z.3j("1F");4(e.1S){j.17(0,1).P(h.G);y=0}4($.31.2b)z.2b()}6{2T:3(d,q){2r();w=d;1m=q;2f()},2u:3(){S(1)},2y:3(){S(-1)},2t:3(){4(y!=0&&y-8<0){S(-y)}A{S(-8)}},2s:3(){4(y!=j.1b()-1&&y+8>j.1b()){S(j.1b()-1-y)}A{S(8)}},U:3(){F&&F.U();j&&j.1e(h.G);y=-1},L:3(){6 F&&F.3i(":L")},3h:3(){6 I.L()&&(j.2a("."+h.G)[0]||e.1S&&j[0])},1W:3(){5 a=$(g).3g();F.T({E:Y e.E=="1w"||e.E>0?e.E:$(g).E(),2E:a.2E+g.1i,1Q:a.1Q}).1W();4(e.1x){z.1c(0);z.T({29:e.1s,3e:\'3d\'});4($.1T.3b&&Y 2p.2n.3T.29==="3a"){5 c=0;j.K(3(){c+=I.1i});5 b=c>e.1s;z.T(\'3V\',b?e.1s:c);4(!b){j.E(z.E()-28(j.T("32-1Q"))-28(j.T("32-39")))}}}},26:3(){5 a=j&&j.2a("."+h.G).1e(h.G);6 a&&a.7&&$.w(a[0],"2c")},2J:3(){z&&z.2B()},1u:3(){F&&F.37()}}};$.D.1N=3(b,a,c){4(b.2O){5 d=b.2O();d.36(C);d.35("2P",a);d.4c("2P",c);d.4b()}A 4(b.2Y){b.2Y(a,c)}A{4(b.2X){b.2X=a;b.4a=c}}b.1G()}})(49);',62,261,'|||function|if|var|return|length|||||||||||||||||||||||||data||active|list|else|false|true|Autocompleter|width|element|ACTIVE|value|this|val|each|visible|result|break|toLowerCase|addClass|case|multipleSeparator|moveSelect|css|hide|target|onChange|bind|typeof|max||url|autocomplete||null|trigger|for|slice|flush|multiple|matchSubset|size|scrollTop|preventDefault|removeClass|populate|trimWords|add|offsetHeight|cacheLength|lastWord|hideResultsNow|term|arguments|extend|trim|formatMatch|parse|scrollHeight|highlight|unbind|formatResult|string|scroll|search|mouseDownOnSelect|autoFill|stopLoading|matchCase|delay|new|li|focus|setTimeout|clearTimeout|appendTo|formatItem|defaults|needsInit|Selection|push|continue|left|request|selectFirst|browser|selectCurrent|matchContains|show|unautocomplete|setOptions|split|flushCache|loadingClass|minChars|findValueCallback|inputClass||selected||parseInt|maxHeight|filter|bgiframe|ac_data|COMMA|BACKSPACE|fillList|limitNumberOfItems|movePosition|click|PAGEUP|hideResults|LI|nodeName|body|PAGEDOWN|document|ESC|init|pageDown|pageUp|next|RETURN|nullData|TAB|prev|strong|gi|empty|replace|DEL|top|keyCode|in|resultsClass|DOWN|emptyList|form|opera|dataType|UP|createTextRange|character|Select|extraParams|load|display|mustMatch|receiveData|Cache|selectionStart|setSelectionRange|join|ol|fn|padding|||moveStart|collapse|remove||right|undefined|msie|off|auto|overflow|attr|offset|current|is|find|ac_odd|ac_even|html|innerHeight|clientHeight|parentNode|tagName|while|mouseup|mousedown|index|blur|toUpperCase|188|mouseover|ul|default|absolute|position|div|ac_over|substr|charAt|indexOf|180|RegExp|100|switch|400|keydown|ac_loading|ac_results|keypress|ac_input|submit|style|150|height|success|limit|name|port||abort|mode|ajax|Date|timestamp||200|substring|jQuery|selectionEnd|select|moveEnd'.split('|'),0,{})); diff --git a/lib/swfobject.js b/lib/swfobject.js new file mode 100644 index 00000000..87e61553 --- /dev/null +++ b/lib/swfobject.js @@ -0,0 +1,4 @@ +/* SWFObject v2.2 <http://code.google.com/p/swfobject/> + is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> +*/ +var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y<X;Y++){U[Y]()}}function K(X){if(J){X()}else{U[U.length]=X}}function s(Y){if(typeof O.addEventListener!=D){O.addEventListener("load",Y,false)}else{if(typeof j.addEventListener!=D){j.addEventListener("load",Y,false)}else{if(typeof O.attachEvent!=D){i(O,"onload",Y)}else{if(typeof O.onload=="function"){var X=O.onload;O.onload=function(){X();Y()}}else{O.onload=Y}}}}}function h(){if(T){V()}else{H()}}function V(){var X=j.getElementsByTagName("body")[0];var aa=C(r);aa.setAttribute("type",q);var Z=X.appendChild(aa);if(Z){var Y=0;(function(){if(typeof Z.GetVariable!=D){var ab=Z.GetVariable("$version");if(ab){ab=ab.split(" ")[1].split(",");M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}else{if(Y<10){Y++;setTimeout(arguments.callee,10);return}}X.removeChild(aa);Z=null;H()})()}else{H()}}function H(){var ag=o.length;if(ag>0){for(var af=0;af<ag;af++){var Y=o[af].id;var ab=o[af].callbackFn;var aa={success:false,id:Y};if(M.pv[0]>0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad<ac;ad++){if(X[ad].getAttribute("name").toLowerCase()!="movie"){ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value")}}P(ai,ah,Y,ab)}else{p(ae);if(ab){ab(aa)}}}}}else{w(Y,true);if(ab){var Z=z(Y);if(Z&&typeof Z.SetVariable!=D){aa.success=true;aa.ref=Z}ab(aa)}}}}}function z(aa){var X=null;var Y=c(aa);if(Y&&Y.nodeName=="OBJECT"){if(typeof Y.SetVariable!=D){X=Y}else{var Z=Y.getElementsByTagName(r)[0];if(Z){X=Z}}}return X}function A(){return !a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312)}function P(aa,ab,X,Z){a=true;E=Z||null;B={success:false,id:X};var ae=c(X);if(ae){if(ae.nodeName=="OBJECT"){l=g(ae);Q=null}else{l=ae;Q=X}aa.id=R;if(typeof aa.width==D||(!/%$/.test(aa.width)&&parseInt(aa.width,10)<310)){aa.width="310"}if(typeof aa.height==D||(!/%$/.test(aa.height)&&parseInt(aa.height,10)<137)){aa.height="137"}j.title=j.title.slice(0,47)+" - Flash Player Installation";var ad=M.ie&&M.win?"ActiveX":"PlugIn",ac="MMredirectURL="+encodeURI(O.location).toString().replace(/&/g,"%26")+"&MMplayerType="+ad+"&MMdoctitle="+j.title;if(typeof ab.flashvars!=D){ab.flashvars+="&"+ac}else{ab.flashvars=ac}if(M.ie&&M.win&&ae.readyState!=4){var Y=C("div");X+="SWFObjectNew";Y.setAttribute("id",X);ae.parentNode.insertBefore(Y,ae);ae.style.display="none";(function(){if(ae.readyState==4){ae.parentNode.removeChild(ae)}else{setTimeout(arguments.callee,10)}})()}u(aa,ab,X)}}function p(Y){if(M.ie&&M.win&&Y.readyState!=4){var X=C("div");Y.parentNode.insertBefore(X,Y);X.parentNode.replaceChild(g(Y),X);Y.style.display="none";(function(){if(Y.readyState==4){Y.parentNode.removeChild(Y)}else{setTimeout(arguments.callee,10)}})()}else{Y.parentNode.replaceChild(g(Y),Y)}}function g(ab){var aa=C("div");if(M.win&&M.ie){aa.innerHTML=ab.innerHTML}else{var Y=ab.getElementsByTagName(r)[0];if(Y){var ad=Y.childNodes;if(ad){var X=ad.length;for(var Z=0;Z<X;Z++){if(!(ad[Z].nodeType==1&&ad[Z].nodeName=="PARAM")&&!(ad[Z].nodeType==8)){aa.appendChild(ad[Z].cloneNode(true))}}}}}return aa}function u(ai,ag,Y){var X,aa=c(Y);if(M.wk&&M.wk<312){return X}if(aa){if(typeof ai.id==D){ai.id=Y}if(M.ie&&M.win){var ah="";for(var ae in ai){if(ai[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="data"){ag.movie=ai[ae]}else{if(ae.toLowerCase()=="styleclass"){ah+=' class="'+ai[ae]+'"'}else{if(ae.toLowerCase()!="classid"){ah+=" "+ae+'="'+ai[ae]+'"'}}}}}var af="";for(var ad in ag){if(ag[ad]!=Object.prototype[ad]){af+='<param name="'+ad+'" value="'+ag[ad]+'" />'}}aa.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ah+">"+af+"</object>";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab<ac;ab++){I[ab][0].detachEvent(I[ab][1],I[ab][2])}var Z=N.length;for(var aa=0;aa<Z;aa++){y(N[aa])}for(var Y in M){M[Y]=null}M=null;for(var X in swfobject){swfobject[X]=null}swfobject=null})}}();return{registerObject:function(ab,X,aa,Z){if(M.w3&&ab&&X){var Y={};Y.id=ab;Y.swfVersion=X;Y.expressInstall=aa;Y.callbackFn=Z;o[o.length]=Y;w(ab,false)}else{if(Z){Z({success:false,id:ab})}}},getObjectById:function(X){if(M.w3){return z(X)}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var X={success:false,id:ah};if(M.w3&&!(M.wk&&M.wk<312)&&ab&&ah&&ae&&ag&&Y){w(ah,false);K(function(){ae+="";ag+="";var aj={};if(af&&typeof af===r){for(var al in af){aj[al]=af[al]}}aj.data=ab;aj.width=ae;aj.height=ag;var am={};if(ad&&typeof ad===r){for(var ak in ad){am[ak]=ad[ak]}}if(Z&&typeof Z===r){for(var ai in Z){if(typeof am.flashvars!=D){am.flashvars+="&"+ai+"="+Z[ai]}else{am.flashvars=ai+"="+Z[ai]}}}if(F(Y)){var an=u(aj,am,ah);if(aj.id==ah){w(ah,true)}X.success=true;X.ref=an}else{if(aa&&A()){aj.data=aa;P(aj,am,ah,ac);return}else{w(ah,true)}}if(ac){ac(X)}})}else{if(ac){ac(X)}}},switchOffAutoHideShow:function(){m=false},ua:M,getFlashPlayerVersion:function(){return{major:M.pv[0],minor:M.pv[1],release:M.pv[2]}},hasFlashPlayerVersion:F,createSWF:function(Z,Y,X){if(M.w3){return u(Z,Y,X)}else{return undefined}},showExpressInstall:function(Z,aa,X,Y){if(M.w3&&A()){P(Z,aa,X,Y)}},removeSWF:function(X){if(M.w3){y(X)}},createCSS:function(aa,Z,Y,X){if(M.w3){v(aa,Z,Y,X)}},addDomLoadEvent:K,addLoadEvent:s,getQueryParamValue:function(aa){var Z=j.location.search||j.location.hash;if(Z){if(/\?/.test(Z)){Z=Z.split("?")[1]}if(aa==null){return L(Z)}var Y=Z.split("&");for(var X=0;X<Y.length;X++){if(Y[X].substring(0,Y[X].indexOf("="))==aa){return L(Y[X].substring((Y[X].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(a){var X=c(R);if(X&&l){X.parentNode.replaceChild(l,X);if(Q){w(Q,true);if(M.ie&&M.win){l.style.display="block"}}if(E){E(B)}}a=false}}}}();
\ No newline at end of file diff --git a/lib/uploadify/cancel.png b/lib/uploadify/cancel.png Binary files differnew file mode 100644 index 00000000..1c062ae5 --- /dev/null +++ b/lib/uploadify/cancel.png diff --git a/lib/uploadify/jquery.uploadify.min.js b/lib/uploadify/jquery.uploadify.min.js new file mode 100644 index 00000000..43053119 --- /dev/null +++ b/lib/uploadify/jquery.uploadify.min.js @@ -0,0 +1,26 @@ +/* +Uploadify v2.1.0 +Release Date: August 24, 2009 + +Copyright (c) 2009 Ronnie Garcia, Travis Nickels + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ + +if(jQuery){(function(a){a.extend(a.fn,{uploadify:function(b){a(this).each(function(){settings=a.extend({id:a(this).attr("id"),uploader:"uploadify.swf",script:"uploadify.php",expressInstall:null,folder:"",height:30,width:110,cancelImg:"cancel.png",wmode:"opaque",scriptAccess:"sameDomain",fileDataName:"Filedata",method:"POST",queueSizeLimit:999,simUploadLimit:1,queueID:false,displayData:"percentage",onInit:function(){},onSelect:function(){},onQueueFull:function(){},onCheck:function(){},onCancel:function(){},onError:function(){},onProgress:function(){},onComplete:function(){},onAllComplete:function(){}},b);var e=location.pathname;e=e.split("/");e.pop();e=e.join("/")+"/";var f={};f.uploadifyID=settings.id;f.pagepath=e;if(settings.buttonImg){f.buttonImg=escape(settings.buttonImg)}if(settings.buttonText){f.buttonText=escape(settings.buttonText)}if(settings.rollover){f.rollover=true}f.script=settings.script;f.folder=escape(settings.folder);if(settings.scriptData){var g="";for(var d in settings.scriptData){g+="&"+d+"="+settings.scriptData[d]}f.scriptData=escape(g.substr(1))}f.width=settings.width;f.height=settings.height;f.wmode=settings.wmode;f.method=settings.method;f.queueSizeLimit=settings.queueSizeLimit;f.simUploadLimit=settings.simUploadLimit;if(settings.hideButton){f.hideButton=true}if(settings.fileDesc){f.fileDesc=settings.fileDesc}if(settings.fileExt){f.fileExt=settings.fileExt}if(settings.multi){f.multi=true}if(settings.auto){f.auto=true}if(settings.sizeLimit){f.sizeLimit=settings.sizeLimit}if(settings.checkScript){f.checkScript=settings.checkScript}if(settings.fileDataName){f.fileDataName=settings.fileDataName}if(settings.queueID){f.queueID=settings.queueID}if(settings.onInit()!==false){a(this).css("display","none");a(this).after('<div id="'+a(this).attr("id")+'Uploader"></div>');swfobject.embedSWF(settings.uploader,settings.id+"Uploader",settings.width,settings.height,"9.0.24",settings.expressInstall,f,{quality:"high",wmode:settings.wmode,allowScriptAccess:settings.scriptAccess});if(settings.queueID==false){a("#"+a(this).attr("id")+"Uploader").after('<div id="'+a(this).attr("id")+'Queue" class="uploadifyQueue"></div>')}}if(typeof(settings.onOpen)=="function"){a(this).bind("uploadifyOpen",settings.onOpen)}a(this).bind("uploadifySelect",{action:settings.onSelect,queueID:settings.queueID},function(j,h,i){if(j.data.action(j,h,i)!==false){var k=Math.round(i.size/1024*100)*0.01;var l="KB";if(k>1000){k=Math.round(k*0.001*100)*0.01;l="MB"}var m=k.toString().split(".");if(m.length>1){k=m[0]+"."+m[1].substr(0,2)}else{k=m[0]}if(i.name.length>20){fileName=i.name.substr(0,20)+"..."}else{fileName=i.name}queue="#"+a(this).attr("id")+"Queue";if(j.data.queueID){queue="#"+j.data.queueID}a(queue).append('<div id="'+a(this).attr("id")+h+'" class="uploadifyQueueItem"><div class="cancel"><a href="javascript:jQuery(\'#'+a(this).attr("id")+"').uploadifyCancel('"+h+'\')"><img src="'+settings.cancelImg+'" border="0" /></a></div><span class="fileName">'+fileName+" ("+k+l+')</span><span class="percentage"></span><div class="uploadifyProgress"><div id="'+a(this).attr("id")+h+'ProgressBar" class="uploadifyProgressBar"><!--Progress Bar--></div></div></div>')}});if(typeof(settings.onSelectOnce)=="function"){a(this).bind("uploadifySelectOnce",settings.onSelectOnce)}a(this).bind("uploadifyQueueFull",{action:settings.onQueueFull},function(h,i){if(h.data.action(h,i)!==false){alert("The queue is full. The max size is "+i+".")}});a(this).bind("uploadifyCheckExist",{action:settings.onCheck},function(m,l,k,j,o){var i=new Object();i=k;i.folder=e+j;if(o){for(var h in k){var n=h}}a.post(l,i,function(r){for(var p in r){if(m.data.action(m,l,k,j,o)!==false){var q=confirm("Do you want to replace the file "+r[p]+"?");if(!q){document.getElementById(a(m.target).attr("id")+"Uploader").cancelFileUpload(p,true,true)}}}if(o){document.getElementById(a(m.target).attr("id")+"Uploader").startFileUpload(n,true)}else{document.getElementById(a(m.target).attr("id")+"Uploader").startFileUpload(null,true)}},"json")});a(this).bind("uploadifyCancel",{action:settings.onCancel},function(l,h,k,m,j){if(l.data.action(l,h,k,m,j)!==false){var i=(j==true)?0:250;a("#"+a(this).attr("id")+h).fadeOut(i,function(){a(this).remove()})}});if(typeof(settings.onClearQueue)=="function"){a(this).bind("uploadifyClearQueue",settings.onClearQueue)}var c=[];a(this).bind("uploadifyError",{action:settings.onError},function(l,h,k,j){if(l.data.action(l,h,k,j)!==false){var i=new Array(h,k,j);c.push(i);a("#"+a(this).attr("id")+h+" .percentage").text(" - "+j.type+" Error");a("#"+a(this).attr("id")+h).addClass("uploadifyError")}});a(this).bind("uploadifyProgress",{action:settings.onProgress,toDisplay:settings.displayData},function(j,h,i,k){if(j.data.action(j,h,i,k)!==false){a("#"+a(this).attr("id")+h+"ProgressBar").css("width",k.percentage+"%");if(j.data.toDisplay=="percentage"){displayData=" - "+k.percentage+"%"}if(j.data.toDisplay=="speed"){displayData=" - "+k.speed+"KB/s"}if(j.data.toDisplay==null){displayData=" "}a("#"+a(this).attr("id")+h+" .percentage").text(displayData)}});a(this).bind("uploadifyComplete",{action:settings.onComplete},function(k,h,j,i,l){if(k.data.action(k,h,j,unescape(i),l)!==false){a("#"+a(this).attr("id")+h+" .percentage").text(" - Completed");a("#"+a(this).attr("id")+h).fadeOut(250,function(){a(this).remove()})}});if(typeof(settings.onAllComplete)=="function"){a(this).bind("uploadifyAllComplete",{action:settings.onAllComplete},function(h,i){if(h.data.action(h,i)!==false){c=[]}})}})},uploadifySettings:function(f,j,c){var g=false;a(this).each(function(){if(f=="scriptData"&&j!=null){if(c){var i=j}else{var i=a.extend(settings.scriptData,j)}var l="";for(var k in i){l+="&"+k+"="+escape(i[k])}j=l.substr(1)}g=document.getElementById(a(this).attr("id")+"Uploader").updateSettings(f,j)});if(j==null){if(f=="scriptData"){var b=unescape(g).split("&");var e=new Object();for(var d=0;d<b.length;d++){var h=b[d].split("=");e[h[0]]=h[1]}g=e}return g}},uploadifyUpload:function(b){a(this).each(function(){document.getElementById(a(this).attr("id")+"Uploader").startFileUpload(b,false)})},uploadifyCancel:function(b){a(this).each(function(){document.getElementById(a(this).attr("id")+"Uploader").cancelFileUpload(b,true,false)})},uploadifyClearQueue:function(){a(this).each(function(){document.getElementById(a(this).attr("id")+"Uploader").clearFileUploadQueue(false)})}})})(jQuery)};
\ No newline at end of file diff --git a/lib/uploadify/uploadify.allglyphs.swf b/lib/uploadify/uploadify.allglyphs.swf Binary files differnew file mode 100644 index 00000000..4bad0117 --- /dev/null +++ b/lib/uploadify/uploadify.allglyphs.swf diff --git a/lib/uploadify/uploadify.css b/lib/uploadify/uploadify.css new file mode 100644 index 00000000..a0279443 --- /dev/null +++ b/lib/uploadify/uploadify.css @@ -0,0 +1,53 @@ +/* +Uploadify v2.1.0 +Release Date: August 24, 2009 + +Copyright (c) 2009 Ronnie Garcia, Travis Nickels + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ +.uploadifyQueueItem { + font: 11px Verdana, Geneva, sans-serif; + border: 2px solid #E5E5E5; + background-color: #F5F5F5; + margin-top: 5px; + padding: 10px; + width: auto; +} +.uploadifyError { + border: 2px solid #FBCBBC !important; + background-color: #FDE5DD !important; +} +.uploadifyQueueItem .cancel { + float: right; +} +.uploadifyProgress { + background-color: #FFFFFF; + border-top: 1px solid #808080; + border-left: 1px solid #808080; + border-right: 1px solid #C5C5C5; + border-bottom: 1px solid #C5C5C5; + margin-top: 10px; + width: 100%; +} +.uploadifyProgressBar { + background-color: #0099FF; + width: 1px; + height: 3px; +} diff --git a/lib/uploadify/uploadify.fla b/lib/uploadify/uploadify.fla Binary files differnew file mode 100644 index 00000000..c07bbaf3 --- /dev/null +++ b/lib/uploadify/uploadify.fla diff --git a/lib/uploadify/uploadify.swf b/lib/uploadify/uploadify.swf Binary files differnew file mode 100644 index 00000000..0385d9e6 --- /dev/null +++ b/lib/uploadify/uploadify.swf |