Blox CMS Desktop / Touch 5 Asset Switcher

Intro

This bookmarklet is for Blox CMS users. It goes in your web browser's Bookmarks Toolbar, or elsewhere in your Bookmarks menu. It lets you quickly switch between the Zen template (desktop) and Touch 5 (mobile) versions of Articles and Collections in Blox CMS.

Example

If you are on this article, it will take you to the Touch 5 version here and vice-versa.

It should also "remember" if you are on an image gallery in the article or the comments section.

How to install

Drag the bookmarklet below onto your browser's Bookmarks Toolbar. It will create a new bookmark there. Then go to an Article or Collection in Blox to test it out!

[Blox BW-T5]

Source

var thisURL = window.location.href;
if (thisURL.indexOf('/article_') != -1 || thisURL.indexOf('/collection_') != -1) {
    if (thisURL.indexOf('?mode=jqm') != -1) {
        if (thisURL.indexOf('mode=jqm_gal') != -1) {
            thisURL = thisURL.replace('_gal', '?mode=image');
            thisURL = thisURL.replace('#&ui-state=dialog', '')
        }
        if (thisURL.indexOf('mode=jqm_com') != -1) {
            thisURL = thisURL.replace('mode=jqm_com', 'mode=jqm#facebook-comments')
        }
        thisURL = thisURL.replace('?mode=jqm', '');
        thisURL = thisURL.replace('://m.', '://www.')
    } else {
        thisURL = thisURL.replace('.html', '.html?mode=jqm');
        thisURL = thisURL.replace('://www.', '://m.');
        thisURL = thisURL.replace('?mode-story', '');
        if (thisURL.indexOf('?mode=image') != -1) {
            thisURL = thisURL.replace('?mode=image', '');
            thisURL = thisURL.replace('mode=jqm', 'mode=jqm_gal')
        }
        if (thisURL.indexOf('#facebook-comments') != -1) {
            thisURL = thisURL.replace('#facebook-comments', '');
            thisURL = thisURL.replace('mode=jqm', 'mode=jqm_com')
        }
    }
    window.location.href = thisURL
} else {
    alert('This bookmarklet works only on Article and Collection assets.')
}

← Home