General Category > General

Easier Featuring for Editors

Cyan:
See my other tampermonkey scripts and how to install them here: http://forums.sploder.com/index.php/topic,341981.0.html

Here is the Jquery script for editors to run on their browser that makes featuring much simpler than before:

--- Code: ---// ==UserScript==
// @name         Cyan's Sploder Addons - [Easier Featuring]
// @require      http://code.jquery.com/jquery-3.3.1.min.js
// @namespace    http://tampermonkey.net/
// @version      0.1.1 - 01/Apr/2019
// @author       Cyan
// @match        http://www.sploder.com/games/*
// ==/UserScript==

if (window.location.href.indexOf(".com/games/members/") > -1) {
    localStorage.CEF_Feature = -1;
    $('body').append('<iframe onload="frameLoaded();" id="adminPage" frameBorder="0" width="0" height="0" src="http://www.sploder.com/games/admin/0/"></iframe>');
    $('div.sharebar').after('<input onclick="localStorage.CEF_Feature=1;setTimeout(function(){location.reload();},150);" type=button value=" Feature this game " style="margin-right:10px"></input> • <input onclick="localStorage.CEF_Feature=0;setTimeout(function(){location.reload();},150);" type=button value=" Unfeature this game " style="margin-left:10px"></input><br><br>');
    localStorage.CEF_gameId = $('param[name=flashvars]').val().split("=")[1];
    localStorage.CEF_gameName = $('div#content > h3:first').text();
    localStorage.CEF_gameUser = $('div#content > h4:first > a').text();
}

if (window.location.href.indexOf(".com/games/admin/") > -1) {
    if (localStorage.CEF_gameId != 0) {
        $('body').find('input[type=checkbox]:first').attr("checked","checked");
        $('body').find('input[name*=game_]:first').attr("name","game_"+localStorage.CEF_gameId);
        $('body').find('input[name*=game_score_]:first').attr("name","game_score_"+localStorage.CEF_gameId);
        $('body').find('input[name*=game_name_]:first').attr("name","game_name_"+localStorage.CEF_gameId).attr("value",localStorage.CEF_gameName);
        $('body').find('input[name*=game_author_]:first').attr("name","game_author_"+localStorage.CEF_gameId).attr("value",localStorage.CEF_gameUser);
        $('body').find('input[name*=game_oldfeatured_]:first').attr("name","game_oldfeatured_"+localStorage.CEF_gameId);
        $('body').find('input[name*=game_oldscore_]:first').attr("name","game_oldscore_"+localStorage.CEF_gameId);
        $('body').find('input[type=checkbox]:first').attr("name","game_"+localStorage.CEF_gameId);
    }
    window.setInterval(function(){
        if(localStorage.CEF_Feature==1){
            $('body').find('input[name*=game_oldfeatured_]:first').attr("value",0);
            $('body').find('input[name*=game_score_]:first').attr("value",1);
            $('input[value*=Feature]').click();
        }
        if(localStorage.CEF_Feature==0){
            $('body').find('input[name*=game_oldfeatured_]:first').attr("value",1);
            $('body').find('input[name*=game_score_]:first').attr("value",0);
            $('input[value*=Feature]').click();
        }
    }, 100);
    localStorage.CEF_gameId = 0;
    localStorage.CEF_gameName = 0;
    localStorage.CEF_gameUser = 0;
    localStorage.CEF_Feature = -1;
}
--- End code ---

Here's what the script does:

seanthechinaman:
What would we do without you?

CG:
Why use me getting killed as an example  >:D

lordeldar:

--- Quote from: CG on April 01, 2019, 12:12 pm ---Why use me getting killed as an example  >:D

--- End quote ---
:))

Cyan:
fixed bug where sometimes the game wouldn't get featured

Navigation

[0] Message Index

There was an error while thanking
Thanking...
Go to full version