Skip to content
View in the app

A better way to browse. Learn more.

Tip.It Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Forum Blogs - (Grease) Monkeying with Tip.it

(0 reviews)

I've noticed that there are a fair number of bugs with the Tip.it blog's teasers / summaries.

 

In an attempt to correct some of those bugs for myself I wrote the following Greasemonkey userscript.

 

If anyone decides to use this code, leave a comment to let me know how you think it works, or if there is anything else to add.

 

Thanks.

 

 

 

 

// ==UserScript==

// @name Tip.it Blog Fixer

// @namespace Tip.it Blog Fixer

// @description Tip.it Blog Fixer

// @include http://forum.tip.it/blog*

// @include http://forum.tip.it/index.php?app=blog

// @exclude http://forum.tip.it/blog/*/entry*

// @version 1

// ==/UserScript==

 

// a function that loads jQuery and calls a callback function when jQuery has finished loading

function addJQuery(callback) {

var script = document.createElement("script");

script.setAttribute("src", "http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js");

script.addEventListener('load', function() {

var script = document.createElement("script");

script.textContent = "(" + callback.toString() + ")();";

document.body.appendChild(script);

}, false);

document.body.appendChild(script);

}

 

function main() {

 

my_jQuery = $.noConflict(true);

 

// Initialize our jQuery once the page is ready

my_jQuery(document).ready(function($)

{

 

//fix background color

$(".teaser_wrap").addClass("entry");

 

//fix image resizing

forcedWidth = Math.floor($(".teaser_wrap").width() / 2 - 12);

 

//first we remove the automated resizer info

$("div.resized_img").find("span").remove();

$(".bbc_img.resized").each(function(){

$(this).removeClass("resized");

$(this).removeAttr("handled")

.removeAttr("newheight")

.removeAttr("newwidth")

.removeAttr("origheight")

.removeAttr("shrunk")

.removeAttr("origwidth")

.removeAttr("style")

.removeAttr("height")

.removeAttr("width")

$(this).css("border","0px");

$(this).unwrap();

});

 

$(".bbc_img").each(function(){

var img = $(this).get(0);

var width = img.clientWidth;

var height = img.clientHeight;

 

if(width > forcedWidth){

var ratio = forcedWidth / width;

var newHeight = height * ratio;

$(this).width(forcedWidth);

$(this).height(newHeight);

}

});

 

 

//Fix broken BBCodes (currently just removes)

$(".entry_content").each(function(){

$(this).html(function(){

var output = $(this).html()

output = output.replace("

","");

output = output.replace("","");

output = output.replace("","");

output = output.replace("","");

output = output.replace("

","");

output = output.replace(/\*\d['"\+]*\]/g, "");

return output;

});

});

});

 

}

 

// load jQuery and execute the main function

addJQuery(main);

 

 

0 Comments

Recommended Comments

There are no comments to display.

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.