📜 ⬆️ ⬇️

Increasing the editing window in Bitrix using JS and Greasemonkey

In the process of working on a new site on Bitrix terribly furious about the size of the window HTML-editor and property editor. Tired of stretching by hand, so I wrote a small script for Greasemonkey.
http://elfrey.ru/bitrix_admin_expand_user.js

Those who do not install Greasemonkey (like me) can insert into the browser
javascript: void(document.getElementById('filesrc_object').style.height='1000px'); void(parentTd = document.getElementById('filesrc_taskBarSet3').getElementsByTagName('table')[0].style.height = '500px')


Just in case, the script code:
// ==UserScript==
// @name Bitrix Admin Expand
// @namespace Elfrey
// @description Expand bitix HTML and Property editor
// @include */bitrix/admin/*
// ==/UserScript==
function domReady( f ) {
if ( domReady.done ) return f();

if ( domReady.timer ) {
domReady.ready.push( f );
} else {
if (window.addEventListener)
window.addEventListener( 'load' ,isDOMReady, false );
else if (window.attachEvent)
window.attachEvent( 'onload' ,isDOMReady);

domReady.ready = [ f ];
domReady.timer = setInterval( isDOMReady, 13 );
}
}

function isDOMReady(){
if ( domReady.done ) return false ;

if ( document && document .getElementsByTagName && document .getElementById && document .body ) {
clearInterval( domReady.timer );
domReady.timer = null ;

for ( var i = 0; i < domReady.ready.length; i++ )
domReady.ready[i]();

domReady.ready = null ;
domReady.done = true ;
}
}

function expand()
{
if ( document .getElementById( 'filesrc_object' ))
{
document .getElementById( 'filesrc_object' ).style.height= '1000px' ;
}

if ( document .getElementById( 'filesrc_taskBarSet3' ))
{
parentTd = document .getElementById( 'filesrc_taskBarSet3' );
tableToChange = parentTd.getElementsByTagName( 'table' );
if (tableToChange[0])
{
tableToChange[0].style.height = '500px' ;
}
}
}

domReady( function (){setTimeout( function (){expand()},2000)});


* This source code was highlighted with Source Code Highlighter .
// ==UserScript==
// @name Bitrix Admin Expand
// @namespace Elfrey
// @description Expand bitix HTML and Property editor
// @include */bitrix/admin/*
// ==/UserScript==
function domReady( f ) {
if ( domReady.done ) return f();

if ( domReady.timer ) {
domReady.ready.push( f );
} else {
if (window.addEventListener)
window.addEventListener( 'load' ,isDOMReady, false );
else if (window.attachEvent)
window.attachEvent( 'onload' ,isDOMReady);

domReady.ready = [ f ];
domReady.timer = setInterval( isDOMReady, 13 );
}
}

function isDOMReady(){
if ( domReady.done ) return false ;

if ( document && document .getElementsByTagName && document .getElementById && document .body ) {
clearInterval( domReady.timer );
domReady.timer = null ;

for ( var i = 0; i < domReady.ready.length; i++ )
domReady.ready[i]();

domReady.ready = null ;
domReady.done = true ;
}
}

function expand()
{
if ( document .getElementById( 'filesrc_object' ))
{
document .getElementById( 'filesrc_object' ).style.height= '1000px' ;
}

if ( document .getElementById( 'filesrc_taskBarSet3' ))
{
parentTd = document .getElementById( 'filesrc_taskBarSet3' );
tableToChange = parentTd.getElementsByTagName( 'table' );
if (tableToChange[0])
{
tableToChange[0].style.height = '500px' ;
}
}
}

domReady( function (){setTimeout( function (){expand()},2000)});


* This source code was highlighted with Source Code Highlighter .
// ==UserScript==
// @name Bitrix Admin Expand
// @namespace Elfrey
// @description Expand bitix HTML and Property editor
// @include */bitrix/admin/*
// ==/UserScript==
function domReady( f ) {
if ( domReady.done ) return f();

if ( domReady.timer ) {
domReady.ready.push( f );
} else {
if (window.addEventListener)
window.addEventListener( 'load' ,isDOMReady, false );
else if (window.attachEvent)
window.attachEvent( 'onload' ,isDOMReady);

domReady.ready = [ f ];
domReady.timer = setInterval( isDOMReady, 13 );
}
}

function isDOMReady(){
if ( domReady.done ) return false ;

if ( document && document .getElementsByTagName && document .getElementById && document .body ) {
clearInterval( domReady.timer );
domReady.timer = null ;

for ( var i = 0; i < domReady.ready.length; i++ )
domReady.ready[i]();

domReady.ready = null ;
domReady.done = true ;
}
}

function expand()
{
if ( document .getElementById( 'filesrc_object' ))
{
document .getElementById( 'filesrc_object' ).style.height= '1000px' ;
}

if ( document .getElementById( 'filesrc_taskBarSet3' ))
{
parentTd = document .getElementById( 'filesrc_taskBarSet3' );
tableToChange = parentTd.getElementsByTagName( 'table' );
if (tableToChange[0])
{
tableToChange[0].style.height = '500px' ;
}
}
}

domReady( function (){setTimeout( function (){expand()},2000)});


* This source code was highlighted with Source Code Highlighter .


')
There is a delay in the script, because in JS I am not very strong, and I don’t know how to execute the function after loading the editing window.

It was checked only in 1C-Bitrix: Site Manager 8.0.6

Source: https://habr.com/ru/post/67664/


All Articles