Discussions

Expand all | Collapse all

New Feature: Custom Frontalot Bar!

  • 1.  New Feature: Custom Frontalot Bar!

    Top
    Contributor
    Posted 01-31-2018 00:06
    New Feature: Custom Frontalot Bar!



    Hey QuickBasers - if you are like me you like to listen to nerdcore artist MC Frontalot while working with QuickBase. I decided I liked MC Frontalot so much I wanted to put a custom Frontalot bar atop my QuickBase applications. that will allow me to bring up various MC Frontalot sites while working in QuickBase. 

    Just click that green button labeled "reg.html" and all the pages under the path to Table #1 will sport a niffty Frontalot bar

    My Frontalot Bar
    https://haversineconsulting.quickbase.com/db/bnfetra9x

    You can create your very own Frontalot Bar using this simple Service Worker (just modify the markup variable to customize):

    self.addEventListener("install", event => {
      event.waitUntil(self.skipWaiting());
    });

    self.addEventListener("activate", event => {
      event.waitUntil(self.clients.claim());
    });

    self.addEventListener("fetch", event => {
      if (event.request.mode === "navigate") {
        event.respondWith(
          fetch(event.request).then(response => {
            return response.text().then(body => {
          
              var markup = "";
              markup += '<ul class="MenuBar">';
              markup += '<li><a href="https://frontalot.com/"; target="_blank">MC Frontalot Home</a></li>';
              markup += '<li><a href="https://en.wikipedia.org/wiki/MC_Frontalot"; target="_blank">Wiki MC Frontalot</a></li>';
              markup += '<li><a href="https://twitter.com/mc_frontalotmarkup"; target="_blank">Twiter MC Frontalot</a></li>';
              markup += '<li><a href="https://www.youtube.com/watch?v=fffQjrTCkLI&list=PL8DA214F9587E7F7D"; target="_blank">Youtube MC Frontalot</a></li>'; 
              markup  += '</ul>';

              var respModified = body.replace('<div id="navBars"', markup + '<div id="navBars"');
              return new Response(respModified, {headers: response.headers});
            });
          })
        );
      }
    });

    BTW here is my favorite MC Frontalot song:

    Indier Than Thou by MC Frontalot:


  • 2.  RE: New Feature: Custom Frontalot Bar!

    Silver
    Contributor
    Posted 01-31-2018 07:19
    Hi Dan,

    I just have a look there. But, could not see Frontalot Bar after registered.

    Thanks,

    Gaurav


  • 3.  RE: New Feature: Custom Frontalot Bar!

    Top
    Contributor
    Posted 01-31-2018 07:31
    I just signed out and it worked from me in Chrome.


  • 4.  RE: New Feature: Custom Frontalot Bar!

    Top
    Contributor
    Posted 01-31-2018 07:44
    Try it again. Apparently during the last step of the cleanup I renamed the service worker sw1.html instead of sw1.js. It should work now.


  • 5.  RE: New Feature: Custom Frontalot Bar!

    Silver
    Contributor
    Posted 01-31-2018 07:49
    Yes. Now, I can see it and it's amazing.

    ">https://d2r1vs3d9006ap.cloudfront.net/s3_images/1698550/RackMultipart20180131-90873-1mzfswz-image_inline.png?1517384968">

    Thanks,

    Gaurav


  • 6.  RE: New Feature: Custom Frontalot Bar!

    Top
    Contributor
    Posted 01-31-2018 08:03
    There is nothing these babies can't do! Back to watching cartoons ...