##// END OF EJS Templates
Add mousetrap.js file from Mousetrap 1.4.5, under the Apache license....
Add mousetrap.js file from Mousetrap 1.4.5, under the Apache license. The file was download and verified via these commands: $ git clone https://github.com/ccampbell/mousetrap.git $ cd mousetrap; git checkout 1.4.5 The file in that repository named mousetrap.js is exactly the same one that appeared in RhodeCode 2.2.5 in changeset c8d3c0d61d95. The mousetrap.js states clearly that it is licensed under Apache-2.0.

File last commit:

r4116:ffd45b18 rhodecode-2.2.5-gpl
r4126:158ef336 rhodecode-2.2.5-gpl
Show More
journal.html
348 lines | 12.2 KiB | text/html | HtmlLexer
fixes for journal, added paging now it's possible to view whole journal...
r995 ## -*- coding: utf-8 -*-
<%inherit file="/base/base.html"/>
<%def name="title()">
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 ${_('Journal')}
%if c.rhodecode_name:
&middot; ${c.rhodecode_name}
%endif
fixes for journal, added paging now it's possible to view whole journal...
r995 </%def>
<%def name="breadcrumbs()">
final implementation of #210 journal filtering.
r3070 <h5>
<form id="filter_form">
<input class="q_filter_box ${'' if c.search_term else 'initial'}" id="j_filter" size="15" type="text" name="filter" value="${c.search_term or _('quick filter...')}"/>
<span class="tooltip" title="${h.tooltip(h.journal_filter_help())}">?</span>
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 <input type='submit' value="${_('filter')}" class="btn btn-small" style="padding:0px 2px 0px 2px;margin:0px"/>
final implementation of #210 journal filtering.
r3070 ${_('journal')} - ${ungettext('%s entry', '%s entries', c.journal_pager.item_count) % (c.journal_pager.item_count)}
</form>
${h.end_form()}
</h5>
fixes for journal, added paging now it's possible to view whole journal...
r995 </%def>
<%def name="page_nav()">
Set current pages indication for search and journal
r3208 ${self.menu('journal')}
fixes for journal, added paging now it's possible to view whole journal...
r995 </%def>
added discoverable rss/atom links in pages
r2413 <%def name="head_extra()">
<link href="${h.url('journal_atom', api_key=c.rhodecode_user.api_key)}" rel="alternate" title="${_('ATOM journal feed')}" type="application/atom+xml" />
<link href="${h.url('journal_rss', api_key=c.rhodecode_user.api_key)}" rel="alternate" title="${_('RSS journal feed')}" type="application/rss+xml" />
</%def>
fixes for journal, added paging now it's possible to view whole journal...
r995 <%def name="main()">
White-space cleanup
r1888
fixes for journal, added paging now it's possible to view whole journal...
r995 <div class="box box-left">
Mads Kiilerich
html: don't use tabs
r3197 <!-- box / title -->
<div class="title">
final implementation of #210 journal filtering.
r3070 ${self.breadcrumbs()}
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 <ul class="links icon-only-links">
final implementation of #210 journal filtering.
r3070 <li>
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 <span><a id="refresh" href="${h.url('journal')}"><i class="icon-refresh"></i></a></span>
final implementation of #210 journal filtering.
r3070 </li>
<li>
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 <span><a href="${h.url('journal_atom', api_key=c.rhodecode_user.api_key)}"><i class="icon-rss-sign"></i></a></span>
final implementation of #210 journal filtering.
r3070 </li>
</ul>
Mads Kiilerich
html: don't use tabs
r3197 </div>
<div id="journal">${c.journal_data}</div>
fixes for journal, added paging now it's possible to view whole journal...
r995 </div>
<div class="box box-right">
<!-- box / title -->
whitespace cleanup
r3168
fixes for journal, added paging now it's possible to view whole journal...
r995 <div class="title">
White-space cleanup
r1888 <h5>
use placeholders in qfilter, not the ugly JS logic
r3665 <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value="" style="display: none"/>
<input class="q_filter_box" id="q_filter_watched" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value="" style="display: none"/>
personal Journal UI...
r1741 </h5>
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 <ul class="links nav nav-tabs">
<li class="active" id="show_watched_li">
<a id="show_watched" href="#watched"><i class="icon-eye-open"></i> ${_('Watched')}</a>
</li>
<li id="show_my_li">
<a id="show_my" href="#my"><i class="icon-archive"></i> ${_('My repos')}</a>
Use common function for generation of grid data...
r3154 </li>
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 </ul>
whitespace cleanup
r3168 </div>
personal Journal UI...
r1741 <!-- end box / title -->
Use common function for generation of grid data...
r3154 <div id="my_container" style="display:none">
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 <div class="table-grid table yui-skin-sam" id="repos_list_wrap"></div>
Use common function for generation of grid data...
r3154 <div id="user-paginator" style="padding: 0px 0px 0px 20px"></div>
fixes for journal, added paging now it's possible to view whole journal...
r995 </div>
whitespace cleanup
r3168
Use common function for generation of grid data...
r3154 <div id="watched_container">
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 <div class="table-grid table yui-skin-sam" id="watched_repos_list_wrap"></div>
Use common function for generation of grid data...
r3154 <div id="watched-user-paginator" style="padding: 0px 0px 0px 20px"></div>
White-space cleanup
r1888 </div>
Journal refresh button
r1746 </div>
White-space cleanup
r1888
personal Journal UI...
r1741 <script type="text/javascript">
white space cleanup
r3149
final implementation of #210 journal filtering.
r3070 YUE.on('j_filter','click',function(){
var jfilter = YUD.get('j_filter');
if(YUD.hasClass(jfilter, 'initial')){
jfilter.value = '';
}
});
var fix_j_filter_width = function(len){
YUD.setStyle(YUD.get('j_filter'),'width',Math.max(80, len*6.50)+'px');
}
YUE.on('j_filter','keyup',function(){
fix_j_filter_width(YUD.get('j_filter').value.length);
});
YUE.on('filter_form','submit',function(e){
YUE.preventDefault(e)
var val = YUD.get('j_filter').value;
window.location = "${url.current(filter='__FILTER__')}".replace('__FILTER__',val);
});
white space cleanup
r3149 fix_j_filter_width(YUD.get('j_filter').value.length);
Use common function for generation of grid data...
r3154 YUE.on('refresh','click',function(e){
ypjax("${h.url.current(filter=c.search_term)}","journal",function(){
show_more_event();
Lazy loading on my journal page
r2951 tooltip_activate();
Use common function for generation of grid data...
r3154 show_changeset_tooltip();
});
YUE.preventDefault(e);
whitespace cleanup
r3168 });
Use common function for generation of grid data...
r3154 var show_my = function(e){
YUD.setStyle('watched_container','display','none');
YUD.setStyle('my_container','display','');
YUD.setStyle('q_filter','display','');
YUD.setStyle('q_filter_watched','display','none');
whitespace cleanup
r2973
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 YUD.addClass('show_my_li', 'active');
YUD.removeClass('show_watched_li','active');
whitespace cleanup
r3168
Use common function for generation of grid data...
r3154 if(!YUD.hasClass('show_my', 'loaded')){
table_renderer(${c.data |n});
YUD.addClass('show_my', 'loaded');
}
Lazy loading on my journal page
r2951 }
YUE.on('show_my','click',function(e){
show_my(e);
personal Journal UI...
r1741 })
Lazy loading on my journal page
r2951 var show_watched = function(e){
Mads Kiilerich
html: don't use tabs
r3197 YUD.setStyle('my_container','display','none');
Use common function for generation of grid data...
r3154 YUD.setStyle('watched_container','display','');
YUD.setStyle('q_filter_watched','display','');
YUD.setStyle('q_filter','display','none');
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 YUD.addClass('show_watched_li', 'active');
YUD.removeClass('show_my_li','active');
Use common function for generation of grid data...
r3154 if(!YUD.hasClass('show_watched', 'loaded')){
Mads Kiilerich
html: don't use tabs
r3197 watched_renderer(${c.watched_data |n});
Use common function for generation of grid data...
r3154 YUD.addClass('show_watched', 'loaded');
whitespace cleanup
r3168 }
Use common function for generation of grid data...
r3154 return
var nodes = YUQ('#watched_container .watched_repo a');
personal Journal UI...
r1741 var target = 'q_filter';
var func = function(node){
return node.parentNode.parentNode;
}
White-space cleanup
r1888 q_filter(target,nodes,func);
Lazy loading on my journal page
r2951 }
YUE.on('show_watched','click',function(e){
show_watched(e);
personal Journal UI...
r1741 })
Lazy loading on my journal page
r2951 //init watched
show_watched();
whitespace cleanup
r2973
Lazy loading on my journal page
r2951 var tabs = {
'watched': show_watched,
'my': show_my,
}
var url = location.href.split('#');
if (url[1]) {
//We have a hash
var tabHash = url[1];
fix small issue with anchor autolinks
r3120 var func = tabs[tabHash]
if (func){
Mads Kiilerich
html: don't use tabs
r3197 func();
fix small issue with anchor autolinks
r3120 }
whitespace cleanup
r2973 }
Use common function for generation of grid data...
r3154 function watched_renderer(data){
var myDataSource = new YAHOO.util.DataSource(data);
myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSON;
whitespace cleanup
r2973
Use common function for generation of grid data...
r3154 myDataSource.responseSchema = {
resultsList: "records",
fields: [
{key:"menu"},
{key:"raw_name"},
{key:"name"},
{key:"last_changeset"},
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 {key:"last_rev_raw"},
Use common function for generation of grid data...
r3154 {key:"action"},
]
};
myDataSource.doBeforeCallback = function(req,raw,res,cb) {
// This is the filter function
var data = res.results || [],
filtered = [],
i,l;
White-space cleanup
r1888
Use common function for generation of grid data...
r3154 if (req) {
req = req.toLowerCase();
for (i = 0; i<data.length; i++) {
var pos = data[i].raw_name.toLowerCase().indexOf(req)
if (pos != -1) {
filtered.push(data[i]);
}
}
res.results = filtered;
}
return res;
}
// main table sorting
var myColumnDefs = [
{key:"menu",label:"",sortable:false,className:"quick_repo_menu hidden"},
{key:"name",label:"${_('Name')}",sortable:true,
sortOptions: { sortFunction: nameSort }},
{key:"last_changeset",label:"${_('Tip')}",sortable:true,
whitespace cleanup
r3168 sortOptions: { sortFunction: revisionSort }},
Use common function for generation of grid data...
r3154 {key:"action",label:"${_('Action')}",sortable:false},
];
Added sorting into journal and admin pages...
r1779
Use common function for generation of grid data...
r3154 var myDataTable = new YAHOO.widget.DataTable("watched_repos_list_wrap", myColumnDefs, myDataSource,{
sortedBy:{key:"name",dir:"asc"},
Unified the paginators for pylons and YUI....
r3776 paginator: YUI_paginator(25, ['watched-user-paginator']),
Added sorting into journal and admin pages...
r1779
Use common function for generation of grid data...
r3154 MSG_SORTASC:"${_('Click to sort ascending')}",
MSG_SORTDESC:"${_('Click to sort descending')}",
MSG_EMPTY:"${_('No records found.')}",
MSG_ERROR:"${_('Data error.')}",
MSG_LOADING:"${_('Loading...')}",
}
);
myDataTable.subscribe('postRenderEvent',function(oArgs) {
tooltip_activate();
quick_repo_menu();
});
var filterTimeout = null;
updateFilter = function () {
// Reset timeout
filterTimeout = null;
White-space cleanup
r1888
Use common function for generation of grid data...
r3154 // Reset sort
var state = myDataTable.getState();
state.sortedBy = {key:'name', dir:YAHOO.widget.DataTable.CLASS_ASC};
// Get filtered data
myDataSource.sendRequest(YUD.get('q_filter_watched').value,{
success : myDataTable.onDataReturnInitializeTable,
failure : myDataTable.onDataReturnInitializeTable,
scope : myDataTable,
argument: state
});
};
YUE.on('q_filter_watched','click',function(){
if(!YUD.hasClass('q_filter_watched', 'loaded')){
//TODO: load here full list later to do search within groups
YUD.addClass('q_filter_watched', 'loaded');
}
});
White-space cleanup
r1888
Use common function for generation of grid data...
r3154 YUE.on('q_filter_watched','keyup',function (e) {
clearTimeout(filterTimeout);
filterTimeout = setTimeout(updateFilter,600);
});
}
whitespace cleanup
r3168
Use common function for generation of grid data...
r3154 function table_renderer(data){
var myDataSource = new YAHOO.util.DataSource(data);
myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSON;
myDataSource.responseSchema = {
resultsList: "records",
fields: [
{key:"menu"},
{key:"raw_name"},
{key:"name"},
{key:"last_changeset"},
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 {key:"last_rev_raw"},
Use common function for generation of grid data...
r3154 {key:"action"},
]
};
myDataSource.doBeforeCallback = function(req,raw,res,cb) {
// This is the filter function
var data = res.results || [],
filtered = [],
i,l;
if (req) {
req = req.toLowerCase();
for (i = 0; i<data.length; i++) {
var pos = data[i].raw_name.toLowerCase().indexOf(req)
if (pos != -1) {
filtered.push(data[i]);
}
}
res.results = filtered;
}
return res;
}
// main table sorting
var myColumnDefs = [
{key:"menu",label:"",sortable:false,className:"quick_repo_menu hidden"},
{key:"name",label:"${_('Name')}",sortable:true,
sortOptions: { sortFunction: nameSort }},
{key:"last_changeset",label:"${_('Tip')}",sortable:true,
whitespace cleanup
r3168 sortOptions: { sortFunction: revisionSort }},
Use common function for generation of grid data...
r3154 {key:"action",label:"${_('Action')}",sortable:false},
];
Added sorting into journal and admin pages...
r1779
Use common function for generation of grid data...
r3154 var myDataTable = new YAHOO.widget.DataTable("repos_list_wrap", myColumnDefs, myDataSource,{
sortedBy:{key:"name",dir:"asc"},
Unified the paginators for pylons and YUI....
r3776 paginator: YUI_paginator(25, ['user-paginator']),
Use common function for generation of grid data...
r3154
MSG_SORTASC:"${_('Click to sort ascending')}",
MSG_SORTDESC:"${_('Click to sort descending')}",
MSG_EMPTY:"${_('No records found.')}",
MSG_ERROR:"${_('Data error.')}",
MSG_LOADING:"${_('Loading...')}",
}
);
myDataTable.subscribe('postRenderEvent',function(oArgs) {
tooltip_activate();
quick_repo_menu();
});
var filterTimeout = null;
Mads Kiilerich
quick filter: do an initial filtering on page load if it has a search criteria - for instance after back
r4000 updateFilter = function () {
Use common function for generation of grid data...
r3154 // Reset timeout
filterTimeout = null;
// Reset sort
var state = myDataTable.getState();
state.sortedBy = {key:'name', dir:YAHOO.widget.DataTable.CLASS_ASC};
// Get filtered data
myDataSource.sendRequest(YUD.get('q_filter').value,{
success : myDataTable.onDataReturnInitializeTable,
failure : myDataTable.onDataReturnInitializeTable,
scope : myDataTable,
argument: state
});
};
YUE.on('q_filter','click',function(){
if(!YUD.hasClass('q_filter', 'loaded')){
//TODO: load here full list later to do search within groups
YUD.addClass('q_filter', 'loaded');
Added sorting into journal and admin pages...
r1779 }
Use common function for generation of grid data...
r3154 });
White-space cleanup
r1888
Use common function for generation of grid data...
r3154 YUE.on('q_filter','keyup',function (e) {
clearTimeout(filterTimeout);
filterTimeout = setTimeout(updateFilter,600);
});
Mads Kiilerich
quick filter: do an initial filtering on page load if it has a search criteria - for instance after back
r4000
if(YUD.get('q_filter').value) {
codecleaner
r4002 updateFilter();
Mads Kiilerich
quick filter: do an initial filtering on page load if it has a search criteria - for instance after back
r4000 }
}
whitespace cleanup
r3168
White-space cleanup
r1888 </script>
</%def>