Changeset - 95f03f8f5f9a
[Not reviewed]
beta
0 3 0
Marcin Kuzminski - 13 years ago 2012-11-04 13:28:03
marcin@python-works.com
- add loading message on lazy loaded toolips for journals
- fixed callbacks on admin journal
3 files changed with 10 insertions and 4 deletions:
0 comments (0 inline, 0 general)
rhodecode/public/js/rhodecode.js
Show inline comments
 
@@ -306,73 +306,75 @@ var tooltip_activate = function(){
 
/**
 
 * show more
 
 */
 
var show_more_event = function(){
 
    YUE.on(YUD.getElementsByClassName('show_more'),'click',function(e){
 
        var el = e.target;
 
        YUD.setStyle(YUD.get(el.id.substring(1)),'display','');
 
        YUD.setStyle(el.parentNode,'display','none');
 
    });
 
};
 

	
 
/**
 
 * show changeset tooltip
 
 */
 
var show_changeset_tooltip = function(){
 
	YUE.on(YUD.getElementsByClassName('lazy-cs'), 'mouseover', function(e){
 
		var target = e.currentTarget;
 
		var rid = YUD.getAttribute(target,'raw_id');
 
		var repo_name = YUD.getAttribute(target,'repo_name');
 
		var ttid = 'tt-'+rid;
 
		var success = function(o){
 
			var json = JSON.parse(o.responseText);
 
			YUD.addClass(target,'tooltip')
 
			YUD.setAttribute(target, 'title',json['message']);
 
			YAHOO.yuitip.main.set_listeners(target);
 
			YAHOO.yuitip.main.show_yuitip(e, target);
 
		}
 
		if(rid && !YUD.hasClass(target, 'tooltip')){
 
			YUD.setAttribute(target,'id',ttid);
 
			YUD.setAttribute(target, 'title',_TM['loading...']);
 
			YAHOO.yuitip.main.set_listeners(target);
 
			YAHOO.yuitip.main.show_yuitip(e, target);			
 
			ajaxGET('/changeset_info/{0}/{1}'.format(repo_name,rid), success)
 
		}
 
	});
 
};
 

	
 

	
 
/**
 
 * TOOLTIP IMPL.
 
 */
 
YAHOO.namespace('yuitip');
 
YAHOO.yuitip.main = {
 

	
 
	$:			YAHOO.util.Dom.get,
 

	
 
	bgColor:	'#000',
 
	speed:		0.3,
 
	opacity:	0.9,
 
	offset:		[15,15],
 
	useAnim:	false,
 
	maxWidth:	300,
 
	maxWidth:	600,
 
	add_links:	false,
 
	yuitips:    [],
 

	
 
	set_listeners: function(tt){
 
		YUE.on(tt, 'mouseover', yt.show_yuitip,  tt);
 
		YUE.on(tt, 'mousemove', yt.move_yuitip,  tt);
 
		YUE.on(tt, 'mouseout',  yt.close_yuitip, tt);		
 
	},
 

	
 
	init: function(){
 
		yt._tooltip = '';
 
		yt.tipBox = yt.$('tip-box');
 
		if(!yt.tipBox){
 
			yt.tipBox = document.createElement('div');
 
			document.body.appendChild(yt.tipBox);
 
			yt.tipBox.id = 'tip-box';
 
		}
 

	
 
		YUD.setStyle(yt.tipBox, 'display', 'none');
 
		YUD.setStyle(yt.tipBox, 'position', 'absolute');
 
		if(yt.maxWidth !== null){
 
			YUD.setStyle(yt.tipBox, 'max-width', yt.maxWidth+'px');
 
		}
 

	
rhodecode/templates/admin/admin_log.html
Show inline comments
 
@@ -13,42 +13,46 @@
 
	<tr class="parity${cnt%2}">
 
		<td>${h.link_to(l.user.username,h.url('edit_user', id=l.user.user_id))}</td>
 
		<td>${h.action_parser(l)[0]()}
 
		  <div class="journal_action_params">
 
            ${h.literal(h.action_parser(l)[1]())}
 
          </div>
 
		</td>
 
		<td>
 
		%if l.repository is not None:
 
		  ${h.link_to(l.repository.repo_name,h.url('summary_home',repo_name=l.repository.repo_name))}
 
		%else:
 
		  ${l.repository_name}
 
		%endif
 
		</td>
 

	
 
		<td>${h.fmt_date(l.action_date)}</td>
 
		<td>${l.user_ip}</td>
 
	</tr>
 
	%endfor
 
</table>
 

	
 
<script type="text/javascript">
 
  YUE.onDOMReady(function(){
 
	YUE.delegate("user_log","click",function(e, matchedEl, container){
 
		ypjax(e.target.href,"user_log",function(){show_more_event();tooltip_activate();});
 
		ypjax(e.target.href,"user_log",function(){
 
			show_more_event();
 
			tooltip_activate();
 
			show_changeset_tooltip();
 
		});
 
		YUE.preventDefault(e);
 
	},'.pager_link');
 

	
 
	YUE.delegate("user_log","click",function(e,matchedEl,container){
 
	      var el = e.target;
 
	      YUD.setStyle(YUD.get(el.id.substring(1)),'display','');
 
	      YUD.setStyle(el.parentNode,'display','none');
 
	  },'.show_more');
 
  });
 
</script>
 

	
 
<div class="pagination-wh pagination-left">
 
${c.users_log.pager('$link_previous ~2~ $link_next')}
 
</div>
 
%else:
 
	${_('No actions yet')}
 
%endif
rhodecode/templates/base/root.html
Show inline comments
 
@@ -23,54 +23,54 @@
 
        <!-- Analytics -->
 
	     <script type="text/javascript">
 
	      var _gaq = _gaq || [];
 
	      _gaq.push(['_setAccount', '${c.ga_code}']);
 
	      _gaq.push(['_trackPageview']);
 

	
 
	      (function() {
 
	        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
 
	        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
 
	        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
 
	      })();
 
	     </script>
 
	    %endif
 

	
 
        ## JAVASCRIPT ##
 
        <%def name="js()">
 
            <script type="text/javascript">
 
            //JS translations map
 
            var TRANSLATION_MAP = {
 
                'add another comment':'${_("add another comment")}',
 
                'Stop following this repository':"${_('Stop following this repository')}",
 
                'Start following this repository':"${_('Start following this repository')}",
 
                'Group':"${_('Group')}",
 
                'members':"${_('members')}",
 
                'loading...':"${_('loading...')}",
 
                'search truncated': "${_('search truncated')}",
 
                'no matching files': "${_('no matching files')}",
 
                'Open new pull request': "${_('Open new pull request')}",
 
                'Open new pull request for selected changesets':  "${_('Open new pull request for selected changesets')}",
 
                'Show selected changes __S -> __E': "${_('Show selected changes __S -> __E')}",
 

	
 
            };
 
            var _TM = TRANSLATION_MAP;
 
            </script>
 
            <script type="text/javascript" src="${h.url('/js/yui.2.9.js', ver=c.rhodecode_version)}"></script>
 
            <!--[if lt IE 9]>
 
               <script language="javascript" type="text/javascript" src="${h.url('/js/excanvas.min.js')}"></script>
 
            <![endif]-->
 
            <script type="text/javascript" src="${h.url('/js/yui.flot.js', ver=c.rhodecode_version)}"></script>
 
            <script type="text/javascript" src="${h.url('/js/native.history.js', ver=c.rhodecode_version)}"></script>
 
            <script type="text/javascript" src="${h.url('/js/rhodecode.js', ver=c.rhodecode_version)}"></script>
 
           ## EXTRA FOR JS
 
           ${self.js_extra()}
 

	
 
            <script type="text/javascript">
 
            (function(window,undefined){
 

	
 
                // Prepare
 
                var History = window.History; // Note: We are using a capital H instead of a lower h
 
                if ( !History.enabled ) {
 
                     // History.js is disabled for this browser.
 
                     // This is because we can optionally choose to support HTML4 browsers or not.
 
                    return false;
 
                }
 
            })(window);
0 comments (0 inline, 0 general)