Some refucktoring.

This commit is contained in:
Alexey Skobkin 2014-11-27 00:24:34 +04:00
parent fbec7b4a2d
commit b4a039843d
2 changed files with 14 additions and 31 deletions

View File

@ -213,14 +213,6 @@ div#markItUpText-input {
-webkit-filter: blur(30px);
}
/* point-plus-debug */
.point-plus-debug{
float: right;
display: block;
color: rgba(255,255,255,.75);
padding: 10px 0px;
}
.post-tag-nsfw.hide-nsfw-posts,
.post-tag-сиськи.hide-nsfw-posts{
display: none;
@ -237,11 +229,10 @@ div#markItUpText-input {
color: green;
}
/* point-plus-debug */
#point-plus-debug{
float: right;
display: block;
color: rgba(255,255,255,.75);
padding: 10px 0px;
}

View File

@ -9,23 +9,15 @@ $(document).ready(function() {
console.info('Point+ %s', getVersion());
// Проверяем, загрузились ли мы
// @todo: Убрать это говно и нормально пилить расширение не принося пользователям костыли
// Хочешь детект? Делай невидимый элемент где-нибудь в подвале. И айдишник, а не класс. Их искать быстрее.
// Хочешь показать пользователю обработку - делай индикатор и встраивай в интерфейс сайта.
var point_plus_debug = $('.point-plus-debug');
if (point_plus_debug.length > 0){
console.info('Point+ already loaded, version: %s', point_plus_debug.attr('data-point-plus-version'));
var point_plus_debug = $('#point-plus-debug');
if (point_plus_debug.length > 0) {
console.error('Point+ %s already loaded.', point_plus_debug.data('point-plus-version'));
return;
}
point_plus_debug = null;
var new_div = document.createElement('div');
$(new_div).attr({
$('<div id="point-plus-debug">').attr({
'data-point-plus-version': getVersion()
}).addClass('point-plus-debug').text('Point+ v' + getVersion() + ' loading...');
var obj = $('#user-menu-cb')[0];
obj.parentElement.insertBefore(new_div, obj);
new_div = null;
obj = null;
}).text('Point+ ' + getVersion() + ' loading...')
.insertBefore('#user-menu-cb');
// Черновики. Ставим хандлер и восстанавливаем предыдущее состояние
draft_set_save_handler();
@ -529,7 +521,7 @@ $(document).ready(function() {
set_space_key_skip_handler();
}
$('.point-plus-debug').fadeOut(500);
$('#point-plus-debug').fadeOut(1000);
});
});