Window floating container

Adds a fixed header element for use by other scripts

La data de 28-11-2016. Vezi ultima versiune.

Acest script nu ar trebui instalat direct. Aceasta este o bibliotecă pentru alte scripturi care este inclusă prin directiva meta a // @require https://update.greasyfork.org/scripts/18233/160309/Window%20floating%20container.js

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Window floating container 
// @version      1.0.0
// @description  Adds a fixed header element for use by other scripts
// @author       @_jnblog
// @require      https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js
// @grant        GM_addStyle
// ==/UserScript==
/* jshint -W097 */
/* global $ */
/* jshint asi: true, multistr: true */
'use strict'

var ijgFloater = $('#ijgWindowFloater')
if (!ijgFloater.length) {
  GM_addStyle('#ijgWindowFloater {\
    position: fixed;\
    top: 0;\
    left: 0;\
    z-index: 2000;\
    color: white;\
    background-color: #EB6841;\
  }\
  #ijgWindowFloater a {\
    color: white !important;\
    padding: 5px;\
    display: inline-block;\
  }\
  #ijgWindowFloater a:hover {\
    color: #FAF667 !important;\
  }\
  .ijgWindowFloater-item + .ijgWindowFloater-item {\
    padding-left: 1em;\
  }\
  .ijgWindowFloater-toggle {\
    padding: 0;\
    top: -1px;\
    left: -22px;\
    box-shadow: inset 0 0 0 32px;\
    -webkit-transform-origin: right;\
    -ms-transform-origin: right;\
    transform-origin: right;\
    transform: rotate(180deg);\
    display: inline-block;\
    vertical-align: middle;\
    position: relative;\
    font-style: normal;\
    color: transparent;\
    text-align: left;\
    text-indent: -9999px;\
    direction: ltr;\
    box-sizing: border-box;\
    border: 2px solid white;\
    transition: all .2s;\
    border-radius: 50%;\
    width: 24px;\
    height: 24px;\
    margin: 2px;\
    background-color: transparent;\
  }\
  .ijgWindowFloater-toggle:before {\
    content: "";\
    width: 14px;\
    height: 2px;\
    position: absolute;\
    bottom: 0;\
    margin: auto 0;\
    right: 2px;\
    box-shadow: inset 0 0 0 32px;\
    -webkit-transform-origin: right;\
    -ms-transform-origin: right;\
    transform-origin: right;\
    top: 2px;\
    -webkit-transform: rotate(45deg);\
    -ms-transform: rotate(45deg);\
    transform: rotate(45deg);\
    width: 11px;\
    right: 8px;\
    color: white;\
  }\
  .ijgWindowFloater-toggle:after {\
    height: 2px;\
    position: absolute;\
    bottom: 0;\
    margin: auto 0;\
    box-shadow: inset 0 0 0 32px;\
    -webkit-transform-origin: right;\
    -ms-transform-origin: right;\
    transform-origin: right;\
    content: "";\
    top: 0;\
    -webkit-transform: rotate(-45deg);\
    -ms-transform: rotate(-45deg);\
    transform: rotate(-45deg);\
    pointer-events: none;\
    width: 11px;\
    right: 8px;\
    color: white;\
  }')
  
  ijgFloater = $('<div id="ijgWindowFloater"><i class="ijgWindowFloater-toggle"></i></div>')
  $('body').prepend(ijgFloater)
}

function getFloater() {
  return ijgFloater
}