# HG changeset patch # User Marcin Kuzminski # Date 1302022294 -7200 # Node ID 3d9da7893fdbee55a781dc7ae4a576586f34600d # Parent a3b2b4b4e44076e253b3040f0926de0abaa357b9 fixes for stable diff -r a3b2b4b4e440 -r 3d9da7893fdb docs/changelog.rst --- a/docs/changelog.rst Tue Apr 05 18:04:06 2011 +0200 +++ b/docs/changelog.rst Tue Apr 05 18:51:34 2011 +0200 @@ -16,7 +16,10 @@ - fixed #140 freeze of python dateutil library, since new version is python2.x incompatible - setup-app will check for write permission in given path - +- cleaned up license info issue #149 +- fixes for issues #137 and #116 +- fixes crashes on gravatar, when passed in email as unicode +- fixed tooltip flickering problems 1.1.7 (**2011-03-23**) ====================== diff -r a3b2b4b4e440 -r 3d9da7893fdb rhodecode/controllers/files.py --- a/rhodecode/controllers/files.py Tue Apr 05 18:04:06 2011 +0200 +++ b/rhodecode/controllers/files.py Tue Apr 05 18:51:34 2011 +0200 @@ -4,7 +4,7 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Files controller for RhodeCode - + :created_on: Apr 21, 2010 :author: marcink :copyright: (C) 2009-2011 Marcin Kuzminski @@ -22,6 +22,7 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see . +import os import tempfile import logging import rhodecode.lib.helpers as h @@ -121,7 +122,7 @@ redirect(h.url('files_home', repo_name=repo_name, revision=cs.raw_id)) - fname = f_path.split('/')[-1].encode('utf8', 'replace') + fname = f_path.split(os.sep)[-1].encode('utf8', 'replace') response.content_disposition = 'attachment; filename=%s' % fname response.content_type = file_node.mimetype diff -r a3b2b4b4e440 -r 3d9da7893fdb rhodecode/lib/__init__.py --- a/rhodecode/lib/__init__.py Tue Apr 05 18:04:06 2011 +0200 +++ b/rhodecode/lib/__init__.py Tue Apr 05 18:51:34 2011 +0200 @@ -10,10 +10,10 @@ :copyright: (C) 2009-2010 Marcin Kuzminski :license: GPLv3, see COPYING for more details. """ -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; version 2 -# of the License or (at your opinion) any later version of the license. +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -21,22 +21,23 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, -# MA 02110-1301, USA. +# along with this program. If not, see . -def str2bool(v): - if isinstance(v, (str, unicode)): - obj = v.strip().lower() - if obj in ['true', 'yes', 'on', 'y', 't', '1']: - return True - elif obj in ['false', 'no', 'off', 'n', 'f', '0']: - return False - else: - raise ValueError("String is not true/false: %r" % obj) - return bool(v) +def str2bool(s): + if s is None: + return False + if s in (True, False): + return s + s = str(s).strip().lower() + return s in ('t', 'true', 'y', 'yes', 'on', '1') def generate_api_key(username, salt=None): + """ + Generates uniq API key for given username + + :param username: username as string + :param salt: salt to hash generate KEY + """ from tempfile import _RandomNameSequence import hashlib @@ -44,3 +45,24 @@ salt = _RandomNameSequence().next() return hashlib.sha1(username + salt).hexdigest() + +def safe_unicode(_str): + """ + safe unicode function. In case of UnicodeDecode error we try to return + unicode with errors replace, if this fails we return unicode with + string_escape decoding + """ + + if isinstance(_str, unicode): + return _str + + try: + u_str = unicode(_str) + except UnicodeDecodeError: + try: + u_str = _str.decode('utf-8', 'replace') + except UnicodeDecodeError: + #incase we have a decode error just represent as byte string + u_str = unicode(_str.encode('string_escape')) + + return u_str \ No newline at end of file diff -r a3b2b4b4e440 -r 3d9da7893fdb rhodecode/lib/helpers.py --- a/rhodecode/lib/helpers.py Tue Apr 05 18:04:06 2011 +0200 +++ b/rhodecode/lib/helpers.py Tue Apr 05 18:51:34 2011 +0200 @@ -5,11 +5,15 @@ """ import random import hashlib +import StringIO +import urllib + +from datetime import datetime from pygments.formatters import HtmlFormatter from pygments import highlight as code_highlight from pylons import url, app_globals as g from pylons.i18n.translation import _, ungettext -from vcs.utils.annotate import annotate_highlight + from webhelpers.html import literal, HTML, escape from webhelpers.html.tools import * from webhelpers.html.builder import make_tag @@ -26,11 +30,18 @@ convert_misc_entities, lchop, plural, rchop, remove_formatting, \ replace_whitespace, urlify, truncate, wrap_paragraphs from webhelpers.date import time_ago_in_words - +from webhelpers.paginate import Page from webhelpers.html.tags import _set_input_attrs, _set_id_attr, \ convert_boolean_attrs, NotGiven +from vcs.utils.annotate import annotate_highlight +from rhodecode.lib.utils import repo_name_slug +from rhodecode.lib import str2bool, safe_unicode + def _reset(name, value=None, id=NotGiven, type="reset", **attrs): + """ + Reset button + """ _set_input_attrs(attrs, type, name, value) _set_id_attr(attrs, id, name) convert_boolean_attrs(attrs, ["disabled"]) @@ -55,24 +66,13 @@ session.save() return session[token_key] - -#Custom helpers here :) -class _Link(object): - ''' - Make a url based on label and url with help of url_for - :param label:name of link if not defined url is used - :param url: the url for link - ''' +class _GetError(object): + """Get error from form_errors, and represent it as span wrapped error + message - def __call__(self, label='', *url_, **urlargs): - if label is None or '': - label = url - link_fn = link_to(label, url(*url_, **urlargs)) - return link_fn - -link = _Link() - -class _GetError(object): + :param field_name: field to fetch errors for + :param form_errors: form errors dict + """ def __call__(self, field_name, form_errors): tmpl = """%s""" @@ -81,29 +81,12 @@ get_error = _GetError() -def recursive_replace(str, replace=' '): - """ - Recursive replace of given sign to just one instance - :param str: given string - :param replace:char to find and replace multiple instances - - Examples:: - >>> recursive_replace("Mighty---Mighty-Bo--sstones",'-') - 'Mighty-Mighty-Bo-sstones' - """ - - if str.find(replace * 2) == -1: - return str - else: - str = str.replace(replace * 2, replace) - return recursive_replace(str, replace) - class _ToolTip(object): def __call__(self, tooltip_title, trim_at=50): - """ - Special function just to wrap our text into nice formatted autowrapped - text + """Special function just to wrap our text into nice formatted + autowrapped text + :param tooltip_title: """ @@ -111,11 +94,9 @@ .replace('\n', '
') def activate(self): - """ - Adds tooltip mechanism to the given Html all tooltips have to have - set class tooltip and set attribute tooltip_title. - Then a tooltip will be generated based on that - All with yui js tooltip + """Adds tooltip mechanism to the given Html all tooltips have to have + set class `tooltip` and set attribute `tooltip_title`. + Then a tooltip will be generated based on that. All with yui js tooltip """ js = ''' @@ -123,104 +104,26 @@ function toolTipsId(){ var ids = []; var tts = YAHOO.util.Dom.getElementsByClassName('tooltip'); - + for (var i = 0; i < tts.length; i++) { //if element doesn't not have and id autogenerate one for tooltip - + if (!tts[i].id){ tts[i].id='tt'+i*100; } ids.push(tts[i].id); } - return ids + return ids }; - var myToolTips = new YAHOO.widget.Tooltip("tooltip", { - context: toolTipsId(), + var myToolTips = new YAHOO.widget.Tooltip("tooltip", { + context: [[toolTipsId()],"tl","bl",null,[0,5]], monitorresize:false, xyoffset :[0,0], autodismissdelay:300000, hidedelay:5, showdelay:20, }); - - //Mouse Over event disabled for new repositories since they don't - //have last commit message - myToolTips.contextMouseOverEvent.subscribe( - function(type, args) { - var context = args[0]; - var txt = context.getAttribute('tooltip_title'); - if(txt){ - return true; - } - else{ - return false; - } - }); - - - // Set the text for the tooltip just before we display it. Lazy method - myToolTips.contextTriggerEvent.subscribe( - function(type, args) { - - var context = args[0]; - - var txt = context.getAttribute('tooltip_title'); - this.cfg.setProperty("text", txt); - - - // positioning of tooltip - var tt_w = this.element.clientWidth; - var tt_h = this.element.clientHeight; - - var context_w = context.offsetWidth; - var context_h = context.offsetHeight; - - var pos_x = YAHOO.util.Dom.getX(context); - var pos_y = YAHOO.util.Dom.getY(context); - - var display_strategy = 'top'; - var xy_pos = [0,0]; - switch (display_strategy){ - - case 'top': - var cur_x = (pos_x+context_w/2)-(tt_w/2); - var cur_y = (pos_y-tt_h-4); - xy_pos = [cur_x,cur_y]; - break; - case 'bottom': - var cur_x = (pos_x+context_w/2)-(tt_w/2); - var cur_y = pos_y+context_h+4; - xy_pos = [cur_x,cur_y]; - break; - case 'left': - var cur_x = (pos_x-tt_w-4); - var cur_y = pos_y-((tt_h/2)-context_h/2); - xy_pos = [cur_x,cur_y]; - break; - case 'right': - var cur_x = (pos_x+context_w+4); - var cur_y = pos_y-((tt_h/2)-context_h/2); - xy_pos = [cur_x,cur_y]; - break; - default: - var cur_x = (pos_x+context_w/2)-(tt_w/2); - var cur_y = pos_y-tt_h-4; - xy_pos = [cur_x,cur_y]; - break; - - } - - this.cfg.setProperty("xy",xy_pos); - - }); - - //Mouse out - myToolTips.contextMouseOutEvent.subscribe( - function(type, args) { - var context = args[0]; - - }); }); ''' return literal(js) @@ -231,12 +134,11 @@ def __call__(self, repo_name, rev, paths): if isinstance(paths, str): - paths = paths.decode('utf-8', 'replace') + paths = safe_unicode(paths) url_l = [link_to(repo_name, url('files_home', repo_name=repo_name, revision=rev, f_path=''))] paths_l = paths.split('/') - for cnt, p in enumerate(paths_l): if p != '': url_l.append(link_to(p, url('files_home', @@ -247,7 +149,10 @@ return literal('/'.join(url_l)) files_breadcrumbs = _FilesBreadCrumbs() + class CodeHtmlFormatter(HtmlFormatter): + """My code Html Formatter for source codes + """ def wrap(self, source, outfile): return self._wrap_div(self._wrap_pre(self._wrap_code(source))) @@ -272,15 +177,16 @@ """ color_dict = {} - def gen_color(): - """generator for getting 10k of evenly distibuted colors using hsv color - and golden ratio. + def gen_color(n=10000): + """generator for getting n of evenly distributed colors using + hsv color and golden ratio. It always return same order of colors + + :returns: RGB tuple """ import colorsys - n = 10000 golden_ratio = 0.618033988749895 h = 0.22717784590367374 - #generate 10k nice web friendly colors in the same order + for c in xrange(n): h += golden_ratio h %= 1 @@ -312,27 +218,13 @@ revision=changeset.raw_id), style=get_color_string(changeset.raw_id), class_='tooltip', - tooltip_title=tooltip_html + title=tooltip_html ) uri += '\n' return uri return literal(annotate_highlight(filenode, url_func, **kwargs)) -def repo_name_slug(value): - """Return slug of name of repository - This function is called on each creation/modification - of repository to prevent bad names in repo - """ - slug = remove_formatting(value) - slug = strip_tags(slug) - - for c in """=[]\;'"<>,/~!@#$%^&*()+{}|: """: - slug = slug.replace(c, '-') - slug = recursive_replace(slug, '-') - slug = collapse(slug, '-') - return slug - def get_changeset_safe(repo, rev): from vcs.backends.base import BaseRepository from vcs.exceptions import RepositoryError @@ -357,16 +249,12 @@ from mercurial import util from mercurial.templatefilters import person as _person - - def _age(curdate): """turns a datetime into an age string.""" if not curdate: return '' - from datetime import timedelta, datetime - agescales = [("year", 3600 * 24 * 365), ("month", 3600 * 24 * 30), ("day", 3600 * 24), @@ -394,17 +282,19 @@ def bool2icon(value): - """ - Returns True/False values represented as small html image of true/false + """Returns True/False values represented as small html image of true/false icons + :param value: bool value """ if value is True: - return HTML.tag('img', src=url("/images/icons/accept.png"), alt=_('True')) + return HTML.tag('img', src=url("/images/icons/accept.png"), + alt=_('True')) if value is False: - return HTML.tag('img', src=url("/images/icons/cancel.png"), alt=_('False')) + return HTML.tag('img', src=url("/images/icons/cancel.png"), + alt=_('False')) return value @@ -427,10 +317,9 @@ def get_cs_links(): revs_limit = 5 revs = action_params.split(',') - cs_links = " " + ', '.join ([link(rev, - url('changeset_home', - repo_name=user_log.repository.repo_name, - revision=rev)) for rev in revs[:revs_limit] ]) + cs_links = " " + ', '.join ([link_to(rev, url('changeset_home', + repo_name=user_log.repository.repo_name, + revision=rev)) for rev in revs[:revs_limit]]) if len(revs) > revs_limit: uniq_id = revs[0] html_tmpl = (' %s ' @@ -441,7 +330,7 @@ _('revisions')) html_tmpl = '' - cs_links += html_tmpl % (uniq_id, ', '.join([link(rev, + cs_links += html_tmpl % (uniq_id, ', '.join([link_to(rev, url('changeset_home', repo_name=user_log.repository.repo_name, revision=rev)) for rev in revs[revs_limit:] ])) @@ -495,6 +384,7 @@ 'admin_forked_repo':'arrow_divide.png', 'admin_updated_repo':'database_edit.png', 'push':'script_add.png', + 'push_remote':'connect.png', 'pull':'down_16.png', 'started_following_repo':'heart_add.png', 'stopped_following_repo':'heart_delete.png', @@ -523,35 +413,21 @@ baseurl_ssl = "https://secure.gravatar.com/avatar/" baseurl = baseurl_ssl if ssl_enabled else baseurl_nossl - + if isinstance(email_address, unicode): + #hashlib crashes on unicode items + email_address = email_address.encode('utf8', 'replace') # construct the url gravatar_url = baseurl + hashlib.md5(email_address.lower()).hexdigest() + "?" gravatar_url += urllib.urlencode({'d':default, 's':str(size)}) return gravatar_url -def safe_unicode(str): - """safe unicode function. In case of UnicodeDecode error we try to return - unicode with errors replace, if this failes we return unicode with - string_escape decoding """ - - try: - u_str = unicode(str) - except UnicodeDecodeError: - try: - u_str = unicode(str, 'utf-8', 'replace') - except UnicodeDecodeError: - #incase we have a decode error just represent as byte string - u_str = unicode(str(str).encode('string_escape')) - - return u_str - def changed_tooltip(nodes): if nodes: pref = ':
' suf = '' if len(nodes) > 30: suf = '
' + _(' and %s more') % (len(nodes) - 30) - return literal(pref + '
'.join([x.path.decode('utf-8', 'replace') for x in nodes[:30]]) + suf) + return literal(pref + '
'.join([safe_unicode(x.path) for x in nodes[:30]]) + suf) else: return ': ' + _('No Files') diff -r a3b2b4b4e440 -r 3d9da7893fdb rhodecode/lib/utils.py --- a/rhodecode/lib/utils.py Tue Apr 05 18:04:06 2011 +0200 +++ b/rhodecode/lib/utils.py Tue Apr 05 18:51:34 2011 +0200 @@ -4,10 +4,10 @@ ~~~~~~~~~~~~~~~~~~~ Utilities library for RhodeCode - + :created_on: Apr 18, 2010 :author: marcink - :copyright: (C) 2009-2010 Marcin Kuzminski + :copyright: (C) 2009-2011 Marcin Kuzminski :license: GPLv3, see COPYING for more details. """ # This program is free software: you can redistribute it and/or modify @@ -27,15 +27,17 @@ import logging import datetime import traceback +import paste +import beaker + +from paste.script.command import Command, BadCommand from UserDict import DictMixin from mercurial import ui, config, hg from mercurial.error import RepoError -import paste -import beaker -from paste.script.command import Command, BadCommand +from webhelpers.text import collapse, remove_formatting, strip_tags from vcs.backends.base import BaseChangeset from vcs.utils.lazy import LazyProperty @@ -48,6 +50,38 @@ log = logging.getLogger(__name__) +def recursive_replace(str, replace=' '): + """Recursive replace of given sign to just one instance + + :param str: given string + :param replace: char to find and replace multiple instances + + Examples:: + >>> recursive_replace("Mighty---Mighty-Bo--sstones",'-') + 'Mighty-Mighty-Bo-sstones' + """ + + if str.find(replace * 2) == -1: + return str + else: + str = str.replace(replace * 2, replace) + return recursive_replace(str, replace) + +def repo_name_slug(value): + """Return slug of name of repository + This function is called on each creation/modification + of repository to prevent bad names in repo + """ + + slug = remove_formatting(value) + slug = strip_tags(slug) + + for c in """=[]\;'"<>,/~!@#$%^&*()+{}|: """: + slug = slug.replace(c, '-') + slug = recursive_replace(slug, '-') + slug = collapse(slug, '-') + return slug + def get_repo_slug(request): return request.environ['pylons.routes_dict'].get('repo_name') @@ -233,7 +267,7 @@ def set_rhodecode_config(config): """Updates pylons config with new settings from database - + :param config: """ from rhodecode.model.settings import SettingsModel @@ -243,7 +277,7 @@ config[k] = v def invalidate_cache(cache_key, *args): - """Puts cache invalidation task into db for + """Puts cache invalidation task into db for further global cache invalidation """ @@ -435,6 +469,9 @@ 60)) region_settings.setdefault('lock_dir', cache_settings.get('lock_dir')) + region_settings.setdefault('data_dir', + cache_settings.get('data_dir')) + if 'type' not in region_settings: region_settings['type'] = cache_settings.get('type', 'memory') @@ -485,7 +522,7 @@ pass def create_test_env(repos_test_path, config): - """Makes a fresh database and + """Makes a fresh database and install test repository into tmp dir """ from rhodecode.lib.db_manage import DbManage @@ -519,7 +556,7 @@ dbmanage = DbManage(log_sql=True, dbconf=dbconf, root=config['here'], tests=True) dbmanage.create_tables(override=True) - dbmanage.config_prompt(repos_test_path) + dbmanage.create_settings(dbmanage.config_prompt(repos_test_path)) dbmanage.create_default_user() dbmanage.admin_prompt() dbmanage.create_permissions() @@ -564,12 +601,11 @@ def notify_msg(self, msg, log=False): """Make a notification to user, additionally if logger is passed it logs this action using given logger - + :param msg: message that will be printed to user :param log: logging instance, to use to additionally log this message - + """ - print msg if log and isinstance(log, logging): log(msg) @@ -577,7 +613,7 @@ def run(self, args): """ Overrides Command.run - + Checks for a config file argument and loads it. """ if len(args) < self.min_args: diff -r a3b2b4b4e440 -r 3d9da7893fdb rhodecode/public/js/yui2a.js --- a/rhodecode/public/js/yui2a.js Tue Apr 05 18:04:06 2011 +0200 +++ b/rhodecode/public/js/yui2a.js Tue Apr 05 18:51:34 2011 +0200 @@ -70,7 +70,7 @@ O.addProperty(L.HEIGHT.key,{handler:this.configHeight,suppressEvent:L.HEIGHT.suppressEvent,supercedes:L.HEIGHT.supercedes});O.addProperty(L.AUTO_FILL_HEIGHT.key,{handler:this.configAutoFillHeight,value:L.AUTO_FILL_HEIGHT.value,validator:this._validateAutoFill,supercedes:L.AUTO_FILL_HEIGHT.supercedes});O.addProperty(L.ZINDEX.key,{handler:this.configzIndex,value:L.ZINDEX.value});O.addProperty(L.CONSTRAIN_TO_VIEWPORT.key,{handler:this.configConstrainToViewport,value:L.CONSTRAIN_TO_VIEWPORT.value,validator:L.CONSTRAIN_TO_VIEWPORT.validator,supercedes:L.CONSTRAIN_TO_VIEWPORT.supercedes});O.addProperty(L.IFRAME.key,{handler:this.configIframe,value:L.IFRAME.value,validator:L.IFRAME.validator,supercedes:L.IFRAME.supercedes});O.addProperty(L.PREVENT_CONTEXT_OVERLAP.key,{value:L.PREVENT_CONTEXT_OVERLAP.value,validator:L.PREVENT_CONTEXT_OVERLAP.validator,supercedes:L.PREVENT_CONTEXT_OVERLAP.supercedes});},moveTo:function(O,P){this.cfg.setProperty("xy",[O,P]);},hideMacGeckoScrollbars:function(){F.replaceClass(this.element,"show-scrollbars","hide-scrollbars");},showMacGeckoScrollbars:function(){F.replaceClass(this.element,"hide-scrollbars","show-scrollbars");},_setDomVisibility:function(O){F.setStyle(this.element,"visibility",(O)?"visible":"hidden");var P=B.CSS_HIDDEN;if(O){F.removeClass(this.element,P);}else{F.addClass(this.element,P);}},configVisible:function(R,O,X){var Q=O[0],S=F.getStyle(this.element,"visibility"),Y=this.cfg.getProperty("effect"),V=[],U=(this.platform=="mac"&&K.gecko),g=D.alreadySubscribed,W,P,f,c,b,a,d,Z,T;if(S=="inherit"){f=this.element.parentNode;while(f.nodeType!=9&&f.nodeType!=11){S=F.getStyle(f,"visibility");if(S!="inherit"){break;}f=f.parentNode;}if(S=="inherit"){S="visible";}}if(Y){if(Y instanceof Array){Z=Y.length;for(c=0;c0){S=(S||[]).concat(W);}if(R){if(typeof R=="string"){this.cfg.setProperty("context",[document.getElementById(R),O,V,S,P],true);}if(O&&V){this.align(O,V,P);}if(this._contextTriggers){this._processTriggers(this._contextTriggers,E,this._alignOnTrigger);}if(S){this._processTriggers(S,H,this._alignOnTrigger);this._contextTriggers=S;}}}},_alignOnTrigger:function(P,O){this.align();},_findTriggerCE:function(O){var P=null;if(O instanceof M){P=O;}else{if(B._TRIGGER_MAP[O]){P=B._TRIGGER_MAP[O];}}return P;},_processTriggers:function(S,U,R){var Q,T;for(var P=0,O=S.length;Pa){if(W){Q=this._preventOverlap(X,O[0],Y,S,c);}else{if(U){if(Pa){Q=a;}}}else{Q=V;}}}return Q;},_preventOverlap:function(X,W,Y,U,b){var Z=(X=="x"),T=B.VIEWPORT_OFFSET,S=this,Q=((Z)?F.getX(W):F.getY(W))-b,O=(Z)?W.offsetWidth:W.offsetHeight,P=Q-T,R=(U-(Q+O))-T,c=false,V=function(){var d;if((S.cfg.getProperty(X)-b)>Q){d=(Q-Y);}else{d=(Q+O);}S.cfg.setProperty(X,(d+b),true);return d;},a=function(){var e=((S.cfg.getProperty(X)-b)>Q)?R:P,d;if(Y>e){if(c){V();}else{V();c=true;d=a();}}return d;};a();return this.cfg.getProperty(X);},getConstrainedX:function(O){return this._getConstrainedPos("x",O);},getConstrainedY:function(O){return this._getConstrainedPos("y",O);},getConstrainedXY:function(O,P){return[this.getConstrainedX(O),this.getConstrainedY(P)];},center:function(){var R=B.VIEWPORT_OFFSET,S=this.element.offsetWidth,Q=this.element.offsetHeight,P=F.getViewportWidth(),T=F.getViewportHeight(),O,U;if(SW){return -1;}else{if(X1){var P=F.getStyle(S[1],"zIndex");if(!isNaN(P)&&(U==P)){T=true;}}}if(T){this.cfg.setProperty("zindex",(parseInt(U,10)+2));}}}},destroy:function(){if(this.iframe){this.iframe.parentNode.removeChild(this.iframe);}this.iframe=null;B.windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent,this);B.windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent,this);G.textResizeEvent.unsubscribe(this._autoFillOnHeightChange);if(this._contextTriggers){this._processTriggers(this._contextTriggers,E,this._alignOnTrigger);}B.superclass.destroy.call(this);},forceContainerRedraw:function(){var O=this;F.addClass(O.element,"yui-force-redraw");setTimeout(function(){F.removeClass(O.element,"yui-force-redraw");},0);},toString:function(){return"Overlay "+this.id;}});}());(function(){YAHOO.widget.OverlayManager=function(G){this.init(G);};var D=YAHOO.widget.Overlay,C=YAHOO.util.Event,E=YAHOO.util.Dom,B=YAHOO.util.Config,F=YAHOO.util.CustomEvent,A=YAHOO.widget.OverlayManager;A.CSS_FOCUSED="focused";A.prototype={constructor:A,overlays:null,initDefaultConfig:function(){this.cfg.addProperty("overlays",{suppressEvent:true});this.cfg.addProperty("focusevent",{value:"mousedown"});},init:function(I){this.cfg=new B(this);this.initDefaultConfig();if(I){this.cfg.applyConfig(I,true);}this.cfg.fireQueue();var H=null;this.getActive=function(){return H;};this.focus=function(J){var K=this.find(J);if(K){K.focus();}};this.remove=function(K){var M=this.find(K),J;if(M){if(H==M){H=null;}var L=(M.element===null&&M.cfg===null)?true:false;if(!L){J=E.getStyle(M.element,"zIndex");M.cfg.setProperty("zIndex",-1000,true);}this.overlays.sort(this.compareZIndexDesc);this.overlays=this.overlays.slice(0,(this.overlays.length-1));M.hideEvent.unsubscribe(M.blur);M.destroyEvent.unsubscribe(this._onOverlayDestroy,M);M.focusEvent.unsubscribe(this._onOverlayFocusHandler,M);M.blurEvent.unsubscribe(this._onOverlayBlurHandler,M);if(!L){C.removeListener(M.element,this.cfg.getProperty("focusevent"),this._onOverlayElementFocus);M.cfg.setProperty("zIndex",J,true);M.cfg.setProperty("manager",null);}if(M.focusEvent._managed){M.focusEvent=null;}if(M.blurEvent._managed){M.blurEvent=null;}if(M.focus._managed){M.focus=null;}if(M.blur._managed){M.blur=null;}}};this.blurAll=function(){var K=this.overlays.length,J;if(K>0){J=K-1;do{this.overlays[J].blur();}while(J--);}};this._manageBlur=function(J){var K=false;if(H==J){E.removeClass(H.element,A.CSS_FOCUSED);H=null;K=true;}return K;};this._manageFocus=function(J){var K=false;if(H!=J){if(H){H.blur();}H=J;this.bringToTop(H);E.addClass(H.element,A.CSS_FOCUSED);K=true;}return K;};var G=this.cfg.getProperty("overlays");if(!this.overlays){this.overlays=[];}if(G){this.register(G);this.overlays.sort(this.compareZIndexDesc);}},_onOverlayElementFocus:function(I){var G=C.getTarget(I),H=this.close;if(H&&(G==H||E.isAncestor(H,G))){this.blur();}else{this.focus();}},_onOverlayDestroy:function(H,G,I){this.remove(I);},_onOverlayFocusHandler:function(H,G,I){this._manageFocus(I);},_onOverlayBlurHandler:function(H,G,I){this._manageBlur(I);},_bindFocus:function(G){var H=this;if(!G.focusEvent){G.focusEvent=G.createEvent("focus");G.focusEvent.signature=F.LIST;G.focusEvent._managed=true;}else{G.focusEvent.subscribe(H._onOverlayFocusHandler,G,H);}if(!G.focus){C.on(G.element,H.cfg.getProperty("focusevent"),H._onOverlayElementFocus,null,G);G.focus=function(){if(H._manageFocus(this)){if(this.cfg.getProperty("visible")&&this.focusFirst){this.focusFirst();}this.focusEvent.fire();}};G.focus._managed=true;}},_bindBlur:function(G){var H=this;if(!G.blurEvent){G.blurEvent=G.createEvent("blur");G.blurEvent.signature=F.LIST;G.focusEvent._managed=true;}else{G.blurEvent.subscribe(H._onOverlayBlurHandler,G,H);}if(!G.blur){G.blur=function(){if(H._manageBlur(this)){this.blurEvent.fire();}};G.blur._managed=true;}G.hideEvent.subscribe(G.blur);},_bindDestroy:function(G){var H=this;G.destroyEvent.subscribe(H._onOverlayDestroy,G,H);},_syncZIndex:function(G){var H=E.getStyle(G.element,"zIndex");if(!isNaN(H)){G.cfg.setProperty("zIndex",parseInt(H,10));}else{G.cfg.setProperty("zIndex",0);}},register:function(G){var J=false,H,I;if(G instanceof D){G.cfg.addProperty("manager",{value:this});this._bindFocus(G);this._bindBlur(G);this._bindDestroy(G); -this._syncZIndex(G);this.overlays.push(G);this.bringToTop(G);J=true;}else{if(G instanceof Array){for(H=0,I=G.length;H1){var H=E.getStyle(J[1].element,"zIndex");if(!isNaN(H)&&(L==H)){K=true;}}}if(K){I.cfg.setProperty("zindex",(parseInt(L,10)+2));}}J.sort(this.compareZIndexDesc);}}},find:function(G){var K=G instanceof D,I=this.overlays,M=I.length,J=null,L,H;if(K||typeof G=="string"){for(H=M-1;H>=0;H--){L=I[H];if((K&&(L===G))||(L.id==G)){J=L;break;}}}return J;},compareZIndexDesc:function(J,I){var H=(J.cfg)?J.cfg.getProperty("zIndex"):null,G=(I.cfg)?I.cfg.getProperty("zIndex"):null;if(H===null&&G===null){return 0;}else{if(H===null){return 1;}else{if(G===null){return -1;}else{if(H>G){return -1;}else{if(H=0;G--){H[G].show();}},hideAll:function(){var H=this.overlays,I=H.length,G;for(G=I-1;G>=0;G--){H[G].hide();}},toString:function(){return"OverlayManager";}};}());(function(){YAHOO.widget.Tooltip=function(P,O){YAHOO.widget.Tooltip.superclass.constructor.call(this,P,O);};var E=YAHOO.lang,N=YAHOO.util.Event,M=YAHOO.util.CustomEvent,C=YAHOO.util.Dom,J=YAHOO.widget.Tooltip,H=YAHOO.env.ua,G=(H.ie&&(H.ie<=6||document.compatMode=="BackCompat")),F,I={"PREVENT_OVERLAP":{key:"preventoverlap",value:true,validator:E.isBoolean,supercedes:["x","y","xy"]},"SHOW_DELAY":{key:"showdelay",value:200,validator:E.isNumber},"AUTO_DISMISS_DELAY":{key:"autodismissdelay",value:5000,validator:E.isNumber},"HIDE_DELAY":{key:"hidedelay",value:250,validator:E.isNumber},"TEXT":{key:"text",suppressEvent:true},"CONTAINER":{key:"container"},"DISABLED":{key:"disabled",value:false,suppressEvent:true},"XY_OFFSET":{key:"xyoffset",value:[0,25],suppressEvent:true}},A={"CONTEXT_MOUSE_OVER":"contextMouseOver","CONTEXT_MOUSE_OUT":"contextMouseOut","CONTEXT_TRIGGER":"contextTrigger"};J.CSS_TOOLTIP="yui-tt";function K(Q,O){var P=this.cfg,R=P.getProperty("width");if(R==O){P.setProperty("width",Q);}}function D(P,O){if("_originalWidth" in this){K.call(this,this._originalWidth,this._forcedWidth);}var Q=document.body,U=this.cfg,T=U.getProperty("width"),R,S;if((!T||T=="auto")&&(U.getProperty("container")!=Q||U.getProperty("x")>=C.getViewportWidth()||U.getProperty("y")>=C.getViewportHeight())){S=this.element.cloneNode(true);S.style.visibility="hidden";S.style.top="0px";S.style.left="0px";Q.appendChild(S);R=(S.offsetWidth+"px");Q.removeChild(S);S=null;U.setProperty("width",R);U.refireEvent("xy");this._originalWidth=T||"";this._forcedWidth=R;}}function B(P,O,Q){this.render(Q);}function L(){N.onDOMReady(B,this.cfg.getProperty("container"),this);}YAHOO.extend(J,YAHOO.widget.Overlay,{init:function(P,O){J.superclass.init.call(this,P);this.beforeInitEvent.fire(J);C.addClass(this.element,J.CSS_TOOLTIP);if(O){this.cfg.applyConfig(O,true);}this.cfg.queueProperty("visible",false);this.cfg.queueProperty("constraintoviewport",true);this.setBody("");this.subscribe("changeContent",D);this.subscribe("init",L);this.subscribe("render",this.onRender);this.initEvent.fire(J);},initEvents:function(){J.superclass.initEvents.call(this);var O=M.LIST;this.contextMouseOverEvent=this.createEvent(A.CONTEXT_MOUSE_OVER);this.contextMouseOverEvent.signature=O;this.contextMouseOutEvent=this.createEvent(A.CONTEXT_MOUSE_OUT);this.contextMouseOutEvent.signature=O;this.contextTriggerEvent=this.createEvent(A.CONTEXT_TRIGGER);this.contextTriggerEvent.signature=O;},initDefaultConfig:function(){J.superclass.initDefaultConfig.call(this);this.cfg.addProperty(I.PREVENT_OVERLAP.key,{value:I.PREVENT_OVERLAP.value,validator:I.PREVENT_OVERLAP.validator,supercedes:I.PREVENT_OVERLAP.supercedes});this.cfg.addProperty(I.SHOW_DELAY.key,{handler:this.configShowDelay,value:200,validator:I.SHOW_DELAY.validator});this.cfg.addProperty(I.AUTO_DISMISS_DELAY.key,{handler:this.configAutoDismissDelay,value:I.AUTO_DISMISS_DELAY.value,validator:I.AUTO_DISMISS_DELAY.validator});this.cfg.addProperty(I.HIDE_DELAY.key,{handler:this.configHideDelay,value:I.HIDE_DELAY.value,validator:I.HIDE_DELAY.validator});this.cfg.addProperty(I.TEXT.key,{handler:this.configText,suppressEvent:I.TEXT.suppressEvent});this.cfg.addProperty(I.CONTAINER.key,{handler:this.configContainer,value:document.body});this.cfg.addProperty(I.DISABLED.key,{handler:this.configContainer,value:I.DISABLED.value,supressEvent:I.DISABLED.suppressEvent});this.cfg.addProperty(I.XY_OFFSET.key,{value:I.XY_OFFSET.value.concat(),supressEvent:I.XY_OFFSET.suppressEvent});},configText:function(P,O,Q){var R=O[0];if(R){this.setBody(R);}},configContainer:function(Q,P,R){var O=P[0];if(typeof O=="string"){this.cfg.setProperty("container",document.getElementById(O),true);}},_removeEventListeners:function(){var R=this._context,O,Q,P;if(R){O=R.length;if(O>0){P=O-1;do{Q=R[P];N.removeListener(Q,"mouseover",this.onContextMouseOver);N.removeListener(Q,"mousemove",this.onContextMouseMove);N.removeListener(Q,"mouseout",this.onContextMouseOut);}while(P--);}}},configContext:function(T,P,U){var S=P[0],V,O,R,Q;if(S){if(!(S instanceof Array)){if(typeof S=="string"){this.cfg.setProperty("context",[document.getElementById(S)],true);}else{this.cfg.setProperty("context",[S],true);}S=this.cfg.getProperty("context");}this._removeEventListeners();this._context=S;V=this._context;if(V){O=V.length;if(O>0){Q=O-1;do{R=V[Q];N.on(R,"mouseover",this.onContextMouseOver,this);N.on(R,"mousemove",this.onContextMouseMove,this);N.on(R,"mouseout",this.onContextMouseOut,this);}while(Q--);}}}},onContextMouseMove:function(P,O){O.pageX=N.getPageX(P);O.pageY=N.getPageY(P);},onContextMouseOver:function(Q,P){var O=this;if(O.title){P._tempTitle=O.title;O.title="";}if(P.fireEvent("contextMouseOver",O,Q)!==false&&!P.cfg.getProperty("disabled")){if(P.hideProcId){clearTimeout(P.hideProcId); +this._syncZIndex(G);this.overlays.push(G);this.bringToTop(G);J=true;}else{if(G instanceof Array){for(H=0,I=G.length;H1){var H=E.getStyle(J[1].element,"zIndex");if(!isNaN(H)&&(L==H)){K=true;}}}if(K){I.cfg.setProperty("zindex",(parseInt(L,10)+2));}}J.sort(this.compareZIndexDesc);}}},find:function(G){var K=G instanceof D,I=this.overlays,M=I.length,J=null,L,H;if(K||typeof G=="string"){for(H=M-1;H>=0;H--){L=I[H];if((K&&(L===G))||(L.id==G)){J=L;break;}}}return J;},compareZIndexDesc:function(J,I){var H=(J.cfg)?J.cfg.getProperty("zIndex"):null,G=(I.cfg)?I.cfg.getProperty("zIndex"):null;if(H===null&&G===null){return 0;}else{if(H===null){return 1;}else{if(G===null){return -1;}else{if(H>G){return -1;}else{if(H=0;G--){H[G].show();}},hideAll:function(){var H=this.overlays,I=H.length,G;for(G=I-1;G>=0;G--){H[G].hide();}},toString:function(){return"OverlayManager";}};}());(function(){YAHOO.widget.title=function(P,O){YAHOO.widget.Tooltip.superclass.constructor.call(this,P,O);};var E=YAHOO.lang,N=YAHOO.util.Event,M=YAHOO.util.CustomEvent,C=YAHOO.util.Dom,J=YAHOO.widget.Tooltip,H=YAHOO.env.ua,G=(H.ie&&(H.ie<=6||document.compatMode=="BackCompat")),F,I={"PREVENT_OVERLAP":{key:"preventoverlap",value:true,validator:E.isBoolean,supercedes:["x","y","xy"]},"SHOW_DELAY":{key:"showdelay",value:200,validator:E.isNumber},"AUTO_DISMISS_DELAY":{key:"autodismissdelay",value:5000,validator:E.isNumber},"HIDE_DELAY":{key:"hidedelay",value:250,validator:E.isNumber},"TEXT":{key:"text",suppressEvent:true},"CONTAINER":{key:"container"},"DISABLED":{key:"disabled",value:false,suppressEvent:true},"XY_OFFSET":{key:"xyoffset",value:[0,25],suppressEvent:true}},A={"CONTEXT_MOUSE_OVER":"contextMouseOver","CONTEXT_MOUSE_OUT":"contextMouseOut","CONTEXT_TRIGGER":"contextTrigger"};J.CSS_title="yui-tt";function K(Q,O){var P=this.cfg,R=P.getProperty("width");if(R==O){P.setProperty("width",Q);}}function D(P,O){if("_originalWidth" in this){K.call(this,this._originalWidth,this._forcedWidth);}var Q=document.body,U=this.cfg,T=U.getProperty("width"),R,S;if((!T||T=="auto")&&(U.getProperty("container")!=Q||U.getProperty("x")>=C.getViewportWidth()||U.getProperty("y")>=C.getViewportHeight())){S=this.element.cloneNode(true);S.style.visibility="hidden";S.style.top="0px";S.style.left="0px";Q.appendChild(S);R=(S.offsetWidth+"px");Q.removeChild(S);S=null;U.setProperty("width",R);U.refireEvent("xy");this._originalWidth=T||"";this._forcedWidth=R;}}function B(P,O,Q){this.render(Q);}function L(){N.onDOMReady(B,this.cfg.getProperty("container"),this);}YAHOO.extend(J,YAHOO.widget.Overlay,{init:function(P,O){J.superclass.init.call(this,P);this.beforeInitEvent.fire(J);C.addClass(this.element,J.CSS_TOOLTIP);if(O){this.cfg.applyConfig(O,true);}this.cfg.queueProperty("visible",false);this.cfg.queueProperty("constraintoviewport",true);this.setBody("");this.subscribe("changeContent",D);this.subscribe("init",L);this.subscribe("render",this.onRender);this.initEvent.fire(J);},initEvents:function(){J.superclass.initEvents.call(this);var O=M.LIST;this.contextMouseOverEvent=this.createEvent(A.CONTEXT_MOUSE_OVER);this.contextMouseOverEvent.signature=O;this.contextMouseOutEvent=this.createEvent(A.CONTEXT_MOUSE_OUT);this.contextMouseOutEvent.signature=O;this.contextTriggerEvent=this.createEvent(A.CONTEXT_TRIGGER);this.contextTriggerEvent.signature=O;},initDefaultConfig:function(){J.superclass.initDefaultConfig.call(this);this.cfg.addProperty(I.PREVENT_OVERLAP.key,{value:I.PREVENT_OVERLAP.value,validator:I.PREVENT_OVERLAP.validator,supercedes:I.PREVENT_OVERLAP.supercedes});this.cfg.addProperty(I.SHOW_DELAY.key,{handler:this.configShowDelay,value:200,validator:I.SHOW_DELAY.validator});this.cfg.addProperty(I.AUTO_DISMISS_DELAY.key,{handler:this.configAutoDismissDelay,value:I.AUTO_DISMISS_DELAY.value,validator:I.AUTO_DISMISS_DELAY.validator});this.cfg.addProperty(I.HIDE_DELAY.key,{handler:this.configHideDelay,value:I.HIDE_DELAY.value,validator:I.HIDE_DELAY.validator});this.cfg.addProperty(I.TEXT.key,{handler:this.configText,suppressEvent:I.TEXT.suppressEvent});this.cfg.addProperty(I.CONTAINER.key,{handler:this.configContainer,value:document.body});this.cfg.addProperty(I.DISABLED.key,{handler:this.configContainer,value:I.DISABLED.value,supressEvent:I.DISABLED.suppressEvent});this.cfg.addProperty(I.XY_OFFSET.key,{value:I.XY_OFFSET.value.concat(),supressEvent:I.XY_OFFSET.suppressEvent});},configText:function(P,O,Q){var R=O[0];if(R){this.setBody(R);}},configContainer:function(Q,P,R){var O=P[0];if(typeof O=="string"){this.cfg.setProperty("container",document.getElementById(O),true);}},_removeEventListeners:function(){var R=this._context,O,Q,P;if(R){O=R.length;if(O>0){P=O-1;do{Q=R[P];N.removeListener(Q,"mouseover",this.onContextMouseOver);N.removeListener(Q,"mousemove",this.onContextMouseMove);N.removeListener(Q,"mouseout",this.onContextMouseOut);}while(P--);}}},configContext:function(T,P,U){var S=P[0],V,O,R,Q;if(S){if(!(S instanceof Array)){if(typeof S=="string"){this.cfg.setProperty("context",[document.getElementById(S)],true);}else{this.cfg.setProperty("context",[S],true);}S=this.cfg.getProperty("context");}this._removeEventListeners();this._context=S;V=this._context;if(V){O=V.length;if(O>0){Q=O-1;do{R=V[Q];N.on(R,"mouseover",this.onContextMouseOver,this);N.on(R,"mousemove",this.onContextMouseMove,this);N.on(R,"mouseout",this.onContextMouseOut,this);}while(Q--);}}}},onContextMouseMove:function(P,O){O.pageX=N.getPageX(P);O.pageY=N.getPageY(P);},onContextMouseOver:function(Q,P){var O=this;if(O.title){P._tempTitle=O.title;O.title="";}if(P.fireEvent("contextMouseOver",O,Q)!==false&&!P.cfg.getProperty("disabled")){if(P.hideProcId){clearTimeout(P.hideProcId); P.hideProcId=null;}N.on(O,"mousemove",P.onContextMouseMove,P);P.showProcId=P.doShow(Q,O);}},onContextMouseOut:function(Q,P){var O=this;if(P._tempTitle){O.title=P._tempTitle;P._tempTitle=null;}if(P.showProcId){clearTimeout(P.showProcId);P.showProcId=null;}if(P.hideProcId){clearTimeout(P.hideProcId);P.hideProcId=null;}P.fireEvent("contextMouseOut",O,Q);P.hideProcId=setTimeout(function(){P.hide();},P.cfg.getProperty("hidedelay"));},doShow:function(R,O){var T=this.cfg.getProperty("xyoffset"),P=T[0],S=T[1],Q=this;if(H.opera&&O.tagName&&O.tagName.toUpperCase()=="A"){S+=12;}return setTimeout(function(){var U=Q.cfg.getProperty("text");if(Q._tempTitle&&(U===""||YAHOO.lang.isUndefined(U)||YAHOO.lang.isNull(U))){Q.setBody(Q._tempTitle);}else{Q.cfg.refireEvent("text");}Q.moveTo(Q.pageX+P,Q.pageY+S);if(Q.cfg.getProperty("preventoverlap")){Q.preventOverlap(Q.pageX,Q.pageY);}N.removeListener(O,"mousemove",Q.onContextMouseMove);Q.contextTriggerEvent.fire(O);Q.show();Q.hideProcId=Q.doHide();},this.cfg.getProperty("showdelay"));},doHide:function(){var O=this;return setTimeout(function(){O.hide();},this.cfg.getProperty("autodismissdelay"));},preventOverlap:function(S,R){var O=this.element.offsetHeight,Q=new YAHOO.util.Point(S,R),P=C.getRegion(this.element);P.top-=5;P.left-=5;P.right+=5;P.bottom+=5;if(P.contains(Q)){this.cfg.setProperty("y",(R-O-5));}},onRender:function(S,R){function T(){var W=this.element,V=this.underlay;if(V){V.style.width=(W.offsetWidth+6)+"px";V.style.height=(W.offsetHeight+1)+"px";}}function P(){C.addClass(this.underlay,"yui-tt-shadow-visible");if(H.ie){this.forceUnderlayRedraw();}}function O(){C.removeClass(this.underlay,"yui-tt-shadow-visible");}function U(){var X=this.underlay,W,V,Z,Y;if(!X){W=this.element;V=YAHOO.widget.Module;Z=H.ie;Y=this;if(!F){F=document.createElement("div");F.className="yui-tt-shadow";}X=F.cloneNode(false);W.appendChild(X);this.underlay=X;this._shadow=this.underlay;P.call(this);this.subscribe("beforeShow",P);this.subscribe("hide",O);if(G){window.setTimeout(function(){T.call(Y);},0);this.cfg.subscribeToConfigEvent("width",T);this.cfg.subscribeToConfigEvent("height",T);this.subscribe("changeContent",T);V.textResizeEvent.subscribe(T,this,true);this.subscribe("destroy",function(){V.textResizeEvent.unsubscribe(T,this);});}}}function Q(){U.call(this);this.unsubscribe("beforeShow",Q);}if(this.cfg.getProperty("visible")){U.call(this);}else{this.subscribe("beforeShow",Q);}},forceUnderlayRedraw:function(){var O=this;C.addClass(O.underlay,"yui-force-redraw");setTimeout(function(){C.removeClass(O.underlay,"yui-force-redraw");},0);},destroy:function(){this._removeEventListeners();J.superclass.destroy.call(this);},toString:function(){return"Tooltip "+this.id;}});}());(function(){YAHOO.widget.Panel=function(V,U){YAHOO.widget.Panel.superclass.constructor.call(this,V,U);};var S=null;var E=YAHOO.lang,F=YAHOO.util,A=F.Dom,T=F.Event,M=F.CustomEvent,K=YAHOO.util.KeyListener,I=F.Config,H=YAHOO.widget.Overlay,O=YAHOO.widget.Panel,L=YAHOO.env.ua,P=(L.ie&&(L.ie<=6||document.compatMode=="BackCompat")),G,Q,C,D={"SHOW_MASK":"showMask","HIDE_MASK":"hideMask","DRAG":"drag"},N={"CLOSE":{key:"close",value:true,validator:E.isBoolean,supercedes:["visible"]},"DRAGGABLE":{key:"draggable",value:(F.DD?true:false),validator:E.isBoolean,supercedes:["visible"]},"DRAG_ONLY":{key:"dragonly",value:false,validator:E.isBoolean,supercedes:["draggable"]},"UNDERLAY":{key:"underlay",value:"shadow",supercedes:["visible"]},"MODAL":{key:"modal",value:false,validator:E.isBoolean,supercedes:["visible","zindex"]},"KEY_LISTENERS":{key:"keylisteners",suppressEvent:true,supercedes:["visible"]},"STRINGS":{key:"strings",supercedes:["close"],validator:E.isObject,value:{close:"Close"}}};O.CSS_PANEL="yui-panel";O.CSS_PANEL_CONTAINER="yui-panel-container";O.FOCUSABLE=["a","button","select","textarea","input","iframe"];function J(V,U){if(!this.header&&this.cfg.getProperty("draggable")){this.setHeader(" ");}}function R(V,U,W){var Z=W[0],X=W[1],Y=this.cfg,a=Y.getProperty("width");if(a==X){Y.setProperty("width",Z);}this.unsubscribe("hide",R,W);}function B(V,U){var Y,X,W;if(P){Y=this.cfg;X=Y.getProperty("width");if(!X||X=="auto"){W=(this.element.offsetWidth+"px");Y.setProperty("width",W);this.subscribe("hide",R,[(X||""),W]);}}}YAHOO.extend(O,H,{init:function(V,U){O.superclass.init.call(this,V);this.beforeInitEvent.fire(O);A.addClass(this.element,O.CSS_PANEL);this.buildWrapper();if(U){this.cfg.applyConfig(U,true);}this.subscribe("showMask",this._addFocusHandlers);this.subscribe("hideMask",this._removeFocusHandlers);this.subscribe("beforeRender",J);this.subscribe("render",function(){this.setFirstLastFocusable();this.subscribe("changeContent",this.setFirstLastFocusable);});this.subscribe("show",this.focusFirst);this.initEvent.fire(O);},_onElementFocus:function(Z){if(S===this){var Y=T.getTarget(Z),X=document.documentElement,V=(Y!==X&&Y!==window);if(V&&Y!==this.element&&Y!==this.mask&&!A.isAncestor(this.element,Y)){try{if(this.firstElement){this.firstElement.focus();}else{if(this._modalFocus){this._modalFocus.focus();}else{this.innerElement.focus();}}}catch(W){try{if(V&&Y!==document.body){Y.blur();}}catch(U){}}}}},_addFocusHandlers:function(V,U){if(!this.firstElement){if(L.webkit||L.opera){if(!this._modalFocus){this._createHiddenFocusElement();}}else{this.innerElement.tabIndex=0;}}this.setTabLoop(this.firstElement,this.lastElement);T.onFocus(document.documentElement,this._onElementFocus,this,true);S=this;},_createHiddenFocusElement:function(){var U=document.createElement("button");U.style.height="1px";U.style.width="1px";U.style.position="absolute";U.style.left="-10000em";U.style.opacity=0;U.tabIndex=-1;this.innerElement.appendChild(U);this._modalFocus=U;},_removeFocusHandlers:function(V,U){T.removeFocusListener(document.documentElement,this._onElementFocus,this);if(S==this){S=null;}},focusFirst:function(W,U,Y){var V=this.firstElement;if(U&&U[1]){T.stopEvent(U[1]);}if(V){try{V.focus();}catch(X){}}},focusLast:function(W,U,Y){var V=this.lastElement; if(U&&U[1]){T.stopEvent(U[1]);}if(V){try{V.focus();}catch(X){}}},setTabLoop:function(X,Z){var V=this.preventBackTab,W=this.preventTabOut,U=this.showEvent,Y=this.hideEvent;if(V){V.disable();U.unsubscribe(V.enable,V);Y.unsubscribe(V.disable,V);V=this.preventBackTab=null;}if(W){W.disable();U.unsubscribe(W.enable,W);Y.unsubscribe(W.disable,W);W=this.preventTabOut=null;}if(X){this.preventBackTab=new K(X,{shift:true,keys:9},{fn:this.focusLast,scope:this,correctScope:true});V=this.preventBackTab;U.subscribe(V.enable,V,true);Y.subscribe(V.disable,V,true);}if(Z){this.preventTabOut=new K(Z,{shift:false,keys:9},{fn:this.focusFirst,scope:this,correctScope:true});W=this.preventTabOut;U.subscribe(W.enable,W,true);Y.subscribe(W.disable,W,true);}},getFocusableElements:function(U){U=U||this.innerElement;var X={};for(var W=0;W0){this.firstElement=U[0];this.lastElement=U[U.length-1];}if(this.cfg.getProperty("modal")){this.setTabLoop(this.firstElement,this.lastElement);}},initEvents:function(){O.superclass.initEvents.call(this);var U=M.LIST;this.showMaskEvent=this.createEvent(D.SHOW_MASK);this.showMaskEvent.signature=U;this.hideMaskEvent=this.createEvent(D.HIDE_MASK);this.hideMaskEvent.signature=U;this.dragEvent=this.createEvent(D.DRAG);this.dragEvent.signature=U;},initDefaultConfig:function(){O.superclass.initDefaultConfig.call(this);this.cfg.addProperty(N.CLOSE.key,{handler:this.configClose,value:N.CLOSE.value,validator:N.CLOSE.validator,supercedes:N.CLOSE.supercedes});this.cfg.addProperty(N.DRAGGABLE.key,{handler:this.configDraggable,value:(F.DD)?true:false,validator:N.DRAGGABLE.validator,supercedes:N.DRAGGABLE.supercedes});this.cfg.addProperty(N.DRAG_ONLY.key,{value:N.DRAG_ONLY.value,validator:N.DRAG_ONLY.validator,supercedes:N.DRAG_ONLY.supercedes});this.cfg.addProperty(N.UNDERLAY.key,{handler:this.configUnderlay,value:N.UNDERLAY.value,supercedes:N.UNDERLAY.supercedes});this.cfg.addProperty(N.MODAL.key,{handler:this.configModal,value:N.MODAL.value,validator:N.MODAL.validator,supercedes:N.MODAL.supercedes});this.cfg.addProperty(N.KEY_LISTENERS.key,{handler:this.configKeyListeners,suppressEvent:N.KEY_LISTENERS.suppressEvent,supercedes:N.KEY_LISTENERS.supercedes});this.cfg.addProperty(N.STRINGS.key,{value:N.STRINGS.value,handler:this.configStrings,validator:N.STRINGS.validator,supercedes:N.STRINGS.supercedes});},configClose:function(X,V,Y){var Z=V[0],W=this.close,U=this.cfg.getProperty("strings");if(Z){if(!W){if(!C){C=document.createElement("a");C.className="container-close";C.href="#";}W=C.cloneNode(true);this.innerElement.appendChild(W);W.innerHTML=(U&&U.close)?U.close:" ";T.on(W,"click",this._doClose,this,true);this.close=W;}else{W.style.display="block";}}else{if(W){W.style.display="none";}}},_doClose:function(U){T.preventDefault(U);this.hide();},configDraggable:function(V,U,W){var X=U[0];if(X){if(!F.DD){this.cfg.setProperty("draggable",false);return;}if(this.header){A.setStyle(this.header,"cursor","move");this.registerDragDrop();}this.subscribe("beforeShow",B);}else{if(this.dd){this.dd.unreg();}if(this.header){A.setStyle(this.header,"cursor","auto");}this.unsubscribe("beforeShow",B);}},configUnderlay:function(d,c,Z){var b=(this.platform=="mac"&&L.gecko),e=c[0].toLowerCase(),V=this.underlay,W=this.element;function X(){var f=false;if(!V){if(!Q){Q=document.createElement("div");Q.className="underlay";}V=Q.cloneNode(false);this.element.appendChild(V);this.underlay=V;if(P){this.sizeUnderlay();this.cfg.subscribeToConfigEvent("width",this.sizeUnderlay);this.cfg.subscribeToConfigEvent("height",this.sizeUnderlay);this.changeContentEvent.subscribe(this.sizeUnderlay);YAHOO.widget.Module.textResizeEvent.subscribe(this.sizeUnderlay,this,true);}if(L.webkit&&L.webkit<420){this.changeContentEvent.subscribe(this.forceUnderlayRedraw);}f=true;}}function a(){var f=X.call(this);if(!f&&P){this.sizeUnderlay();}this._underlayDeferred=false;this.beforeShowEvent.unsubscribe(a);}function Y(){if(this._underlayDeferred){this.beforeShowEvent.unsubscribe(a);this._underlayDeferred=false;}if(V){this.cfg.unsubscribeFromConfigEvent("width",this.sizeUnderlay);this.cfg.unsubscribeFromConfigEvent("height",this.sizeUnderlay);this.changeContentEvent.unsubscribe(this.sizeUnderlay);this.changeContentEvent.unsubscribe(this.forceUnderlayRedraw);YAHOO.widget.Module.textResizeEvent.unsubscribe(this.sizeUnderlay,this,true);this.element.removeChild(V);this.underlay=null;}}switch(e){case"shadow":A.removeClass(W,"matte");A.addClass(W,"shadow");break;case"matte":if(!b){Y.call(this);}A.removeClass(W,"shadow");A.addClass(W,"matte");break;default:if(!b){Y.call(this);}A.removeClass(W,"shadow");A.removeClass(W,"matte");break;}if((e=="shadow")||(b&&!V)){if(this.cfg.getProperty("visible")){var U=X.call(this);if(!U&&P){this.sizeUnderlay();}}else{if(!this._underlayDeferred){this.beforeShowEvent.subscribe(a);this._underlayDeferred=true;}}}},configModal:function(V,U,X){var W=U[0];if(W){if(!this._hasModalityEventListeners){this.subscribe("beforeShow",this.buildMask);this.subscribe("beforeShow",this.bringToTop);this.subscribe("beforeShow",this.showMask);this.subscribe("hide",this.hideMask);H.windowResizeEvent.subscribe(this.sizeMask,this,true);this._hasModalityEventListeners=true;}}else{if(this._hasModalityEventListeners){if(this.cfg.getProperty("visible")){this.hideMask();this.removeMask();}this.unsubscribe("beforeShow",this.buildMask);this.unsubscribe("beforeShow",this.bringToTop);this.unsubscribe("beforeShow",this.showMask);this.unsubscribe("hide",this.hideMask);H.windowResizeEvent.unsubscribe(this.sizeMask,this);this._hasModalityEventListeners=false;}}},removeMask:function(){var V=this.mask,U;if(V){this.hideMask();U=V.parentNode; if(U){U.removeChild(V);}this.mask=null;}},configKeyListeners:function(X,U,a){var W=U[0],Z,Y,V;if(W){if(W instanceof Array){Y=W.length;for(V=0;VU){V.style.height=U+"px";}if(V.offsetWidth>W){V.style.width=W+"px";}V.style.height=A.getDocumentHeight()+"px";V.style.width=A.getDocumentWidth()+"px";}},stackMask:function(){if(this.mask){var U=A.getStyle(this.element,"zIndex");if(!YAHOO.lang.isUndefined(U)&&!isNaN(U)){A.setStyle(this.mask,"zIndex",U-1);}}},render:function(U){return O.superclass.render.call(this,U,this.innerElement);},_renderHeader:function(U){U=U||this.innerElement;O.superclass._renderHeader.call(this,U);},_renderBody:function(U){U=U||this.innerElement;O.superclass._renderBody.call(this,U);},_renderFooter:function(U){U=U||this.innerElement;O.superclass._renderFooter.call(this,U);},destroy:function(){H.windowResizeEvent.unsubscribe(this.sizeMask,this);this.removeMask();if(this.close){T.purgeElement(this.close);}O.superclass.destroy.call(this);},forceUnderlayRedraw:function(){var U=this.underlay;A.addClass(U,"yui-force-redraw");setTimeout(function(){A.removeClass(U,"yui-force-redraw");},0);},toString:function(){return"Panel "+this.id;}});}());(function(){YAHOO.widget.Dialog=function(J,I){YAHOO.widget.Dialog.superclass.constructor.call(this,J,I);};var B=YAHOO.util.Event,G=YAHOO.util.CustomEvent,E=YAHOO.util.Dom,A=YAHOO.widget.Dialog,F=YAHOO.lang,H={"BEFORE_SUBMIT":"beforeSubmit","SUBMIT":"submit","MANUAL_SUBMIT":"manualSubmit","ASYNC_SUBMIT":"asyncSubmit","FORM_SUBMIT":"formSubmit","CANCEL":"cancel"},C={"POST_METHOD":{key:"postmethod",value:"async"},"POST_DATA":{key:"postdata",value:null},"BUTTONS":{key:"buttons",value:"none",supercedes:["visible"]},"HIDEAFTERSUBMIT":{key:"hideaftersubmit",value:true}};A.CSS_DIALOG="yui-dialog";function D(){var L=this._aButtons,J,K,I;if(F.isArray(L)){J=L.length;if(J>0){I=J-1;do{K=L[I];if(YAHOO.widget.Button&&K instanceof YAHOO.widget.Button){K.destroy();}else{if(K.tagName.toUpperCase()=="BUTTON"){B.purgeElement(K);B.purgeElement(K,false);}}}while(I--);}}}YAHOO.extend(A,YAHOO.widget.Panel,{form:null,initDefaultConfig:function(){A.superclass.initDefaultConfig.call(this);this.callback={success:null,failure:null,argument:null}; diff -r a3b2b4b4e440 -r 3d9da7893fdb rhodecode/templates/admin/permissions/permissions.html --- a/rhodecode/templates/admin/permissions/permissions.html Tue Apr 05 18:04:06 2011 +0200 +++ b/rhodecode/templates/admin/permissions/permissions.html Tue Apr 05 18:51:34 2011 +0200 @@ -46,7 +46,7 @@ ${h.checkbox('overwrite_default','true')} diff -r a3b2b4b4e440 -r 3d9da7893fdb rhodecode/templates/admin/repos/repos.html --- a/rhodecode/templates/admin/repos/repos.html Tue Apr 05 18:04:06 2011 +0200 +++ b/rhodecode/templates/admin/repos/repos.html Tue Apr 05 18:51:34 2011 +0200 @@ -68,7 +68,7 @@ ${h.link_to('r%s:%s' % (repo['rev'],h.short_id(repo['tip'])), h.url('changeset_home',repo_name=repo['name'],revision=repo['tip']), class_="tooltip", - tooltip_title=h.tooltip(repo['last_msg']))} + title=h.tooltip(repo['last_msg']))} %else: ${_('No changesets yet')} %endif diff -r a3b2b4b4e440 -r 3d9da7893fdb rhodecode/templates/admin/settings/settings.html --- a/rhodecode/templates/admin/settings/settings.html Tue Apr 05 18:04:06 2011 +0200 +++ b/rhodecode/templates/admin/settings/settings.html Tue Apr 05 18:51:34 2011 +0200 @@ -35,7 +35,7 @@
${h.checkbox('destroy',True)}
@@ -156,7 +156,7 @@
${h.text('paths_root_path',size=30,readonly="readonly")} + title="${h.tooltip(_('This a crucial application setting. If You really sure you need to change this, you must restart application in order to make this settings take effect. Click this label to unlock.'))}"> ${_('unlock')}
diff -r a3b2b4b4e440 -r 3d9da7893fdb rhodecode/templates/admin/users/user_edit_my_account.html --- a/rhodecode/templates/admin/users/user_edit_my_account.html Tue Apr 05 18:04:06 2011 +0200 +++ b/rhodecode/templates/admin/users/user_edit_my_account.html Tue Apr 05 18:51:34 2011 +0200 @@ -143,7 +143,7 @@ src="${h.url("/images/icons/arrow_divide.png")}"/> %endif - ${("r%s:%s") % (h.get_changeset_safe(repo['repo'],'tip').revision,h.short_id(h.get_changeset_safe(repo['repo'],'tip').raw_id))} + ${("r%s:%s") % (h.get_changeset_safe(repo['repo'],'tip').revision,h.short_id(h.get_changeset_safe(repo['repo'],'tip').raw_id))} ${_('private')} ${h.form(url('repo_settings_delete', repo_name=repo['repo'].name),method='delete')} diff -r a3b2b4b4e440 -r 3d9da7893fdb rhodecode/templates/branches/branches_data.html --- a/rhodecode/templates/branches/branches_data.html Tue Apr 05 18:04:06 2011 +0200 +++ b/rhodecode/templates/branches/branches_data.html Tue Apr 05 18:51:34 2011 +0200 @@ -9,7 +9,7 @@ %for cnt,branch in enumerate(c.repo_branches.items()): - + ${branch[1].date} diff -r a3b2b4b4e440 -r 3d9da7893fdb rhodecode/templates/changelog/changelog.html --- a/rhodecode/templates/changelog/changelog.html Tue Apr 05 18:04:06 2011 +0200 +++ b/rhodecode/templates/changelog/changelog.html Tue Apr 05 18:51:34 2011 +0200 @@ -58,22 +58,9 @@
- - <% - def changed_tooltip(cs): - if cs: - pref = ': ' - suf = '' - if len(cs) > 30: - suf='
'+_(' and %s more') % (len(cs) - 30) - return pref+'
'.join([x.path for x in cs[:30]]) + suf - else: - return ': '+_('No Files') - %> - - ${len(cs.removed)} - ${len(cs.changed)} - ${len(cs.added)} + ${len(cs.removed)} + ${len(cs.changed)} + ${len(cs.added)}
%if len(cs.parents)>1:
diff -r a3b2b4b4e440 -r 3d9da7893fdb rhodecode/templates/files/files_browser.html --- a/rhodecode/templates/files/files_browser.html Tue Apr 05 18:04:06 2011 +0200 +++ b/rhodecode/templates/files/files_browser.html Tue Apr 05 18:51:34 2011 +0200 @@ -63,13 +63,13 @@ %if node.is_file(): - + ${node.last_changeset.revision} %endif %if node.is_file(): - + ${h.age(node.last_changeset.date)} %endif diff -r a3b2b4b4e440 -r 3d9da7893fdb rhodecode/templates/index.html --- a/rhodecode/templates/index.html Tue Apr 05 18:04:06 2011 +0200 +++ b/rhodecode/templates/index.html Tue Apr 05 18:51:34 2011 +0200 @@ -87,12 +87,12 @@
##DESCRIPTION - + ${h.truncate(repo['description'],60)} ##LAST CHANGE - + ${h.age(repo['last_change'])} @@ -100,7 +100,7 @@ ${h.link_to('r%s:%s' % (repo['rev'],h.short_id(repo['tip'])), h.url('changeset_home',repo_name=repo['name'],revision=repo['tip']), class_="tooltip", - tooltip_title=h.tooltip(repo['last_msg']))} + title=h.tooltip(repo['last_msg']))} %else: ${_('No changesets yet')} %endif diff -r a3b2b4b4e440 -r 3d9da7893fdb rhodecode/templates/shortlog/shortlog_data.html --- a/rhodecode/templates/shortlog/shortlog_data.html Tue Apr 05 18:04:06 2011 +0200 +++ b/rhodecode/templates/shortlog/shortlog_data.html Tue Apr 05 18:51:34 2011 +0200 @@ -18,7 +18,7 @@ h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id), title=cs.message)} - + ${h.age(cs.date)} ${h.person(cs.author)} diff -r a3b2b4b4e440 -r 3d9da7893fdb rhodecode/templates/tags/tags_data.html --- a/rhodecode/templates/tags/tags_data.html Tue Apr 05 18:04:06 2011 +0200 +++ b/rhodecode/templates/tags/tags_data.html Tue Apr 05 18:51:34 2011 +0200 @@ -9,7 +9,7 @@ %for cnt,tag in enumerate(c.repo_tags.items()): - + ${tag[1].date} diff -r a3b2b4b4e440 -r 3d9da7893fdb rhodecode/tests/functional/test_changelog.py --- a/rhodecode/tests/functional/test_changelog.py Tue Apr 05 18:04:06 2011 +0200 +++ b/rhodecode/tests/functional/test_changelog.py Tue Apr 05 18:51:34 2011 +0200 @@ -10,9 +10,9 @@ assert """
""" in response.body, 'wrong info about number of changes' assert """
commit 154: 5e204e7583b9@2010-08-10 01:18:46
""" in response.body , 'no info on this commit' assert """Small update at simplevcs app""" in response.body, 'missing info about commit message' - assert """0""" in response.body, 'wrong info about removed nodes' - assert """2""" in response.body, 'wrong info about changed nodes' - assert """1""" in response.body, 'wrong info about added nodes' + assert """0""" in response.body, 'wrong info about removed nodes' + assert """2""" in response.body, 'wrong info about changed nodes' + assert """1""" in response.body, 'wrong info about added nodes' #pagination @@ -26,9 +26,9 @@ # Test response after pagination... print response.body assert """
commit 64: 46ad32a4f974@2010-04-20 00:33:21
"""in response.body, 'wrong info about commit 64' - assert """1"""in response.body, 'wrong info about number of removed' - assert """13"""in response.body, 'wrong info about number of changes' - assert """20"""in response.body, 'wrong info about number of added' + assert """1"""in response.body, 'wrong info about number of removed' + assert """13"""in response.body, 'wrong info about number of changes' + assert """20"""in response.body, 'wrong info about number of added' assert """""" % HG_REPO in response.body, 'wrong info about commit 64 is a merge'