NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name Rusoft Ctool tweak // @namespace help.rusoft.ru/ // @include https://help.rusoft.ru/* // @version 0.2 // @grant none // ==/UserScript== window.readyHandlers = []; window.ready = function ready(handler) { window.readyHandlers.push(handler); handleState(); }; window.handleState = function handleState () { if (['interactive', 'complete'].indexOf(document.readyState) > -1) { while(window.readyHandlers.length > 0) { (window.readyHandlers.shift())(); } } }; document.onreadystatechange = window.handleState; ready(function () { var s = window.location.search.substr(1); if (s == 'page=news' || s.substr(0, s.indexOf('&')) == 'page=dropcalendar') { // форматирование даты создания задачи в Календаре Dropcalendar.prototype.set_tasks=function(_tasks) { $.each(_tasks, function(i, task) { var dateCreate = task.date_create, dateDeadline = task.dead_time; _tasks[i].date_create = dateCreate.replace(/(\d{2})\.(\d{2})\.(\d{2})/, '$3.$2.$1'); if (dateDeadline != 'Добавить') { _tasks[i].dead_time = dateDeadline.replace(/(\d{2})\.(\d{2})\.(\d{2})/, '$3.$2.$1'); } }); this.tasks=Array(); var items=$.extend(true,{},_tasks); //копируем мап (не ссылка) for(i in items) this.tasks[i]=items[i]; $(this).trigger('changed'); //обновляемся } setTimeout(replaceIcons, 1500); } else { // настройки ckeditor var instances = CKEDITOR.instances; for (var i in instances) { instances[i].config.disableNativeSpellChecker = false; instances[i].config.removePlugins = 'ckwebspeech'; instances[i].config.resize_dir = 'both'; } replaceIcons(); } }); // замена иконки задач в статусе Ожидает согласования function replaceIcons() { var imgs = document.querySelectorAll('img[src$="status_r_appraisal_agreed.gif"]'); for (i = 0; i < imgs.length; ++i) { imgs[i].src = '/images/icons/status_r_done.gif'; } }