Skip to content

Instantly share code, notes, and snippets.

@Langerz82
Last active February 9, 2019 04:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Langerz82/5058c46156ac49aa7a4a to your computer and use it in GitHub Desktop.
Save Langerz82/5058c46156ac49aa7a4a to your computer and use it in GitHub Desktop.
Allows the User to have both the mobile and desktop chat in the one page.
// ==UserScript==
// @name ChatForFreeMobileAndDesktop (Langerz)
// @description Allows the User to have both the mobile and desktop chat in the one page.
// You have to enter your Username/Password and select Remember Password for mobile.
// Tested on FireFox 33.1.1.
// Chrome 39.0.2171.65
// If it's broken send me an e-mail: jdoe090910@gmail.com or
// message me on cff Langerz31.
//
// @namespace Langerz.ChatForFree
// @include http://mobile.chatforfree.org/index.php?do=/desktop-chat/
// @require http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js
// @require https://raw.githubusercontent.com/finalclap/iframeTracker-jquery/master/jquery.iframetracker.js
// @version 1.0.3
// @grant none
// ==/UserScript==
var nW = "100%";
var nH = "100%";
var cbl = $("#chatblazerLayer");
cbl.width(nW);
cbl.height(nH);
var cbe8 = $("#cbe8");
cbe8.width(nW);
cbe8.height(nH);
$(window).resize(function () { resizeChat(); });
$(window).load(function () {
var delay=1000;//1 seconds
setTimeout(function(){
loadMobileChat();
resizeChat();
},delay);
});
function loadMobileChat()
{
$("<iframe style=\"width: 1179px;\" id=\"chatI\" src=\"http://mobile.chatforfree.org/chat/chatforfree.html?init_host=mobile.chatforfree.org&amp;init_port=51127&amp;init_host_s=mobile.chatforfree.org&amp;init_port_s=51128&amp;init_host_h=mobile.chatforfree.org&amp;init_port_h=35555&amp;init_loading_bk=http://mobile.chatforfree.org/logo146x40.jpg&amp;init_room=1&amp;init_room=1\" vspale=\"0\" scrolling=\"no\" noresize=\"noresize\" name=\"htmlchat\" marginwidth=\"0\" marginheight=\"0\" framespacing=\"0\" border=\"0\" frameborder=\"0\" height=\"642\" width=\"850\"></iframe>").insertAfter(cbl);
}
function resizeChat() {
var windowW = $(window).width();
var windowH = $(window).height();
var navHdr = $("#header");
var mainpad = $("#main_content_padding");
var adBar = $("#site_content").children('table');
var dChat = $("#cbe8").children('embed');
var mChat = $("#chatI");
var body = $("#nb_body");
dChat.css("float","left");
mChat.css("float","right");
dChat.width((windowW - 34)*2 / 3);
mChat.width((windowW - 34)*1 / 3);
var bodyH = body.outerHeight() - body.height();
chatHeight = windowH - adBar.outerHeight() - bodyH - 38;
dChat.height(chatHeight);
mChat.height(chatHeight);
}
@Langerz82
Copy link
Author

version 1.0.2 - Added delay in loading mobile chat as sometimes does not login properly.
version 1.0.3 - Fixed both chats fit properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment