User:Glorat

Introduction
I am the author of https://www.boglebot.com - a community approved tool for its international 2-fund portfolio helper.

In this home page, I will perform various wiki experiments

Experiments
Experimental wiki tricks here

Here is dynamic table of all Ireland domiciled ETFs that target global market indicies.

Global Equity ETFs for non-US

Usage instructions (DRAFT PROPOSAL)
TODO: New proposal and guide incoming

Installation dependencies
This script has no external dependencies (although the code would be much neater if we had access to Handlebars and lodash)

Widget Javascript
Hidden in this section (do view-source, or edit this section to see the source) is the source code for the widget. It should probably be centralised somewhere

function _index(obj,i) {return obj[i]} function lodashGet(obj, path) { return path.split('.').reduce(_index, obj) }

function gen(data) { var Html = mw.html; const {rows, fields, headers} = data; // Mandatory name field at the start const idx = fields.findIndex(x => x === 'name'); if (idx>0) { fields.splice(idx, 1); headers.splice(idx, 1); } headers.unshift('Name'); var ths = headers.map(function(h) {return Html.element('th', {class:'headerSort', tabIndex:'0', role: 'columnheader button', title: 'Sort ascending'}, h);}); var trs = rows.map(function(row) {   var cells = [];    cells.push(Html.element('a', {href:'https://www.boglebot.com/quotesdb/' + row.id, class: 'external text'}, row.name));    fields.forEach(function(path) { cells.push(row[path]) });

var tds = cells.map(function(col){return ' ' + col + ' '}); return ' ' + tds.join('') + ' ' }); var tbody = Html.element('tbody',{}, new Html.Raw(trs.join()));  var thead = ' ' + ths.join() + ' ';  var table = Html.element('table', {class:'dyntable wikitable sortable jquery-tablesorter'}, new Html.Raw(thead + tbody));

return table; }

async function doIt { const functionUrl = 'https://asia-northeast1-gainstrack.cloudfunctions.net/fastQuoteSourceTableQuery'; $('a[href^="https://www.boglebot.com/assetdb?args="]').each(function(index, elem) {   const link = elem.href.replace('https://www.boglebot.com/assetdb', functionUrl);    $.getJSON(link, function(data) { const html = gen(data); $(elem).before(html); $('table', elem).tablesorter; }) });

}

window.addEventListener('load', function { // mw.loader.using( ['jquery.tablesorter'] ).then( function  { setTimeout(function {     console.log('All assets are loaded');      doIt;    },100 ); })

Pages in development
I'm currently working on the following pages, which are under my username. All wiki editors are welcome to contribute.