// ==UserScript== // @name InstaSynchP Layouts // @namespace InstaSynchP // @description Larger layouts and fullscreen mode // @version 1.1.2 // @author Zod- // @source https://github.com/Zod-/InstaSynchP-Layouts // @license MIT // @include http://*.instasynch.com/* // @include http://instasynch.com/* // @include http://*.instasync.com/* // @include http://instasync.com/* // @grant none // @run-at document-start // @require https://greasyfork.org/scripts/5647-instasynchp-library/code/InstaSynchP%20Library.js // @downloadURL none // ==/UserScript== function Layouts(version) { "use strict"; this.version = version; this.name = 'InstaSynchP Layouts'; this.userFullscreenToggle = false; this.settings = [{ 'label': 'Layout', 'id': 'Layout', 'type': 'select', 'options': ['normal', 'large', 'huge'], 'default': 'normal', 'section': ['General'] }, { 'label': 'Make chat visible on message', 'id': 'make-chat-visible', 'type': 'checkbox', 'default': true, 'section': ['General', 'Fullscreen'] }, { 'label': 'On Chat Message Opacity', 'id': 'chat-message-opacity', 'type': 'int', 'title': '0-100', 'min': 0, 'max': 100, 'default': 100, 'size': 1, 'section': ['General', 'Fullscreen'] }, { 'label': 'Chat Opacity', 'id': 'chat-opacity', 'type': 'int', 'title': '0-100', 'min': 0, 'max': 100, 'default': 30, 'size': 1, 'section': ['General', 'Fullscreen'] }, { 'label': 'Playlist Opacity', 'id': 'playlist-opacity', 'type': 'int', 'title': '0-100', 'min': 0, 'max': 100, 'default': 30, 'size': 1, 'section': ['General', 'Fullscreen'] }, { 'label': 'Poll Opacity', 'id': 'poll-opacity', 'type': 'int', 'title': '0-100', 'min': 0, 'max': 100, 'default': 30, 'size': 1, 'section': ['General', 'Fullscreen'] }, { 'label': 'Font color', 'id': 'fullscreen-font-color', 'type': 'text', 'default': '#FFFF00', 'size': 5, 'section': ['General', 'Fullscreen'] }, { 'label': 'Outline color', 'id': 'fullscreen-outline-color', 'type': 'text', 'default': '#000000', 'size': 5, 'section': ['General', 'Fullscreen'] }]; } Layouts.prototype.addLayoutsOnce = function () { "use strict"; var th = this, i, layouts = [{ 'name': 'normalLayout', 'url': '' }, { 'name': 'largeLayout', 'url': 'https://cdn.rawgit.com/Zod-/InstaSynchP-Layouts/7d144b7ae7a5e0ad168f182c88b9312c8fb2beda/largeLayout.css' }, { 'name': 'hugeLayout', 'url': 'https://cdn.rawgit.com/Zod-/InstaSynchP-Layouts/b1e8f187eecce9ea4d552b97f76e8161ecfb3544/hugeLayout.css' }, { 'name': 'fullscreenLayout', 'url': 'https://cdn.rawgit.com/Zod-/InstaSynchP-Layouts/a8a55d6b839ab0b16eb38008b21b01c53d71cede/fullscreenLayout.css' }]; for (i = 0; i < layouts.length; i += 1) { layouts[i].id = 'layout'; cssLoader.add(layouts[i]); } //style for the footer controls cssLoader.add({ 'name': 'layouts', 'url': 'https://cdn.rawgit.com/Zod-/InstaSynchP-Layouts/e2cb8b52f4dc76811c51c3121dbdd35d1de5b7d9/layouts.css', 'autoload': true }); events.on(th, 'SettingChange[Layout]', th.changeLayout); //reinitialise once the css has been loaded to fix the size events.on(th, 'CSSLoad[layout]', function () { $("#videos").data("jsp").reinitialise(); }); }; Layouts.prototype.setUpFullscreenOnce = function () { "use strict"; var th = this, chatVisibleTimer; //make poll visible in fullscreen when it is hidden events.on(th, 'CreatePoll', function () { $('.poll-container').removeClass('poll-container2'); $('#hide-poll').removeClass('hide-poll2'); }); $('head').append( $('