Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
WEBUI: JS - more i18n cleanups (PagingToolbar)
  • Loading branch information
perexg committed Jun 19, 2015
1 parent f64e3dc commit 195b745
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 29 deletions.
7 changes: 3 additions & 4 deletions src/webui/static/app/epg.js
Expand Up @@ -874,10 +874,9 @@ tvheadend.epg = function() {
selModel: new Ext.ux.grid.livegrid.RowSelectionModel(),
view: epgView,
tbar: tbar,
bbar: new Ext.ux.grid.livegrid.Toolbar({
view: epgView,
displayInfo: true
}),
bbar: new Ext.ux.grid.livegrid.Toolbar(
tvheadend.PagingToolbarConf({view: epgView},_('Events'),0,0)
),
listeners: {
beforestaterestore: {
fn: function(grid, state) {
Expand Down
39 changes: 14 additions & 25 deletions src/webui/static/app/idnode.js
Expand Up @@ -1338,14 +1338,22 @@ tvheadend.idnode_grid = function(panel, conf)
buttons.push(_('Hide') + ':');
buttons.push(hidemode);
}
var page = new Ext.PagingToolbar({
store: store,
pageSize: 50,
displayInfo: true,
displayMsg: conf.titleP + _(' {0} - {1} of {2}'),
width: 50

/* Grid Panel */
auto = new Ext.form.Checkbox({
checked: true,
listeners: {
check: function(s, c) {
if (c)
store.reload();
}
}
});

var page = new Ext.PagingToolbar(
tvheadend.PagingToolbarConf({store:store}, conf.titleP, auto, count)
);

/* Extra buttons */
if (conf.tbar) {
buttons.push('-');
Expand Down Expand Up @@ -1376,16 +1384,6 @@ tvheadend.idnode_grid = function(panel, conf)
});
}

/* Grid Panel */
auto = new Ext.form.Checkbox({
checked: true,
listeners: {
check: function(s, c) {
if (c)
store.reload();
}
}
});
var count = new Ext.form.ComboBox({
width: 50,
displayField: 'val',
Expand All @@ -1412,15 +1410,6 @@ tvheadend.idnode_grid = function(panel, conf)
}
}
});
var page = new Ext.PagingToolbar({
store: store,
pageSize: 50,
displayInfo: true,
displayMsg: conf.titleP + _(' {0} - {1} of {2}'),
emptyMsg: 'No ' + conf.titleP.toLowerCase() + ' to display',
items: ['-', _('Auto-refresh'), auto,
'->', '-', _('Per page'), count]
});
plugins.push(filter);
var gconf = {
stateful: true,
Expand Down
30 changes: 30 additions & 0 deletions src/webui/static/app/tvheadend.js
Expand Up @@ -94,6 +94,36 @@ tvheadend.loading = function(on) {
Ext.getBody().unmask();
};

tvheadend.PagingToolbarConf = function(conf, title, auto=null, count=null)
{
conf.width = 50;
conf.pageSize = 50;
conf.displayInfo = true;
conf.displayMsg = title + _(' {0} - {1} of {2}');
conf.emptyMsg = String.format(_('No {0} to display'), title.toLowerCase());
conf.beforePageText = _('Page');
conf.afterPageText = _('of {0}');
conf.firstText = _('First Page');
conf.prevText = _('Previous Page');
conf.nextText = _('Next Page');
conf.lastText = _('Last Page');
conf.refreshText = _('Refresh');
conf.items = [];
if (auto || count)
conf.items.push('-');
if (auto) {
conf.items.push(_('Auto-refresh'));
conf.items.push(auto);
}
if (count) {
conf.items.push('->');
conf.items.push('-');
conf.items.push(_('Per page'));
conf.items.push(count);
}
return conf;
}

/*
* Any Match option in ComboBox queries
* This query is identical as in extjs-all.js
Expand Down

0 comments on commit 195b745

Please sign in to comment.