• Dear Cerberus X User!

    As we prepare to transition the forum ownership from Mike to Phil (TripleHead GmbH), we need your explicit consent to transfer your user data in accordance with our amended Terms and Rules in order to be compliant with data protection laws.

    Important: If you accept the amended Terms and Rules, you agree to the transfer of your user data to the future forum owner!

    Please read the new Terms and Rules below, check the box to agree, and click "Accept" to continue enjoying your Cerberus X Forum experience. The deadline for consent is April 5, 2024.

    Do not accept the amended Terms and Rules if you do not wish your personal data to be transferred to the future forum owner!

    Accepting ensures:

    - Continued access to your account with a short break for the actual transfer.

    - Retention of your data under the same terms.

    Without consent:

    - You don't have further access to your forum user account.

    - Your account and personal data will be deleted after April 5, 2024.

    - Public posts remain, but usernames indicating real identity will be anonymized. If you disagree with a fictitious name you have the option to contact us so we can find a name that is acceptable to you.

    We hope to keep you in our community and see you on the forum soon!

    All the best

    Your Cerberus X Team

A tool for browsing mojolabs.nz (Old monkey forum archive)

Ferdi

Member
3rd Party Target Dev
Joined
Jun 21, 2017
Messages
88
So when I browse mojolabs.nz forum I see these links:

http://monkeycoder.co.nz/Community/posts.php?topic=449

If you click on it, it goes to a 404. So I made a javascript tool that can transform the monkeycoder.co.nz URL to mojolabs.nz URL.

Javascript compress code (one liner):

JavaScript:
javascript:var SelectedText=function(){};SelectedText.prototype.get=function(){var text="";if(window.getSelection){text=window.getSelection().toString()}else if(document.selection&&document.selection.type!="Control"){text=document.selection.createRange().text}return text};SelectedText.prototype.set=function(replacementText){var sel,range;if(window.getSelection){sel=window.getSelection();if(sel.rangeCount){range=sel.getRangeAt(0);range.deleteContents();range.insertNode(document.createTextNode(replacementText))}}else if(document.selection&&document.selection.createRange){range=document.selection.createRange();range.text=replacementText}};try{var sText=new SelectedText();var selectedText=sText.get();var topicNumber=selectedText.split("topic=");if(topicNumber.length=2){var removeAmp=topicNumber[1].split("&");var topicId=removeAmp[0].trim();var topicIdLen=topicId.length;for(var i=0;i<(5-topicIdLen);i++){topicId="0"+topicId}var mojolabsUrl="http://mojolabs.nz/posts.php?topic=2"+topicId;sText.set(mojolabsUrl)}}catch(e){alert(e.message)}

Full Javascript code:

JavaScript:
javascript:var SelectedText = function() {};

SelectedText.prototype.get = function() {
    var text = "";
    if (window.getSelection) {
        text = window.getSelection().toString();
    } else if (document.selection && document.selection.type != "Control") {
        text = document.selection.createRange().text;
    }
    return text;
};

SelectedText.prototype.set = function(replacementText) {
    var sel, range;
    if (window.getSelection) {
        sel = window.getSelection();
        if (sel.rangeCount) {
            range = sel.getRangeAt(0);
            range.deleteContents();
            range.insertNode(document.createTextNode(replacementText));
        }
    } else if (document.selection && document.selection.createRange) {
        range = document.selection.createRange();
        range.text = replacementText;
    }
};

try
{
    var sText = new SelectedText();
    var selectedText = sText.get();
    var topicNumber = selectedText.split("topic=");

    if (topicNumber.length = 2)
    {
        var removeAmp = topicNumber[1].split("&");

        var topicId = removeAmp[0].trim();
        var topicIdLen = topicId.length;
        for (var i = 0; i < (5 - topicIdLen); i++)
        {
            topicId = "0" + topicId;
        }

        var mojolabsUrl = "http://mojolabs.nz/posts.php?topic=2" + topicId;
        sText.set(mojolabsUrl);
    }
}
catch(e)
{
    alert(e.message);
}

To install this tool, just drag and drop the javascript one liner to your bookmark bar. You may want to rename it to something more descriptive.

draganddrop.png

To use it, select the monkeycoder.co.nz URL and press the javascript bookmark.

selectandclickbutton.png

Then select it again, right click and use goto mojolabs.nz...

selectandclickbutton.png

I will update this post with pictures. (DONE!)
 

Attachments

  • gotomojolabs.png
    gotomojolabs.png
    20 KB · Views: 378
Last edited:
Back
Top Bottom