User:Glorat: Difference between revisions

From Bogleheads
No edit summary
(Migrate instructions to dedicated page)
 
(18 intermediate revisions by 2 users not shown)
Line 2: Line 2:
I am the author of https://www.boglebot.com - a community approved tool for its international 2-fund portfolio helper.
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
In this home page, I am performing various wiki experiments


==Experiments==
==Boglebot Wikitable Proposal==
Experimental wiki tricks here
For more information and instructions on how the below tables are created and rendered, please see [[User:Glorat/BoglebotTable]]


Note that this dynamic feature does not work under IE11 (although it would be simply but ugly to support IE11 if needed)
==Boglebot Wikitable Demo==
Here is dynamic table of all Ireland domiciled ETFs that target global market indicies.


<div class="boglebottable" tag="query one info">Loading...</div>
[https://www.boglebot.com/assetdb?args=%7B%22query%22%3A%5B%7B%22where%22%3A%5B%22asset.type%22,%22%3D%3D%22,%22ETF%22%5D%7D,%7B%22where%22%3A%5B%22asset.domicile%22,%22%3D%3D%22,%22Ireland%22%5D%7D,%7B%22where%22%3A%5B%22asset.geography%22,%22%3D%3D%22,%22Global%22%5D%7D,%7B%22where%22%3A%5B%22asset.assetClass%22,%22%3D%3D%22,%22Equity%22%5D%7D%5D,%22fields%22%3A%5B%22ticker%22,%22name%22,%22ccy%22,%22asset.incomeTreatment%22,%22asset.ter%22%5D%7D Global Equity ETFs for non-US]


<div class="boglebottable" tag="query two info">Loading...</div>
<ref group="note">The link is URL encoded. The decoded link is: <pre>https://www.boglebot.com/assetdb?args={"query":[{"where":["asset.type","==","ETF"]},{"where":["asset.domicile","==","Ireland"]},{"where":["asset.geography","==","Global"]},{"where":["asset.assetClass","==","Equity"]}],"fields":["ticker","name","ccy","asset.incomeTreatment","asset.ter"]}</pre> Useful references: [https://www.urldecoder.org/ URL Decode and Encode - Online] and [https://www.urlencoder.org/ URL Encode and Decode - Online]</ref>


==Javascript in mediawiki==
==Widget Javascript==
The use of < html > tags in wikis is not recommended for security unless all wiki editors are trusted. If approved, the embedded code inside this section should migrate to MediaWiki:Common.js
This section simply includes the include to [[User:Glorat/BoglebotTable]], which enables the feature
<html>
{{ User:Glorat/BoglebotTable }}
<script src="https://cdn.jsdelivr.net/npm/handlebars@latest/dist/handlebars.js"></script>
<script>
const template = `<table id="myTable" class="dyntable wikitable sortable jquery-tablesorter">
<thead><tr>
<th class="headerSort" tabindex="0" role="columnheader button" title="Sort ascending">Name</th>
<th class="headerSort" tabindex="0" role="columnheader button" title="Sort ascending">Type</th>
<th class="headerSort" tabindex="0" role="columnheader button" title="Sort ascending">Ticker
</th></tr></thead><tbody>
{{#each rows}}
<tr>
<td><a href="https://www.boglebot.com/quotesdb/{{this.id}}">{{this.name}}</a></td>
<td>{{this.asset.type}}</td>
<td>{{this.ticker}}</td>
</tr>
{{/each}}
</tbody><tfoot></tfoot></table>`;
 
async function doIt() {
  // compile the template
  var gen = Handlebars.compile(template);
  const url = 'https://asia-northeast1-gainstrack.cloudfunctions.net/fastQuoteSources';
 
  $('.boglebottable').each(function(index, elem) {
    const params = {}; // TODO: extract query from the "tag" element of the div so we can pass to the query
    const res = $.getJSON(url, params, function(res) {
      const html = gen(res);
      $(elem).html(html);
      $(elem).tablesorter();
    });
 
  });
 
}
 
window.addEventListener('load', function() {
  // mw.loader.using( ['jquery.tablesorter'] ).then( function () {
  setTimeout(function() {
      console.log('All assets are loaded');
      doIt();
    },100 );
})
</script>
</html>


==Pages in development==
==Pages in development==
Line 64: Line 22:


{{Special:PrefixIndex/{{FULLPAGENAME}}/ |hideredirects=1}}
{{Special:PrefixIndex/{{FULLPAGENAME}}/ |hideredirects=1}}
==Notes==
<references group="note" />

Latest revision as of 14:49, 11 January 2021

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 am performing various wiki experiments

Boglebot Wikitable Proposal

For more information and instructions on how the below tables are created and rendered, please see User:Glorat/BoglebotTable

Boglebot Wikitable Demo

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

Global Equity ETFs for non-US

[note 1]

Widget Javascript

This section simply includes the include to User:Glorat/BoglebotTable, which enables the feature

Pages in development

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

Notes

  1. The link is URL encoded. The decoded link is:
    https://www.boglebot.com/assetdb?args={"query":[{"where":["asset.type","==","ETF"]},{"where":["asset.domicile","==","Ireland"]},{"where":["asset.geography","==","Global"]},{"where":["asset.assetClass","==","Equity"]}],"fields":["ticker","name","ccy","asset.incomeTreatment","asset.ter"]}
    Useful references: URL Decode and Encode - Online and URL Encode and Decode - Online