summaryrefslogtreecommitdiff
path: root/web/public/js
diff options
context:
space:
mode:
Diffstat (limited to 'web/public/js')
-rw-r--r--web/public/js/customSelect.jquery.js26
-rw-r--r--web/public/js/flexigrid.js37
-rw-r--r--web/public/js/jquery.tipsy.js241
-rw-r--r--web/public/js/taginfo.js181
4 files changed, 412 insertions, 73 deletions
diff --git a/web/public/js/customSelect.jquery.js b/web/public/js/customSelect.jquery.js
new file mode 100644
index 0000000..b28c0ed
--- /dev/null
+++ b/web/public/js/customSelect.jquery.js
@@ -0,0 +1,26 @@
+(function($){
+ $.fn.extend({
+
+ customStyle : function(options) {
+ if(!$.browser.msie || ($.browser.msie&&$.browser.version>6)){
+ return this.each(function() {
+
+ var currentSelected = $(this).find(':selected');
+ $(this).after('<span class="customStyleSelectBox"><span class="customStyleSelectBoxInner">'+currentSelected.text()+'</span></span>').css({position:'absolute', opacity:0 /*,fontSize:$(this).next().css('font-size')*/});
+ var selectBoxSpan = $(this).next();
+ var selectBoxWidth = parseInt($(this).width()) - parseInt(selectBoxSpan.css('padding-left')) -parseInt(selectBoxSpan.css('padding-right'));
+ var selectBoxSpanInner = selectBoxSpan.find(':first-child');
+ selectBoxSpan.css({display:'inline-block'});
+ selectBoxSpanInner.css({width:selectBoxWidth, display:'inline-block'});
+ var selectBoxHeight = parseInt(selectBoxSpan.height()) + parseInt(selectBoxSpan.css('padding-top')) + parseInt(selectBoxSpan.css('padding-bottom'));
+ $(this).height(selectBoxHeight).change(function(){
+ // selectBoxSpanInner.text($(this).val()).parent().addClass('changed'); This was not ideal
+ selectBoxSpanInner.text($(this).find(':selected').text()).parent().addClass('changed');
+ // Thanks to Juarez Filho & PaddyMurphy
+ });
+
+ });
+ }
+ }
+ });
+})(jQuery);
diff --git a/web/public/js/flexigrid.js b/web/public/js/flexigrid.js
index 95914bf..66813c3 100644
--- a/web/public/js/flexigrid.js
+++ b/web/public/js/flexigrid.js
@@ -94,6 +94,14 @@
);
},
+ getRp: function() {
+ return p.rp;
+ },
+ newRp: function(value) {
+ p.newp = 1;
+ p.rp = value;
+ g.populate();
+ },
fixHeight: function (newH) {
newH = false;
if (!newH) newH = $(g.bDiv).height();
@@ -117,7 +125,11 @@
var hrH = g.bDiv.offsetTop + newH;
if (p.height != 'auto' && p.resizable) hrH = g.vDiv.offsetTop;
$(g.rDiv).css({height: hrH});
-
+
+ var width_pDiv = jQuery(g.pDiv).width();
+ var width_hDiv = jQuery(g.hDiv).find('tr').width() - 1;
+ jQuery(g.pDiv).find('.pDiv2').width( Math.min(width_pDiv, width_hDiv) );
+
},
dragStart: function (dragtype,e,obj) { //default drag function start
@@ -250,6 +262,7 @@
this.rePosDrag();
this.fixHeight();
this.colresize = false;
+ this.populate();
}
else if (this.vresize)
{
@@ -393,6 +406,11 @@
if (this.pDiv) {
this.domElements.pPageStat.html(p.nomsg);
}
+ if (p.emptymsg != null) {
+ jQuery(this.gDiv).replaceWith('<span class="emptymsg">' + p.emptymsg + '</span>');
+ } else {
+ jQuery(this.gDiv).remove();
+ }
return false;
}
@@ -527,7 +545,7 @@
tbody = null; data = null; i = null;
- if (p.onSuccess) p.onSuccess();
+ if (p.onSuccess) p.onSuccess(g);
if (p.hideOnSubmit) $(g.block).remove();//$(t).show();
this.hDiv.scrollLeft = this.bDiv.scrollLeft;
@@ -599,7 +617,7 @@
this.domElements.pReload.addClass('loading');
}
- $(g.block).css({top:g.bDiv.offsetTop});
+ $(g.block).css({top:g.bDiv.offsetTop, width: jQuery(g.pDiv).find('.pDiv2').width()});
if (p.hideOnSubmit) $(this.gDiv).prepend(g.block); //$(t).hide();
@@ -1168,7 +1186,7 @@
{
g.pDiv.className = 'pDiv';
g.pDiv.innerHTML = '<div class="pDiv2"></div>';
- $(g.bDiv).after(g.pDiv);
+ $(g.bDiv).parent().prepend(g.pDiv);
var html = ' <div class="pGroup"> <div class="pFirst pButton"><span></span></div><div class="pPrev pButton"><span></span></div> </div> <div class="btnseparator"></div> <div class="pGroup"><span class="pcontrol">'+p.pagetext+' <input type="text" size="4" value="1" /> '+p.outof+' <span> 1 </span></span></div> <div class="btnseparator"></div> <div class="pGroup"> <div class="pNext pButton"><span></span></div><div class="pLast pButton"><span></span></div> </div> <div class="btnseparator"></div> <div class="pGroup"> <div class="pReload pButton"><span></span></div> </div> <div class="btnseparator"></div> <div class="pGroup"><span class="pPageStat"></span></div>';
$('div',g.pDiv).html(html);
@@ -1215,8 +1233,8 @@
//add search button
if (p.searchitems)
{
- $('.pDiv2',g.pDiv).prepend("<div class='pGroup'> <div class='pSearch pButton'><span></span></div> </div> <div class='btnseparator'></div>");
- $('.pSearch',g.pDiv).click(function(){$(g.sDiv).slideToggle('fast',function(){$('.sDiv:visible input:first',g.gDiv).trigger('focus');});});
+/* $('.pDiv2',g.pDiv).prepend("<div class='pGroup'> <div class='pSearch pButton'><span></span></div> </div> <div class='btnseparator'></div>");
+ $('.pSearch',g.pDiv).click(function(){$(g.sDiv).slideToggle('fast',function(){$('.sDiv:visible input:first',g.gDiv).trigger('focus');});}); */
//add search box
g.sDiv.className = 'sDiv';
@@ -1235,11 +1253,11 @@
if (p.qtype=='') p.qtype = sitems[0].name;
- $(g.sDiv).append("<div class='sDiv2'>"+p.findtext+" <input type='text' size='30' name='q' class='qsbox' /> <select name='qtype'>"+sopt+"</select> <!--input type='button' value='Clear' /--></div>");
+ $(g.sDiv).append("<div class='btnseparator'></div> <div class='sDiv2'>"/*+p.findtext*/+" <input type='text' size='20' name='q' class='qsbox' />"); // <select name='qtype'>"+sopt+"</select> <!--input type='button' value='Clear' /--></div>");
$('input[name=q],select[name=qtype]',g.sDiv).keydown(function(e){if(e.keyCode==13) g.doSearch()});
$('input[value=Clear]',g.sDiv).click(function(){$('input[name=q]',g.sDiv).val(''); p.query = ''; g.doSearch(); });
- $(g.bDiv).after(g.sDiv);
+ $(g.pDiv).children().first().append(g.sDiv);
}
@@ -1279,7 +1297,8 @@
gtop = g.bDiv.offsetTop;
$(g.block).css(
{
- width: g.bDiv.style.width,
+ //width: g.bDiv.style.width,
+ width: jQuery(g.pDiv).find('.pDiv2').width(),
height: gh,
background: 'white',
position: 'relative',
diff --git a/web/public/js/jquery.tipsy.js b/web/public/js/jquery.tipsy.js
new file mode 100644
index 0000000..9567ed3
--- /dev/null
+++ b/web/public/js/jquery.tipsy.js
@@ -0,0 +1,241 @@
+// tipsy, facebook style tooltips for jquery
+// version 1.0.0a
+// (c) 2008-2010 jason frame [jason@onehackoranother.com]
+// released under the MIT license
+
+(function($) {
+
+ function maybeCall(thing, ctx) {
+ return (typeof thing == 'function') ? (thing.call(ctx)) : thing;
+ };
+
+ function Tipsy(element, options) {
+ this.$element = $(element);
+ this.options = options;
+ this.enabled = true;
+ this.fixTitle();
+ };
+
+ Tipsy.prototype = {
+ show: function() {
+ var title = this.getTitle();
+ if (title && this.enabled) {
+ var $tip = this.tip();
+
+ $tip.find('.tipsy-inner')[this.options.html ? 'html' : 'text'](title);
+ $tip[0].className = 'tipsy'; // reset classname in case of dynamic gravity
+ $tip.remove().css({top: 0, left: 0, visibility: 'hidden', display: 'block'}).prependTo(document.body);
+
+ var pos = $.extend({}, this.$element.offset(), {
+ width: this.$element[0].offsetWidth,
+ height: this.$element[0].offsetHeight
+ });
+
+ var actualWidth = $tip[0].offsetWidth,
+ actualHeight = $tip[0].offsetHeight,
+ gravity = maybeCall(this.options.gravity, this.$element[0]);
+
+ var tp;
+ switch (gravity.charAt(0)) {
+ case 'n':
+ tp = {top: pos.top + pos.height + this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2};
+ break;
+ case 's':
+ tp = {top: pos.top - actualHeight - this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2};
+ break;
+ case 'e':
+ tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth - this.options.offset};
+ break;
+ case 'w':
+ tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width + this.options.offset};
+ break;
+ }
+
+ if (gravity.length == 2) {
+ if (gravity.charAt(1) == 'w') {
+ tp.left = pos.left + pos.width / 2 - 15;
+ } else {
+ tp.left = pos.left + pos.width / 2 - actualWidth + 15;
+ }
+ }
+
+ $tip.css(tp).addClass('tipsy-' + gravity);
+ $tip.find('.tipsy-arrow')[0].className = 'tipsy-arrow tipsy-arrow-' + gravity.charAt(0);
+ if (this.options.className) {
+ $tip.addClass(maybeCall(this.options.className, this.$element[0]));
+ }
+
+ if (this.options.fade) {
+ $tip.stop().css({opacity: 0, display: 'block', visibility: 'visible'}).animate({opacity: this.options.opacity});
+ } else {
+ $tip.css({visibility: 'visible', opacity: this.options.opacity});
+ }
+ }
+ },
+
+ hide: function() {
+ if (this.options.fade) {
+ this.tip().stop().fadeOut(function() { $(this).remove(); });
+ } else {
+ this.tip().remove();
+ }
+ },
+
+ fixTitle: function() {
+ var $e = this.$element;
+ if ($e.attr('title') || typeof($e.attr('original-title')) != 'string') {
+ $e.attr('original-title', $e.attr('title') || '').removeAttr('title');
+ }
+ },
+
+ getTitle: function() {
+ var title, $e = this.$element, o = this.options;
+ this.fixTitle();
+ var title, o = this.options;
+ if (typeof o.title == 'string') {
+ title = $e.attr(o.title == 'title' ? 'original-title' : o.title);
+ } else if (typeof o.title == 'function') {
+ title = o.title.call($e[0]);
+ }
+ title = ('' + title).replace(/(^\s*|\s*$)/, "");
+ return title || o.fallback;
+ },
+
+ tip: function() {
+ if (!this.$tip) {
+ this.$tip = $('<div class="tipsy"></div>').html('<div class="tipsy-arrow"></div><div class="tipsy-inner"></div>');
+ }
+ return this.$tip;
+ },
+
+ validate: function() {
+ if (!this.$element[0].parentNode) {
+ this.hide();
+ this.$element = null;
+ this.options = null;
+ }
+ },
+
+ enable: function() { this.enabled = true; },
+ disable: function() { this.enabled = false; },
+ toggleEnabled: function() { this.enabled = !this.enabled; }
+ };
+
+ $.fn.tipsy = function(options) {
+
+ if (options === true) {
+ return this.data('tipsy');
+ } else if (typeof options == 'string') {
+ var tipsy = this.data('tipsy');
+ if (tipsy) tipsy[options]();
+ return this;
+ }
+
+ options = $.extend({}, $.fn.tipsy.defaults, options);
+
+ function get(ele) {
+ var tipsy = $.data(ele, 'tipsy');
+ if (!tipsy) {
+ tipsy = new Tipsy(ele, $.fn.tipsy.elementOptions(ele, options));
+ $.data(ele, 'tipsy', tipsy);
+ }
+ return tipsy;
+ }
+
+ function enter() {
+ var tipsy = get(this);
+ tipsy.hoverState = 'in';
+ if (options.delayIn == 0) {
+ tipsy.show();
+ } else {
+ tipsy.fixTitle();
+ setTimeout(function() { if (tipsy.hoverState == 'in') tipsy.show(); }, options.delayIn);
+ }
+ };
+
+ function leave() {
+ var tipsy = get(this);
+ tipsy.hoverState = 'out';
+ if (options.delayOut == 0) {
+ tipsy.hide();
+ } else {
+ setTimeout(function() { if (tipsy.hoverState == 'out') tipsy.hide(); }, options.delayOut);
+ }
+ };
+
+ if (!options.live) this.each(function() { get(this); });
+
+ if (options.trigger != 'manual') {
+ var binder = options.live ? 'live' : 'bind',
+ eventIn = options.trigger == 'hover' ? 'mouseenter' : 'focus',
+ eventOut = options.trigger == 'hover' ? 'mouseleave' : 'blur';
+ this[binder](eventIn, enter)[binder](eventOut, leave);
+ }
+
+ return this;
+
+ };
+
+ $.fn.tipsy.defaults = {
+ className: null,
+ delayIn: 0,
+ delayOut: 0,
+ fade: false,
+ fallback: '',
+ gravity: 'n',
+ html: false,
+ live: false,
+ offset: 0,
+ opacity: 0.8,
+ title: 'title',
+ trigger: 'hover'
+ };
+
+ // Overwrite this method to provide options on a per-element basis.
+ // For example, you could store the gravity in a 'tipsy-gravity' attribute:
+ // return $.extend({}, options, {gravity: $(ele).attr('tipsy-gravity') || 'n' });
+ // (remember - do not modify 'options' in place!)
+ $.fn.tipsy.elementOptions = function(ele, options) {
+ return $.metadata ? $.extend({}, options, $(ele).metadata()) : options;
+ };
+
+ $.fn.tipsy.autoNS = function() {
+ return $(this).offset().top > ($(document).scrollTop() + $(window).height() / 2) ? 's' : 'n';
+ };
+
+ $.fn.tipsy.autoWE = function() {
+ return $(this).offset().left > ($(document).scrollLeft() + $(window).width() / 2) ? 'e' : 'w';
+ };
+
+ /**
+ * yields a closure of the supplied parameters, producing a function that takes
+ * no arguments and is suitable for use as an autogravity function like so:
+ *
+ * @param margin (int) - distance from the viewable region edge that an
+ * element should be before setting its tooltip's gravity to be away
+ * from that edge.
+ * @param prefer (string, e.g. 'n', 'sw', 'w') - the direction to prefer
+ * if there are no viewable region edges effecting the tooltip's
+ * gravity. It will try to vary from this minimally, for example,
+ * if 'sw' is preferred and an element is near the right viewable
+ * region edge, but not the top edge, it will set the gravity for
+ * that element's tooltip to be 'se', preserving the southern
+ * component.
+ */
+ $.fn.tipsy.autoBounds = function(margin, prefer) {
+ return function() {
+ var dir = {ns: prefer[0], ew: (prefer.length > 1 ? prefer[1] : false)},
+ boundTop = $(document).scrollTop() + margin,
+ boundLeft = $(document).scrollLeft() + margin,
+ $this = $(this);
+
+ if ($this.offset().top < boundTop) dir.ns = 'n';
+ if ($this.offset().left < boundLeft) dir.ew = 'w';
+ if ($(window).width() + $(document).scrollLeft() - $this.offset().left < margin) dir.ew = 'e';
+ if ($(window).height() + $(document).scrollTop() - $this.offset().top < margin) dir.ns = 's';
+
+ return dir.ns + (dir.ew ? dir.ew : '');
+ }
+ };
+
+})(jQuery);
diff --git a/web/public/js/taginfo.js b/web/public/js/taginfo.js
index 3ea3957..8362b58 100644
--- a/web/public/js/taginfo.js
+++ b/web/public/js/taginfo.js
@@ -1,6 +1,73 @@
// taginfo.js
+var grids = {};
+var current_grid = '';
+
+function resize_home() {
+ var tagcloud = jQuery('#tagcloud');
+ tagcloud.empty();
+ tagcloud.height(0);
+
+ resize_wrapper();
+
+ var height = tagcloud.parent().innerHeight();
+ tagcloud.parent().children().each(function(index) {
+ if (this.id != 'tagcloud') {
+ height -= jQuery(this).outerHeight(true);
+ }
+ });
+ tagcloud.height(height - 20);
+
+ var tags = tagcloud_data();
+ var cloud = '';
+ for (var i=0; i < tags.length; i++) {
+ cloud += '<a href="/keys/' + tags[i][0] + '" style="font-size: ' + tags[i][1] + 'px;">' + tags[i][0] + '</a> ';
+ }
+ tagcloud.append(cloud);
+
+ var tags = tagcloud.children().toArray().sort(function(a, b) {
+ return parseInt(jQuery(a).css('font-size')) - parseInt(jQuery(b).css('font-size'));
+ });
+
+ while (tagcloud.get(0).scrollHeight > tagcloud.height()) {
+ jQuery(tags.shift()).remove();
+ }
+}
+
+function resize_window() {
+ resize_wrapper(true);
+}
+
+function resize_wrapper(resize_grid) {
+ var height = jQuery(window).height();
+
+ height -= jQuery('div#header').outerHeight(true);
+ height -= jQuery('div.pre').outerHeight(true);
+ height -= jQuery('.ui-tabs-nav').outerHeight(true);
+ height -= jQuery('div#footer').outerHeight(true);
+
+ var wrapper = jQuery('.resize,.ui-tabs-panel');
+ wrapper.outerHeight(height);
+
+ if (resize_grid) {
+ if (grids[current_grid]) {
+ var grid = grids[current_grid][0].grid;
+ var oldrp = grid.getRp();
+ var rp = calculate_flexigrid_rp(jQuery(grids[current_grid][0]).parents('.ui-tabs-panel, div.box'));
+ if (rp != oldrp) {
+ grid.newRp(rp);
+ grid.fixHeight();
+ }
+ }
+ }
+}
+
jQuery(document).ready(function() {
+
+ jQuery('select').customStyle();
+ jQuery('*[title]').tipsy({ opacity: 1, delayIn: 500 });
+ jQuery(window).resize(resize_window);
+
jQuery.getQueryString = (function(a) {
if (a == "") return {};
var b = {};
@@ -10,16 +77,6 @@ jQuery(document).ready(function() {
}
return b;
})(window.location.search.substr(1).split('&'))
-
- jQuery('#instance_description').dialog({
- autoOpen: false,
- position: [20, 50],
- title: texts.instance_description.title
- });
-
- jQuery('#instance').click(function() {
- jQuery('#instance_description').dialog('open');
- });
});
function print_wiki_link(title, options) {
@@ -261,21 +318,48 @@ jQuery(document).ready(function() {
/* ============================ */
-var grids = {};
-
var flexigrid_defaults = {
method : 'GET',
dataType : 'json',
showToggleBtn : false,
+ height : 'auto',
usepager : true,
- useRp : true,
- rp : 15,
- rpOptions : [10,15,20,25,50,100],
+ useRp : false,
+ onSuccess : function(grid) {
+ jQuery('*[title]').tipsy({ opacity: 1, delayIn: 500, gravity: 'w' });
+ grid.fixHeight();
+ }
};
+function calculate_flexigrid_rp(box) {
+ var height = box.innerHeight();
+
+ height -= box.children('h2').outerHeight(true);
+ height -= box.children('.boxpre').outerHeight(true);
+ height -= box.children('.pDiv').outerHeight();
+ height -= box.children('.pHiv').outerHeight();
+ height -= 80; // table tools and header, possibly horizontal scrollbar
+
+ return Math.floor(height / 28);
+}
+
function create_flexigrid(domid, options) {
+ current_grid = domid;
if (grids[domid] == null) {
- grids[domid] = jQuery('#' + domid).flexigrid(jQuery.extend({}, flexigrid_defaults, texts.flexigrid, options));
+ // grid doesn't exist yet, so create it
+ var me = jQuery('#' + domid);
+ var rp = calculate_flexigrid_rp(me.parents('.ui-tabs-panel, div.box'));
+ grids[domid] = me.flexigrid(jQuery.extend({}, flexigrid_defaults, texts.flexigrid, options, { rp: rp }));
+ jQuery('*[title]').tipsy({ opacity: 1, delayIn: 500, gravity: 's' });
+ } else {
+ // grid does exist, make sure it has the right size
+ var grid = grids[domid][0].grid;
+ var oldrp = grid.getRp();
+ var rp = calculate_flexigrid_rp(jQuery(grids[domid][0]).parents('.ui-tabs-panel, div.box'));
+ if (rp != oldrp) {
+ grid.newRp(rp);
+ grid.fixHeight();
+ }
}
}
@@ -285,14 +369,14 @@ var create_flexigrid_for = {
create_flexigrid('grid-keys', {
url: '/api/2/db/keys?include=prevalent_values',
colModel: [
- { display: texts.osm.key, name: 'key', width: 180, sortable: true },
- { display: '<span title="Number of objects with this key"><img src="/img/types/all.16.png" alt=""/> Total</span>', name: 'count_all', width: 250, sortable: true, align: 'center' },
- { display: '<span title="Number of nodes with this key"><img src="/img/types/node.16.png" alt=""/> Nodes</span>', name: 'count_nodes', width: 250, sortable: true, align: 'center' },
- { display: '<span title="Number of ways with this key"><img src="/img/types/way.16.png" alt=""/> Ways</span>', name: 'count_ways', width: 250, sortable: true, align: 'center' },
- { display: '<span title="Number of relations with this key"><img src="/img/types/relation.16.png" alt=""/> Relation</span>', name: 'count_relations', width: 250, sortable: true, align: 'center' },
- { display: 'Users', name: 'users_all', width: 44, sortable: true, align: 'right' },
- { display: '<img src="/img/sources/wiki.16.png" alt="Wiki" title="Wiki"/>', name: 'in_wiki', width: 20, sortable: true, align: 'center' },
- { display: '<img src="/img/sources/josm.16.png" alt="JOSM" title="JOSM"/>', name: 'in_josm', width: 20, sortable: true, align: 'center' },
+ { display: texts.osm.key, name: 'key', width: 160, sortable: true },
+ { display: '<span title="Number of objects with this key"><img src="/img/types/all.16.png" alt=""/> Total</span>', name: 'count_all', width: 200, sortable: true, align: 'center' },
+ { display: '<span title="Number of nodes with this key"><img src="/img/types/node.16.png" alt=""/> Nodes</span>', name: 'count_nodes', width: 220, sortable: true, align: 'center' },
+ { display: '<span title="Number of ways with this key"><img src="/img/types/way.16.png" alt=""/> Ways</span>', name: 'count_ways', width: 220, sortable: true, align: 'center' },
+ { display: '<span title="Number of relations with this key"><img src="/img/types/relation.16.png" alt=""/> Relation</span>', name: 'count_relations', width: 220, sortable: true, align: 'center' },
+ { display: '<span title="Number of users currently owning objects with this key">Users</span>', name: 'users_all', width: 44, sortable: true, align: 'right' },
+ { display: '<img src="/img/sources/wiki.16.png" alt="Wiki" title="Key has wiki page"/>', name: 'in_wiki', width: 20, sortable: true, align: 'center' },
+ { display: '<img src="/img/sources/josm.16.png" alt="JOSM" title="Key appears in JOSM config"/>', name: 'in_josm', width: 20, sortable: true, align: 'center' },
{ display: '<span title="Number of different values for this key">Values</span>', name: 'values_all', width: 70, sortable: true, align: 'right' },
{ display: 'Prevalent Values', name: 'prevalent_values', width: 500, sortable: true }
],
@@ -301,7 +385,6 @@ var create_flexigrid_for = {
],
sortname: 'count_all',
sortorder: 'desc',
- height: 420,
preProcess: function(data) {
data.rows = jQuery.map(data.data, function(row, i) {
return { 'cell': [
@@ -338,7 +421,6 @@ var create_flexigrid_for = {
],
sortname: 'count_all',
sortorder: 'desc',
- height: 420,
preProcess: function(data) {
data.rows = jQuery.map(data.data, function(row, i) {
return { 'cell': [
@@ -364,7 +446,6 @@ var create_flexigrid_for = {
],
usepager: false,
useRp: false,
- height: 130,
preProcess: function(data) {
return {
total: 4,
@@ -392,7 +473,7 @@ var create_flexigrid_for = {
],
sortname: 'to_count',
sortorder: 'desc',
- height: 410,
+ emptymsg: '[No combinations found (only checked the most common ones).]',
preProcess: function(data) {
data.rows = jQuery.map(data.data, function(row, i) {
return { 'cell': [
@@ -410,7 +491,7 @@ var create_flexigrid_for = {
url: '/api/2/wiki/tags?key=' + encodeURIComponent(key) + '&value=' + encodeURIComponent(value),
colModel: [
{ display: 'Language', name: 'lang', width: 150, sortable: false },
- { display: 'Wikipage', name: 'title', width: 200, sortable: false, align: 'right' },
+ { display: 'Wiki page', name: 'title', width: 200, sortable: false, align: 'right' },
{ display: 'Description', name: 'description', width: 400, sortable: false },
{ display: 'Image', name: 'image', width: 120, sortable: false },
{ display: 'Objects', name: 'objects', width: 80, sortable: false },
@@ -420,7 +501,6 @@ var create_flexigrid_for = {
],
usepager: false,
useRp: false,
- height: 300,
preProcess: function(data) {
return {
total: data.size,
@@ -459,7 +539,7 @@ var create_flexigrid_for = {
],*/
sortname: 'v',
sortorder: 'asc',
- height: 300,
+ emptymsg: '[No JOSM styles for this tag]',
preProcess: function(data) {
data.rows = jQuery.map(data.data, function(row, i) {
return { 'cell': [
@@ -486,7 +566,6 @@ var create_flexigrid_for = {
],
usepager: false,
useRp: false,
- height: 130,
preProcess: function(data) {
return {
total: 4,
@@ -506,20 +585,19 @@ var create_flexigrid_for = {
create_flexigrid('grid-values', {
url: '/api/2/db/keys/values?key=' + encodeURIComponent(key) + '&filter=' + encodeURIComponent(filter_type),
colModel: [
- { display: texts.misc.count, name: 'count', width: 300, sortable: true, align: 'center' },
- { display: texts.osm.value, name: 'value', width: 500, sortable: true }
+ { display: texts.osm.value, name: 'value', width: 500, sortable: true },
+ { display: texts.misc.count, name: 'count', width: 300, sortable: true, align: 'center' }
],
searchitems: [
{ display: texts.osm.value, name: 'value' }
],
sortname: 'count',
sortorder: 'desc',
- height: 410,
preProcess: function(data) {
data.rows = jQuery.map(data.data, function(row, i) {
return { 'cell': [
- print_value_with_percent(row.count, row.fraction),
- link_to_value(key, row.value)
+ link_to_value(key, row.value),
+ print_value_with_percent(row.count, row.fraction)
] };
});
delete data.data;
@@ -540,7 +618,6 @@ var create_flexigrid_for = {
],
sortname: 'to_count',
sortorder: 'desc',
- height: 410,
preProcess: function(data) {
data.rows = jQuery.map(data.data, function(row, i) {
return { 'cell': [
@@ -568,7 +645,7 @@ var create_flexigrid_for = {
],
sortname: 'v',
sortorder: 'asc',
- height: 410,
+ emptymsg: '[No JOSM styles for this key]',
preProcess: function(data) {
data.rows = jQuery.map(data.data, function(row, i) {
return { 'cell': [
@@ -588,7 +665,7 @@ var create_flexigrid_for = {
url: '/api/2/wiki/keys?key=' + encodeURIComponent(key),
colModel: [
{ display: 'Language', name: 'lang', width: 150, sortable: false },
- { display: 'Wikipage', name: 'title', width: 160, sortable: false, align: 'right' },
+ { display: 'Wiki page', name: 'title', width: 160, sortable: false, align: 'right' },
{ display: 'Description', name: 'description', width: 400, sortable: false },
{ display: 'Image', name: 'image', width: 120, sortable: false },
{ display: 'Objects', name: 'objects', width: 80, sortable: false },
@@ -598,7 +675,6 @@ var create_flexigrid_for = {
],
usepager: false,
useRp: false,
- height: 400,
preProcess: function(data) {
return {
total: data.size,
@@ -633,7 +709,6 @@ var create_flexigrid_for = {
],
sortname: 'count_all',
sortorder: 'desc',
- height: 420,
preProcess: function(data) {
data.rows = jQuery.map(data.data, function(row, i) {
return { 'cell': [
@@ -655,7 +730,6 @@ var create_flexigrid_for = {
],
sortname: 'count_all',
sortorder: 'desc',
- height: 420,
preProcess: function(data) {
data.rows = jQuery.map(data.data, function(row, i) {
return { 'cell': [
@@ -679,7 +753,6 @@ var create_flexigrid_for = {
],
sortname: 'count_all',
sortorder: 'desc',
- height: 420,
preProcess: function(data) {
data.rows = jQuery.map(data.data, function(row, i) {
return { 'cell': [
@@ -713,7 +786,6 @@ var create_flexigrid_for = {
],
sortname: 'k',
sortorder: 'asc',
- height: 400,
preProcess: function(data) {
data.rows = jQuery.map(data.data, function(row, i) {
return { 'cell': [
@@ -745,7 +817,6 @@ var create_flexigrid_for = {
],
sortname: 'count_all',
sortorder: 'desc',
- height: 420,
preProcess: function(data) {
data.rows = jQuery.map(data.data, function(row, i) {
var wikilinks = [];
@@ -775,7 +846,6 @@ var create_flexigrid_for = {
{ display: 'Wiki Key Pages', name: 'wiki_key_pages', width: 260, sortable: true, align: 'center' },
{ display: 'Wiki Tag Pages', name: 'wiki_tag_pages', width: 260, sortable: true, align: 'center' }
],
- height: 540,
sortname: 'code',
sortorder: 'asc',
showToggleBtn: false,
@@ -814,7 +884,6 @@ var create_flexigrid_for = {
],
sortname: 'count_all',
sortorder: 'desc',
- height: 420,
preProcess: function(data) {
data.rows = jQuery.map(data.data, function(row, i) {
return { 'cell': [
@@ -831,19 +900,6 @@ var create_flexigrid_for = {
});
},
characters_in_keys: {
- statistics: function() {
- create_flexigrid('grid-statistics', {
- colModel: [
- { display: '&nbsp;', name: 'row', width: 10, sortable: true, align: 'center' },
- { display: texts.misc.count, name: 'count', width: 40, sortable: true, align: 'right' },
- { display: 'Fraction', name: 'fraction', width: 60, sortable: true, align: 'right' },
- { display: 'Characters in Key', name: 'characters', width: 810, sortable: true }
- ],
- width: 990,
- height: 200,
- usepager: false
- });
- },
whitespace: function() {
create_flexigrid('grid-whitespace', {
url: '/api/2/db/keys?filters=characters_space&include=prevalent_values',
@@ -863,7 +919,6 @@ var create_flexigrid_for = {
],
sortname: 'count_all',
sortorder: 'desc',
- height: 420,
preProcess: function(data) {
data.rows = jQuery.map(data.data, function(row, i) {
return { 'cell': [
@@ -901,7 +956,6 @@ var create_flexigrid_for = {
],
sortname: 'count_all',
sortorder: 'desc',
- height: 420,
preProcess: function(data) {
data.rows = jQuery.map(data.data, function(row, i) {
return { 'cell': [
@@ -941,7 +995,6 @@ var create_flexigrid_for = {
],
sortname: 'length',
sortorder: 'asc',
- height: 420,
preProcess: function(data) {
data.rows = jQuery.map(data.data, function(row, i) {
return { 'cell': [