Compare commits

..

No commits in common. "master" and "1.35.1" have entirely different histories.

38 changed files with 1486 additions and 2196 deletions

4
.gitignore vendored
View File

@ -1,7 +1,5 @@
chrome_point_plus/vendor/
/nbproject/
/nbproject/private/
node_modules/
npm-debug.log
publish
vendor/
/.idea/

View File

@ -1,119 +0,0 @@
{
"disallowImplicitTypeConversion": [ "numeric", "boolean", "binary" ],
"disallowKeywordsOnNewLine": [ "else" ],
"disallowMixedSpacesAndTabs": true,
"disallowMultipleLineBreaks": true,
"disallowMultipleLineStrings": true,
"disallowNewlineBeforeBlockStatements": true,
"disallowOperatorBeforeLineBreak": [ "+", "-", "*", "/", "." ],
"disallowPaddingNewlinesInBlocks": true,
"disallowQuotedKeysInObjects": "allButReserved",
"disallowSpaceAfterObjectKeys": true,
"disallowSpaceAfterPrefixUnaryOperators": [ "++", "--", "+", "-" ],
"disallowSpaceBeforePostfixUnaryOperators": true,
"disallowSpacesInCallExpression": true,
"disallowSpacesInFunctionExpression": {
"beforeOpeningRoundBrace": true
},
"disallowSpacesInNamedFunctionExpression": {
"beforeOpeningRoundBrace": true
},
"disallowSpacesInsideParentheses": true,
"disallowTrailingComma": true,
"disallowTrailingWhitespace": true,
"disallowYodaConditions": true,
"requireBlocksOnNewline": true,
"requireCapitalizedConstructors": true,
"requireCommaBeforeLineBreak": true,
"requireCurlyBraces": [
"if",
"else",
"for",
"while",
"do",
"try",
"catch"
],
"requireDotNotation": true,
"requireLineBreakAfterVariableAssignment": true,
"requireLineFeedAtFileEnd": true,
"requirePaddingNewlinesBeforeKeywords": [
"do",
"for",
"if",
"switch",
"try",
"void",
"while",
"with",
"return"
],
"requireSpaceAfterBinaryOperators": true,
"requireSpaceAfterKeywords": [
"do",
"for",
"if",
"else",
"switch",
"case",
"try",
"catch",
"void",
"while",
"with",
"return",
"typeof"
],
"requireSpaceAfterLineComment": {
"allExcept": [ "#", "=" ]
},
"requireSpaceAfterPrefixUnaryOperators": [ "~", "!" ],
"requireSpaceBeforeBinaryOperators": [
"=",
"+",
"-",
"/",
"*",
"==",
"===",
"!=",
"!=="
],
"requireSpaceBeforeBlockStatements": true,
"requireSpaceBeforeKeywords": [
"else",
"while",
"catch"
],
"requireSpaceBeforeObjectValues": true,
"requireSpaceBetweenArguments": true,
"requireSpacesInAnonymousFunctionExpression": {
"beforeOpeningCurlyBrace": true
},
"requireSpacesInForStatement": true,
"requireSpacesInFunctionDeclaration": {
"beforeOpeningCurlyBrace": true
},
"requireSpacesInFunctionExpression": {
"beforeOpeningCurlyBrace": true
},
"requireSpacesInNamedFunctionExpression": {
"beforeOpeningCurlyBrace": true
},
"requireSpacesInsideObjectBrackets": "allButNested",
"validateIndentation": 4,
"validateLineBreaks": "LF",
"validateParameterSeparator": ", ",
"excludeFiles": [
"chrome_point_plus/js/bquery_ajax.js",
"chrome_point_plus/js/markitup/sets/markdown/set.js",
"chrome_point_plus/js/point-plus.js",
"chrome_point_plus/vendor/**",
"nbproject/**",
"node_modules/**",
"publish/**",
"vendor/**"
]
}

View File

@ -1,9 +0,0 @@
.git/**
chrome_point_plus/js/bquery_ajax.js
chrome_point_plus/js/markitup/sets/markdown/set.js
chrome_point_plus/js/point-plus.js
chrome_point_plus/vendor/**
nbproject/**
node_modules/**
publish/**
vendor/**

View File

@ -1,26 +0,0 @@
{
"bitwise": true,
"camelcase": false,
"curly": true,
"eqeqeq": true,
"es3": false,
"forin": true,
"freeze": true,
"latedef": true,
"maxlen": 120,
"maxparams": 4,
"newcap": true,
"noarg": true,
"noempty": true,
"nonbsp": true,
"quotmark": "single",
"shadow": "inner",
"undef": true,
"unused": true,
"browser": true,
"jquery": true,
"globals": {
"chrome": true,
"console": true
}
}

View File

@ -1,5 +1,5 @@
var vendorCopy = [
'jquery/dist/jquery.min.js',
'jquery/jquery.min.js',
'fancybox/source/jquery.fancybox.pack.js',
'fancybox/source/helpers/jquery.fancybox-media.js',
@ -18,15 +18,12 @@ var vendorCopy = [
vendorCopy.push({
expand: true,
src: [
'vendor/fancybox/source/*.png',
'vendor/fancybox/source/*.gif'
],
src: [ 'vendor/fancybox/source/*.png' ],
dest: 'chrome_point_plus/'
});
/* global module */
module.exports = function(grunt) {
// Настройки
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
@ -49,7 +46,7 @@ module.exports = function(grunt) {
gitDescribeOptions: '--tags --always --abbrev=1 --dirty=-d',
globalReplace: true
}
}
},
});
// Загрузить плагины

View File

@ -1,63 +1,30 @@
# README #
Коротенькое пояснение what the fuck is going on.
### Что это за репозиторий? ###
В данном репозитории располагаются исходные коды расширения Point+, которое предназначено для расширения функциональности сайта [Point.im](https://point.im/).
### Как заставить его работать? ###
Есть несколько вариантов. Выбирайте на свой вкус:
* Установить расширение из [репозитория Opera addons](https://addons.opera.com/en/extensions/details/point/?display=en)
* Установить расширение из [репозитория Google Chrome Extensions](https://chrome.google.com/webstore/detail/point%2B/ghaddonhnchkdjaciggjijhophciboam?hl=ru)
* Установить расширение из [раздела Downloads на Bitbucket](https://bitbucket.org/skobkin/chrome_point_plus/downloads) (*.nex - Opera, *.crx - Chrome)
* Собрать самостоятельно из исходников ([Chrome](https://developer.chrome.com/extensions/packaging), [Opera](https://dev.opera.com/extensions/tut_basics.html))
### Как настраивать? ###
В адресной строке (омнибокс) появится иконка Point.im. Если на нёё нажать - появится окошко настроек.
![Настройки расширения](https://storage4.static.itmages.ru/i/15/0107/h_1420652338_6632200_307d80b672.png "Окно настроек расширения")
### Хочу помочь, ШТОДЕЛОЦ? ###
* Писать мне [в поинте](https://skobkin-ru.point.im/) или [куда-нибудь ещё](https://skobk.in/contacts/)
* Сразу присылать пулл-реквесты с шашкой наголо
* Поставить в магазинах Opera и Chrome оценку расширению
* Задонатить (см. таб Feedback в настройках)
### Как собрать из исходников
Для сборки используется Node.js. Ещё нужно глобально установить npm-пакет grunt-cli (`npm i -g grunt-cli`).
Все команды ниже нужно выполнять в корне проекта.
Установить npm и bower зависимости и разложить библиотеки по местам:
```
npm install
```
Если у вас нет Node.js, то вы можете посмотреть используемые библиотеки в файле `bower.json` и положить их
в `chrome_point_plus/vendor`.
Проверить кодстайл:
```
npm run lint
```
Поднять версию ([примеры](https://github.com/vojtajina/grunt-bump/blob/master/README.md#usage-examples)):
```
grunt bump
```
Запустить сборку расширения браузером:
```
/bin/bash pack_chromium.sh /usr/bin/chromium /path/to/repository/chrome_point_plus /path/to/private/key.pem
```
# README #
Коротенькое пояснение what the fuck is going on.
### Что это за репозиторий? ###
В данном репозитории располагаются исходные коды расширения Point+, которое предназначено для расширения функциональности сайта [Point.im](https://point.im/).
### Как заставить его работать? ###
Есть несколько вариантов. Выбирайте на свой вкус:
* Установить расширение из [репозитория Opera addons](https://addons.opera.com/en/extensions/details/point/?display=en)
* Установить расширение из [репозитория Google Chrome Extensions](https://chrome.google.com/webstore/detail/point%2B/ghaddonhnchkdjaciggjijhophciboam?hl=ru)
* Установить расширение из [раздела Downloads на Bitbucket](https://bitbucket.org/skobkin/chrome_point_plus/downloads) (*.nex - Opera, *.crx - Chrome)
* Собрать самостоятельно из исходников ([Chrome](https://developer.chrome.com/extensions/packaging), [Opera](https://dev.opera.com/extensions/tut_basics.html))
### Как настраивать? ###
В адресной строке (омнибокс) появится иконка Point.im. Если на нёё нажать - появится окошко настроек.
![Настройки расширения](https://storage4.static.itmages.ru/i/15/0107/h_1420652338_6632200_307d80b672.png "Окно настроек расширения")
### Хочу помочь, ШТОДЕЛОЦ? ###
* Писать мне [в поинте](https://skobkin-ru.point.im/) или [куда-нибудь ещё](https://skobk.in/contacts/)
* Сразу присылать пулл-реквесты с шашкой наголо
* Поставить в магазинах Opera и Chrome оценку расширению
* Задонатить (см. таб Feedback в настройках)

View File

@ -1,6 +1,6 @@
{
"name": "chrome-point-plus",
"version": "1.42.1",
"version": "1.35.1",
"authors": [
"Alexey Skobkin"
],
@ -14,7 +14,7 @@
"chrome_point_plus/vendors/**"
],
"dependencies": {
"jquery": "~3",
"jquery": "~1.10.1",
"fancybox": "~2.1.5",
"markitup": "~1.1.14",
"soundcloud": "git@github.com:soundcloud/Widget-JS-API.git"

View File

@ -6,13 +6,10 @@
"message": "Alexey Skobkin"
},
"ext_page_action_title": {
"message": "Settings"
},
"options_page_title": {
"message": "Point+ settings"
},
"options_text_saved": {
"message": "Reload page to apply changes."
},
@ -50,6 +47,9 @@
"option_fancybox_bind_images_to_one_flow": {
"message": "Bind all images to one Fancybox gallery"
},
"option_fancybox_smart_hints": {
"message": "Generate image caption from tags"
},
"option_images_load_original": {
"message": "Load original images instead of thumbnails"
},
@ -57,13 +57,13 @@
"message": "Enable embedding ▼"
},
"option_images_load_booru": {
"message": "Load pictures from Booru, Tumblr, etc via @NokitaKaze server"
"message": "Load pictures from Booru, Tumblr, etc"
},
"option_audios_parse_links": {
"message": "Audio from direct links"
},
"option_videos_parse_links": {
"message": "Video from direct links ▼"
"message": "Video from direct links"
},
"option_videos_parse_webm": {
"message": "Only webm"
@ -71,24 +71,30 @@
"option_videos_parse_all_links": {
"message": "Parse all links"
},
"option_videos_parse_leave_links": {
"message": "Leave original link"
},
"option_embedding_soundcloud": {
"message": "Soundcloud"
"message": "Soundcloud ▼"
},
"option_embedding_soundcloud_orig_link": {
"message": "Leave original link"
},
"option_embedding_pleercom": {
"message": "Pleer.com"
"message": "Pleer.com ▼"
},
"option_embedding_pleercom_nokita_server": {
"message": "Use Nokita's server (deprecated)"
},
"option_embedding_coubcom": {
"message": "Coub.com"
"message": "Coub.com ▼"
},
"option_embedding_coubcom_orig_link": {
"message": "Leave original link"
},
"option_embedding_twitter_tweets": {
"message": "Twitter"
},
"option_embedding_instagram_posts": {
"message": "Instagram"
},
"option_embedding_remove_original_link": {
"message": "Remove original link"
},
"option_nsfw": {
"message": "NSFW content filtering"
},
@ -113,12 +119,6 @@
"option_ajax_comments": {
"message": "Send comments via AJAX (CTRL+Enter)"
},
"option_right_panel": {
"message": "Right side panel"
},
"option_right_panel_to_unread": {
"message": "\"Go to unread comment\" button"
},
"option_fluid_layout": {
"message": "Fluid layout"
},
@ -172,19 +172,10 @@
"message": "Your hints about users"
},
"option_other_comments_count_refresh":{
"message": "Refresh unread posts and comments count in the sidebar"
"message": "Refresh unread posts and comments count in left menu"
},
"option_other_comments_count_refresh_title":{
"message": "Page title"
},
"option_other_move_all_to_menu":{
"message": "Move \"All posts\" to left menu"
},
"option_other_remove_fucking_button":{
"message": "Remove the fucking button"
},
"option_other_post_draft_save":{
"message": "Save post drafts"
"message": "Show counts in the title of tabs"
},
"options_feedback_text": {
@ -194,11 +185,5 @@
"msg_comment_send_failed":{
"message": "Comment send error:"
},
"msg_saving_post_draft":{
"message": "Saving the post..."
},
"msg_success_recommendation": {
"message": "is recommended"
}
}

View File

@ -6,13 +6,10 @@
"message": "Алексей Скобкин"
},
"ext_page_action_title": {
"message": "Настройки"
},
"options_page_title": {
"message": "Настройки Point+"
},
"options_text_saved": {
"message": "Для применения изменений перезагрузите страницу."
},
@ -50,6 +47,9 @@
"option_fancybox_bind_images_to_one_flow": {
"message": "Связать все картинки в одну галерею Fancybox"
},
"option_fancybox_smart_hints": {
"message": "Генерировать подписи к картинкам из тегов"
},
"option_images_load_original": {
"message": "Загружать оригиналы вместо миниатюр"
},
@ -57,13 +57,13 @@
"message": "Включить встраивание ▼"
},
"option_images_load_booru": {
"message": "Загружать картинки с Booru, Tumblr и т.п. через сервер @NokitaKaze"
"message": "Загружать картинки с Booru, Tumblr и т.п."
},
"option_audios_parse_links": {
"message": "Аудио по прямой ссылке"
},
"option_videos_parse_links": {
"message": "Видео по прямой ссылке ▼"
"message": "Видео по прямой ссылке"
},
"option_videos_parse_webm": {
"message": "Только webm"
@ -71,24 +71,30 @@
"option_videos_parse_all_links": {
"message": "Все ссылки на видео"
},
"option_videos_parse_leave_links": {
"message": "Оставлять ссылку на видео"
},
"option_embedding_soundcloud": {
"message": "Soundcloud"
"message": "Soundcloud ▼"
},
"option_embedding_soundcloud_orig_link": {
"message": "Не убирать ссылку"
},
"option_embedding_pleercom": {
"message": "Pleer.com"
"message": "Pleer.com ▼"
},
"option_embedding_pleercom_nokita_server": {
"message": "Использовать сервер @NokitaKaze (deprecated)"
},
"option_embedding_coubcom": {
"message": "Coub.com"
"message": "Coub.com ▼"
},
"option_embedding_coubcom_orig_link": {
"message": "Не убирать ссылку"
},
"option_embedding_twitter_tweets": {
"message": "Twitter"
},
"option_embedding_instagram_posts": {
"message": "Instagram"
},
"option_embedding_remove_original_link": {
"message": "Удалять оригинальную ссылку"
},
"option_nsfw": {
"message": "Фильтрация NSFW-контента"
},
@ -113,12 +119,6 @@
"option_ajax_comments": {
"message": "Отправка комментариев через AJAX (CTRL+Enter)"
},
"option_right_panel": {
"message": "Боковая панель справа"
},
"option_right_panel_to_unread": {
"message": "Кнопка \"Перейти к непрочитанному\""
},
"option_fluid_layout": {
"message": ""Резиновая" вёрстка (растянуть сайт по горизонтали)"
},
@ -172,19 +172,10 @@
"message": "Заметки о пользователях на полях"
},
"option_other_comments_count_refresh":{
"message": "Обновление количества непрочитанных постов и комментариев в сайдбаре"
"message": "Обновляем количество непрочитанных комментариев и постов в ленте"
},
"option_other_comments_count_refresh_title":{
"message": "В заголовке страницы"
},
"option_other_move_all_to_menu":{
"message": "Переместить \"Всё подряд\" в левое меню"
},
"option_other_remove_fucking_button":{
"message": "Убрать ёбаную кнопку"
},
"option_other_post_draft_save":{
"message": "Сохранение черновика поста"
"message": "Указываем кол-во комментариев и сообщений в заголовке страницы"
},
@ -195,11 +186,5 @@
"msg_comment_send_failed":{
"message": "Ошибка отправки комментария:"
},
"msg_saving_post_draft":{
"message": "Сохранение поста..."
},
"msg_success_recommendation": {
"message": "рекомендовано"
}
}

View File

@ -16,11 +16,6 @@
background-image: url('chrome-extension://__MSG_@@extension_id__/vendor/fancybox/source/fancybox_overlay.png');
}
.fancybox-nav {
/* To supress errors */
background-image: url('chrome-extension://__MSG_@@extension_id__/vendor/fancybox/source/blank.gif'); /* helps IE */
}
@media only screen and (min-device-pixel-ratio: 1.5) {
#fancybox-loading, .fancybox-close, .fancybox-prev span, .fancybox-next span {
background-image: url('chrome-extension://__MSG_@@extension_id__/vendor/fancybox/source/fancybox_sprite@2x.png');

View File

@ -1,12 +1,8 @@
/* Posts */
#content .post-content a.user:before,
/* Subscribers */
#content .users span.user:before,
/* Subscriptions */
#content .users .info a.user:before {
/* @ before username */
#main #content a.user:before {
content: "@";
}
/* Fix for recommendations */
#content .post-content .rec .user:before {
margin-right: -3px;
}
/* Fix for recommendations in the feed */
#main #content .rec .user:before {
margin-right: -4px;
}

View File

@ -1,28 +0,0 @@
#pp-right-panel {
width: 32px;
position: fixed;
top: 50%;
right: 3px;
opacity: .3;
transition: opacity 500ms;
}
#pp-right-panel:hover {
opacity: 1;
transition: opacity 500ms;
}
#pp-right-panel #pp-go-to-unread {
background-image: url("/img/menu-my.png");
height: 32px;
width: 32px;
cursor: pointer;
}
#pp-right-panel span#pp-unread-count {
position: relative;
top: 7px;
left: 11px;
-webkit-user-select: none;
user-select: none;
}

View File

@ -94,7 +94,7 @@ p
box-sizing: border-box;
max-height: 100%;
margin: 0;
padding: 20px 15px 5px;
padding: 10px 15px 5px;
border: none;
background: transparent;

View File

@ -28,40 +28,31 @@ div#markItUpText-input {
}
/* Auto-loaded Booru pictures */
.booru_pic, .instagram-post-embedded {
.booru_pic {
display: block !important;
float: none !important;
}
.booru_pic img, .instagram-post-embedded img {
.booru_pic img {
border: none;
max-width: 60%;
max-height: 300px;
}
/* Unique ID and Recomendation */
.pp-post-counters
{
float: left;
color: #999;
font-size: 12px;
margin-left: 1em;
/* Labels in post */
.post .post-id a .cn.changed_background {
}
.pp-unique-comments
{
margin-right: .5em;
.post .post-id a .authors_unique_count, .post .post-id a .recommendation_count {
padding: 0 .5em;
font-weight: normal;
color: #35587c;
background-color: #f2f2eb;
}
/* @todo i18n */
.pp-unique-comments::before
{
content: 'Комментаторов: ';
}
.pp-recommendation-count::before
{
content: 'Рекомендаций: ';
.post .post-id a .recommendation_count {
margin-left: 0.2em;
background-color: #f2eceb;
}
/* NSFW-content */
@ -124,7 +115,7 @@ div#markItUpText-input {
right: 5px;
top: 5px;
display: none;
background-image: url('//point.im/img/btn-edit.png');
background-image: url("//point.im/img/btn-edit.png");
background-size: 100% 100%;
width: 16px;
height: 16px;
@ -182,9 +173,8 @@ div#markItUpText-input {
content: '';
opacity: 0;
background-image: url('chrome-extension://__MSG_@@extension_id__/images/nesting-point.svg');
background-image: url('chrome-extension://__MSG_@@extension_id__/images/nesting-point.png');
background-repeat: repeat-x;
background-position: right center;
}
#comments.nesting_level .post:hover .info::before {
@ -192,68 +182,3 @@ div#markItUpText-input {
opacity: 1;
}
.pp-progress.reply-form {
margin-top: 8px;
padding-top: 4px;
}
.pp-progress.reply-form::before {
content: '';
display: block;
height: 4px;
background: linear-gradient(to right, #fff, #9aacbe, #fff);
-webkit-animation: loading 1s;
-webkit-animation-iteration-count: infinite;
}
@-webkit-keyframes loading {
from {
background-position: -640px 0;
}
to {
background-position: 0 0;
}
}
/* "All" link in left menu */
#pp-left-menu-all {
/* Opened Lock icon from default point.im icon set */
background-image: url('/img/icon-private-inactive.png') !important;
}
/* Highlight post with new comments */
.pp-post-unread {
background-color: #EEFFEE;
}
/* Video from direct links */
.pp-video-player {
display: block;
max-width: 95%;
}
/* Audio from direct links */
.pp-audio-player {
display: block;
}
/* Coub embedded video */
.pp-video-player-coub {
max-width: 640px;
border: none;
}
/* New posts and comments auto refresh in left menu by @NokitaKaze */
.pp-left-menu-refreshed {
background-color: #f2ebee;
color: #7c3558;
}
#pp-iframe-unread-refresh {
width: 600px;
height: 300px;
display: none;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1003 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 651 B

View File

@ -1 +0,0 @@
<svg version="1" xmlns="http://www.w3.org/2000/svg" height="10" width="10"><circle cx="5" cy="5" r="3" fill="#9aacbe"/></svg>

Before

Width:  |  Height:  |  Size: 125 B

View File

@ -1,193 +1,15 @@
var VERSION = (function() {
/**
* @deprecated XMLHttpRequest in the background worker is deprecated
* according to the Chrome warning. But we definitely need synchronous
* AJAX here
*/
var xhr = new XMLHttpRequest(),
manifest;
xhr.open('GET', chrome.extension.getURL('manifest.json'), false);
xhr.send(null);
manifest = JSON.parse(xhr.responseText);
return manifest.version;
})();
/**
* Вставка нескольких файлов друг за другом
* @param {Array} files Список файлов
* @param {Function} injectOne Функция вставки одного файла. Должна принимать file и callback
* @param {Function} [onAllInjected] Функция обработки ответа
* @param {Array} [results] Результаты вставки (их не нужно передавать при запуске извне)
*/
function injectFiles(files, injectOne, onAllInjected, results) {
results = results || [];
if (files.length) {
injectOne(files.shift(), function(res) {
if (res) {
results.unshift(res[0]);
}
injectFiles(files, injectOne, onAllInjected, results);
});
} else {
onAllInjected(results);
}
}
/**
* @constructor Менеджер сообщений
*/
function MessageListener() {
/* jshint unused:false */
chrome.runtime.onMessage.addListener(function(message, sender, sendResponse) {
if (this.isMethodAvailable(message)) {
console.info('Call #%s() method for tab #%s', message.type, this.getTabId(sender));
this[message.type].apply(this, arguments);
return true;
} else {
console.warn('Method #%s() called from tab #%s does not exists', message.type, this.getTabId(sender));
return false;
}
}.bind(this));
/* jshint unused:true */
}
/**
* @param {Object} message Сообщение
* @returns {Boolean} Есть ли необходимый метод в MessageListener
*/
MessageListener.prototype.isMethodAvailable = function(message) {
return message && message.type && typeof this[message.type] === 'function';
};
/**
* @param {Object} sender
* @returns {Number|Null} Идентификатор вкладки, с которой пришло сообщение
*/
MessageListener.prototype.getTabId = function(sender) {
return sender.tab && sender.tab.id || null;
};
/**
* @param {Object} message Сообщение
* @param {Object} sender Отправитель
* @param {Function} sendResponse Коллбек для обработки результата
*/
MessageListener.prototype.showPageAction = function(message, sender, sendResponse) {
chrome.pageAction.show(this.getTabId(sender));
sendResponse(true);
};
/**
* Показывает нотификацию
* @param {Object} message Сообщение
* @param {Object} sender Отправитель
* @param {Function} sendResponse Коллбек для обработки результата
*/
MessageListener.prototype.showNotification = function(message, sender, sendResponse) {
chrome.notifications.create(
message.notificationId, {
type: 'basic',
iconUrl: message.avatarUrl,
title: message.title,
message: message.text,
priority: 0,
isClickable: true
}, function(notificationId) {
console.info('Notification "%s" created', notificationId);
sendResponse(true);
}
);
};
/**
* Получает версию плагина из манифеста
* @param {Object} message Сообщение
* @param {Object} sender Отправитель
* @param {Function} sendResponse Коллбек для обработки результата
*/
MessageListener.prototype.getManifestVersion = function(message, sender, sendResponse) {
sendResponse({ version: VERSION });
};
/**
* @param {Object} message Сообщение
*/
MessageListener.prototype.getFiles = function(message, defaultRunAt) {
var files;
if (! message.files) {
return false;
} else {
files = Array.isArray(message.files) ? message.files : [ message.files ];
return files.map(function(file) {
return {
file: typeof file === 'string' ? file : file.file,
runAt: file.runAt || defaultRunAt
};
});
}
};
/**
* Вставляет JS-файлы во вкладку
* @param {Object} message Сообщение
* @param {Object} sender Отправитель
* @param {Function} sendResponse Коллбек для обработки результата
*/
MessageListener.prototype.executeJSFiles = function(message, sender, sendResponse) {
var tabId = this.getTabId(sender);
injectFiles(
this.getFiles(message, 'document_end'),
function(file, callback) {
chrome.tabs.executeScript(tabId, file, callback);
},
sendResponse
);
};
/**
* Вставляет CSS-файлы во вкладку
* @param {Object} message Сообщение
* @param {Object} sender Отправитель
* @param {Function} sendResponse Коллбек для обработки результата
*/
MessageListener.prototype.injectCSSFiles = function(message, sender, sendResponse) {
var tabId = this.getTabId(sender);
injectFiles(
this.getFiles(message),
function(file, callback) {
chrome.tabs.insertCSS(tabId, file, callback);
},
sendResponse
);
};
new MessageListener();
// Maintaining options version
chrome.storage.sync.get('options_version', function(data) {
console.info('Point+ %s. Options are for %s.', VERSION, data.options_version);
if (data.options_version !== VERSION) {
chrome.tabs.create({ url: 'options.html' });
var pp_version = getVersion();
console.info('Point+ %s. Options are for %s.', pp_version, data.options_version);
if (data.options_version != pp_version) {
chrome.tabs.create({url: 'options.html'});
}
});
// Adding notification click event listener
chrome.notifications.onClicked.addListener(function(notificationId) {
var tab_url;
// Detecting notification type
if (notificationId.indexOf('comment_') === 0) {
tab_url = 'https://point.im/' + notificationId.replace(/comment_/g, '');
@ -202,3 +24,175 @@ chrome.notifications.onClicked.addListener(function(notificationId) {
});
}
});
// Crutches and bikes
/**
* Inject several JS files
* @param {number} tabId Unique ID of tab which requested injection
* @param {Object[]} files Array of objects of files to inject
* @param {function} onAllInjected allback function running when injection ends
*/
function injectJS(tabId, files, onAllInjected) {
var item = files.shift();
if (item) {
console.log('Injecting JS "%s" to the tab #%s', item.file, tabId);
if ('file' in item) {
chrome.tabs.executeScript(tabId ? tabId : null, {
file: item.file,
runAt: item.runAt || 'document_start'
}, function(result) {
console.info('"%s" injected to the tab #%s', item.file, tabId);
injectJS(tabId, files, onAllInjected);
});
}
} else {
onAllInjected();
}
}
// @todo Implement injectCSS (because JS execution working always after CSS injection)
// Message listener
chrome.runtime.onMessage.addListener(function(message, sender, sendResponse) {
// @todo Check if sender.tab may be undefined in some cases
console.log('Received message from tab #%s: %O', sender.tab ? sender.tab.id : 'undefined', message);
if (message) {
switch (message.type) {
case 'showPageAction':
chrome.pageAction.show(sender.tab.id);
sendResponse(true);
console.log('Showed pageAction for tab #%s', sender.tab.id);
// Fuck You, Chrome API documentation!!11
return true;
break;
case 'showNotification':
chrome.notifications.create(
message.notificationId, {
type: 'basic',
iconUrl: message.avatarUrl,
title: message.title,
message: message.text,
priority: 0,
isClickable: true
}, function(notificationId) {
console.info('Notification "%s" created', notificationId);
sendResponse(true);
}
);
// Fuck You, Chrome API documentation!!11
return true;
break;
case 'getManifestVersion':
sendResponse({version: getVersion()});
return true;
break;
/**
* @deprecated since 1.19.1
*/
case 'injectJSFile':
console.log('Executing JS: %s', message.file);
chrome.tabs.executeScript(sender.tab.id ? sender.tab.id : null, {
file: message.file,
runAt: message.runAt || 'document_start'
}, function() {
sendResponse(true);
console.info('JS file executed: "%s"', message.file);
return true;
});
// Fuck You, Chrome API documentation!
return true;
break;
// Inject several files
case 'executeJSFiles':
//console.debug('Received JS file list: %O', message.files);
if (message.files.length) {
injectJS(sender.tab.id ? sender.tab.id : null, message.files, function() {
// @fixme does not sending response now!
console.info('All scripts executed');
sendResponse(true);
return true;
});
} else {
/*
* May be not?
* But I don't want to block some shit-code execution
*/
sendResponse(false);
console.warn('No scripts executed (empty script array)');
}
// Fuck You, Chrome API documentation!
return true;
break;
/**
* @deprecated since 1.19.1
*/
case 'injectCSSFile':
console.log('Injecting CSS: "%s"', message.file);
chrome.tabs.insertCSS(sender.tab.id ? sender.tab.id : null, {
file: message.file
}, function() {
// @todo message response callback processing
//sendResponse(true);
console.info('CSS file "%s" injected', message.file);
});
// Fuck You, Chrome API documentation!
return true;
break;
case 'injectCSSCode':
if (message.code !== undefined) {
chrome.tabs.insertCSS(sender.tab.id ? sender.tab.id : null, {
code: message.code
}, function() {
// @todo message response callback processing
//sendResponse(true);
console.info('CSS code injected: \n%s', message.file);
});
}
// Fuck You, Chrome API documentation!
return true;
break;
default:
sendResponse(false);
return true;
break;
}
}
});
// Getting version from manifest.json
function getVersion() {
/**
* @deprecated XMLHttpRequest in the background worker is deprecated
* according to the Chrome warning. But we definitely need synchronous
* AJAX here
*/
var xhr = new XMLHttpRequest();
xhr.open('GET', chrome.extension.getURL('manifest.json'), false);
xhr.send(null);
var manifest = JSON.parse(xhr.responseText);
return manifest.version;
}

View File

@ -0,0 +1,95 @@
function $ajax_prot(settings){
if (settings==undefined){return;}
if (settings['url'] ==undefined){return;}this.url=settings['url'];
if (settings['async'] !==undefined){this.async =settings['async'];}
if (settings['type'] !==undefined){this.type =settings['type'];}
if (settings['postdata']!==undefined){this.postdata=settings['postdata'];}
if (settings['dont_set_content_type']!==undefined){
this.dont_set_content_type=settings['dont_set_content_type'];
}
this.xhr=new XMLHttpRequest();
this.xhr.parent =this;
this.xhr.settings=settings;
this.xhr.success =settings['success'];
this.xhr.error =settings['error'];
this.xhr.onreadystatechange=this.change;
this.xhr.open(this.type, this.url, this.async);
if ((this.type=='POST')&& !this.dont_set_content_type){
this.xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
}
if (settings.headers!==undefined){
for (var i=0;i<settings.headers.length;i++){
this.xhr.setRequestHeader(settings.headers[i][0], settings.headers[i][1]);
}
}
this.xhr.send(this.postdata);
}
$ajax_prot.prototype={
version: '0.0.5a',
url: '',
type: 'GET',
async: true,
postdata:null,
xhr: null,
dont_set_content_type: false,
change:function(){
if (this.readyState!==4){return;}
if (this.status==200){
if (this.success!==undefined){this.success(this.responseText,this.textStatus,this);}
}else{
if (this.error !==undefined){this.error(this.responseText,this.textStatus,this);}
}
}
}
$ajax=function (settings){return new $ajax_prot(settings);}
function urlencode(text){return encodeURIComponent(text);}
function sad_safe_reg(text){
var ar='.-\\/[]{}?+';
var s=''; for (var i=0;i<text.length;i++){
if ((' '+ar).indexOf(text[i])>0){
s+='\\'+text[i];
}else{
s+=text[i];
}
}
return s;
}
function sad_xml_getnode(node,path){//node as domNode
if ('' ==path){return node;}
if ('#'==path){return node.textContent || node.text;}
var ri=new RegExp('^([a-z0-9.:_-]*)(\\|[0-9]+)?(/?(.*))?','i');
var t=path.match(ri);
if (t[1].length<1){return undefined;}
if (t[2]==undefined){t[2]='';}
if (t[4]==undefined){t[4]='';}
var k=parseInt(t[2].substr(1));
if (!(k>0)){k=1;}
var r=new RegExp('^'+sad_safe_reg(t[1])+'$');
for (var i=0;i<node.childNodes.length;i++){
if (r.test(node.childNodes[i].nodeName)){
k--;if (k==0){return sad_xml_getnode(node.childNodes[i],t[4]);}
}
}
return undefined;
}
function sad_xml_attribute(node,name){
if (node==undefined){return undefined;}
var r=new RegExp('^'+sad_safe_reg(name)+'$','i');
for (var i=0;i<node.attributes.length;i++){
if (r.test(node.attributes[i].nodeName)){return node.attributes[i].nodeValue;}
}
return '';
}
function sad_x2n(xml){
return xml.responseXML.childNodes[xml.responseXML.childNodes.length-1];
}

View File

@ -1,20 +0,0 @@
function MessageSender() {}
function stub() {}
MessageSender.prototype.css = function(files, callback) {
this.sendMessage({
type: 'injectCSSFiles',
files: files
}, callback || stub);
};
MessageSender.prototype.js = function(files, callback) {
this.sendMessage({
type: 'executeJSFiles',
files: files
}, callback || stub);
};
MessageSender.prototype.sendMessage = function() {
chrome.runtime.sendMessage.apply(chrome.runtime, arguments);
};

View File

@ -1,37 +0,0 @@
/**
* Объект для получения опций
* @constructor {OptionsManager}
* @param {Object} options Хеш настроек
*/
function OptionsManager(options) {
this._options = options || {};
}
/**
* @param {String} optionName Имя опции
* @returns {Boolean|String|Null} Значение опции
*/
OptionsManager.prototype.get = function(optionName) {
return this._options.hasOwnProperty(optionName) ? this._options[optionName].value : null;
};
/**
* Проверяет, равна ли опция значению value. Если value не переданно, проверяет задана ли она и не равна ли false/''
* @param {String} optionName Имя опции
* @param {Boolean|String} [value=true] Значение опции
* @returns {Boolean}
*/
OptionsManager.prototype.is = function(optionName, value) {
if (typeof value !== 'undefined') {
return this.get(optionName) === value;
} else {
return Boolean(this.get(optionName));
}
};
/**
* @returns {Object} Хеш опций
*/
OptionsManager.prototype.getOptions = function() {
return this._options;
};

View File

@ -4,19 +4,19 @@
* При создании сохраняет версию, восстанавливает настройки, слушает изменения на инпутах.
* @constructor
*/
function OptionsPage() {
function Options() {
this.form = document.querySelector('form');
this.listenTabs();
chrome.runtime.sendMessage(null, {
type: 'getManifestVersion'
}, null, function(response) {
this.version = response.version || 'undefined';
this.showVersion();
this.restore();
this.form.addEventListener('change', this._onChange.bind(this));
}.bind(this));
}
@ -25,7 +25,7 @@ function OptionsPage() {
* Получает версию настроек. Если она не равна версии приложения, записывает в сторедж плагина настройки из инпутов
* и версию приложения.
*/
OptionsPage.prototype.updateOptionsFromFrom = function() {
Options.prototype.updateOptionsFromFrom = function() {
chrome.storage.sync.get('options_version', function(data) {
this.logVersion(data.options_version);
@ -40,8 +40,7 @@ OptionsPage.prototype.updateOptionsFromFrom = function() {
}, function() {
console.log('Default options initialized. Version upgraded to %s.', this.version);
/* global confirm */
if (! confirm(chrome.i18n.getMessage('options_text_new_version'))) {
if ( ! confirm(chrome.i18n.getMessage('options_text_new_version'))) {
window.close();
}
});
@ -52,7 +51,7 @@ OptionsPage.prototype.updateOptionsFromFrom = function() {
/**
* Сохраняет настройки
*/
OptionsPage.prototype.save = function() {
Options.prototype.save = function() {
var ppOptions = this.getValues();
console.log('Saving options: %O', ppOptions);
@ -63,7 +62,7 @@ OptionsPage.prototype.save = function() {
/**
* Получает настройки из стореджа плагина, устанавливает соответствующим инпутам соответствующие значения.
*/
OptionsPage.prototype.restore = function() {
Options.prototype.restore = function() {
this.checkOldStyle();
chrome.storage.sync.get('options', function(data) {
@ -81,7 +80,6 @@ OptionsPage.prototype.restore = function() {
break;
case 'enum':
case 'plain':
input.value = data.value;
break;
@ -99,19 +97,19 @@ OptionsPage.prototype.restore = function() {
/**
* @returns {Object} Хеш настроек вида { имяастроки: значениеастройки }
*/
OptionsPage.prototype.getValues = function() {
Options.prototype.getValues = function() {
return this._options;
};
/**
* @param {Event} event Событие изменения
*/
OptionsPage.prototype._onChange = function(event) {
Options.prototype._onChange = function(event) {
this.updateOptionFromInput(event.target);
this.save();
};
OptionsPage.prototype.updateOptionFromInput = function(input) {
Options.prototype.updateOptionFromInput = function(input) {
var key = this.getOptionKey(input.name);
if (this.isBoolean(input)) {
@ -124,11 +122,6 @@ OptionsPage.prototype.updateOptionFromInput = function(input) {
type: 'enum',
value: input.value
};
} else {
this._options[key] = {
type: 'plain',
value: input.value
};
}
};
@ -136,7 +129,7 @@ OptionsPage.prototype.updateOptionFromInput = function(input) {
* @param {HTMLElement} option Элемент опции
* @returns {Boolean} Является ли настройка булевой
*/
OptionsPage.prototype.isBoolean = function(option) {
Options.prototype.isBoolean = function(option) {
return option.getAttribute('type') === 'checkbox';
};
@ -145,7 +138,7 @@ OptionsPage.prototype.isBoolean = function(option) {
* @param {HTMLElement} option Элемент опции
* @returns {Boolean} Является ли настройка енумом
*/
OptionsPage.prototype.isEnum = function(option) {
Options.prototype.isEnum = function(option) {
return option.getAttribute('type') === 'radio';
};
@ -153,7 +146,7 @@ OptionsPage.prototype.isEnum = function(option) {
* @param {String} name Имя инпута
* @returns {String} Ключ для хеша настроек
*/
OptionsPage.prototype.getOptionKey = function(name) {
Options.prototype.getOptionKey = function(name) {
return name.replace(/-/g, '_');
};
@ -161,7 +154,7 @@ OptionsPage.prototype.getOptionKey = function(name) {
* @param {String} Ключ хеша настроек
* @returns {String} Имя инпута
*/
OptionsPage.prototype.getOptionName = function(key) {
Options.prototype.getOptionName = function(key) {
return key.replace(/_/g, '-');
};
@ -169,34 +162,31 @@ OptionsPage.prototype.getOptionName = function(key) {
* Выводит в консоль версию настроек и версию плагина
* @param {String} optionsVersion
*/
OptionsPage.prototype.logVersion = function(optionsVersion) {
Options.prototype.logVersion = function(optionsVersion) {
console.info('Point+ %s, local options are for %s', this.version, optionsVersion);
};
/**
* Добавляет номер версии в подвал
*/
OptionsPage.prototype.showVersion = function() {
Options.prototype.showVersion = function() {
document.querySelector('#version').innerHTML = this.version;
};
/**
* Проверяет, не старого ли формата настройки. И если старого, то удаляет их.
*/
OptionsPage.prototype.checkOldStyle = function() {
Options.prototype.checkOldStyle = function() {
chrome.storage.sync.get('option_fancybox', function(data) {
if ((data.option_fancybox === true) || (data.option_fancybox === false)) {
console.log('Found old-style options. Cleaning...');
chrome.storage.sync.get(null, function(data) {
var option;
console.log('Old data: %O', data);
for (option in data) {
if (data.hasOwnProperty(option)) {
chrome.storage.sync.remove(option);
}
chrome.storage.sync.remove(option);
}
console.log('All old data removed');
@ -208,7 +198,7 @@ OptionsPage.prototype.checkOldStyle = function() {
/**
* Показывает плашку про то, что настройки сохранились и надо обновить страницу
*/
OptionsPage.prototype.updateStatus = function() {
Options.prototype.updateStatus = function() {
this.status = this.status || document.querySelector('.saved');
this.status.classList.remove('hidden');
@ -217,7 +207,7 @@ OptionsPage.prototype.updateStatus = function() {
/**
* Слушает события на табах
*/
OptionsPage.prototype.listenTabs = function() {
Options.prototype.listenTabs = function() {
var options = this;
options._selectedItem = document.querySelector('.tabs-item.selected');
@ -239,4 +229,4 @@ OptionsPage.prototype.listenTabs = function() {
});
};
new OptionsPage();
new Options();

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "Point+",
"version": "1.42.1",
"version": "1.35.1",
"default_locale": "ru",
"author": "__MSG_ext_author__",
"homepage_url": "https://bitbucket.org/skobkin/chrome_point_plus",
@ -27,16 +27,15 @@
{
"matches": ["http://*.point.im/*", "https://*.point.im/*"],
"js": [
"vendor/jquery/dist/jquery.min.js",
"vendor/jquery/jquery.min.js",
"js/options-manager.js",
"js/message-sender.js",
"js/point-plus.js"
],
"js/bquery_ajax.js",
"js/point-plus.js"
],
"css": [
"css/point-plus.css"
],
"css/point-plus.css"
],
"run_at": "document_end"
}
],
@ -59,7 +58,6 @@
"https://player.soundcloud.com/*",
"https://api.kanaria.ru/point/*",
"https://*.twitter.com/*",
"https://api.instagram.com/*",
"https://coub.com/embed/*",
"storage",
"notifications",

View File

@ -1,27 +0,0 @@
.pp-notification {
display: block;
position: fixed;
bottom: 40px;
right: 40px;
padding: 20px;
border-radius: 2px;
font-size: 15px;
line-height: 20px;
transition: all 10s ease-in;
color: #fff;
}
.pp-notification a,
.pp-notification a:visited {
color: #fff;
text-decoration: none;
font-weight: bold;
}
.pp-notification-success {
background: #4CAF50;
}
.pp-notification.pp-fade {
opacity: 0;
}

View File

@ -1,311 +0,0 @@
/**
* Находит элемент #comments, и если он есть, начинает слушать на нём события
* @constructor
*/
function AjaxComments() {
var comments = document.querySelector('#comments');
if (comments) {
this._comments = comments;
this.listen(comments);
this.listenFirstComments();
}
}
/**
* Вешает обработчики. Магия в последнем параметре addEventListener
*/
AjaxComments.prototype.listen = function(elem) {
elem.addEventListener('submit', this.onSubmit.bind(this), true);
elem.addEventListener('keypress', this.onKeypress.bind(this), true);
};
/**
* Слушает отправки первых комментариев
*/
AjaxComments.prototype.listenFirstComments = function() {
var posts = document.querySelectorAll('.post-content');
// Чтобы не ловить события на чём попало и мочь использовать useCapture, приходится
// получать все post-content и на каждый вешать обработчики.
Array.prototype.forEach.call(posts, this.listen.bind(this));
};
/**
* Обрабатывает событие отправки формы
* @param {Event} event Событие отправки
*/
AjaxComments.prototype.onSubmit = function(event) {
var $form = $(event.target);
event.preventDefault();
event.stopPropagation();
if ($form.hasClass('reply-form')) {
this.submit($form);
}
};
/**
* Проверяет, выбран ли файл. Если да отправляет форму с перезагрузкой, иначе аяксом
* @param {jQuery} $form Элемент формы
*/
AjaxComments.prototype.submit = function($form) {
var proc;
if (this.isFileSelected($form)) {
$form.submit();
} else {
proc = new AjaxCommentProcessor($form);
}
};
/**
* Обрабатывает нажатия кнопок. Если это сочетание Ctrl|+Enter, отправляет коммент
* @param {Event} event Событие нажатия кнопки
*/
AjaxComments.prototype.onKeypress = function(event) {
var $form;
if (this.isProperKeys(event)) {
event.preventDefault();
event.stopPropagation();
$form = $(event.target).closest('.reply-form');
if ($form.length) {
this.submit($form);
}
}
};
/**
* Проверяет, что нажато нужное сочетание клавишь
* @param {Event} event Событие нажатия
* @return {Boolean}
*/
AjaxComments.prototype.isProperKeys = function(event) {
return (event.keyCode === 10 || event.keyCode === 13) && (event.ctrlKey || event.metaKey);
};
/**
* @param {jQuery} $form
* @return {Boolean} Выбран ли файл
*/
AjaxComments.prototype.isFileSelected = function($form) {
var attach = $form.get(0).elements.attach;
if (attach) {
return Boolean(attach.files && attach.files.length);
} else {
return false;
}
};
/**
* Создаётся при каждой отправке комментария
* @param {jQuery} $form Элемент формы, на которой это произошло
*/
function AjaxCommentProcessor($form) {
this._$form = $form;
this._$post = $form.closest('.post');
this._$textarea = $form.find('textarea');
this._text = this._$textarea.val();
this._CSRF = $form.get(0).elements.csrf_token.value;
this._actionUrl = this._$form.attr('action');
this._postId = this._$post.data('id');
this._commentId = this._$post.data('comment-id');
this.sendComment();
}
/**
* Регулярка для урла, проверяюшая, не рекомендация ли это
* @type {RegExp}
*/
AjaxCommentProcessor.recommendationReg = /^\/[^/]*\/r$/;
/**
* Отправляет комментарий
*/
AjaxCommentProcessor.prototype.sendComment = function() {
this.setProgress(true);
$.ajax({
type: 'POST',
url: this.getUrl(),
data: {
text: this._text,
comment_id: this._commentId
},
beforeSend: this.beforeSend.bind(this),
error: this.onError.bind(this),
success: this.onSuccess.bind(this)
});
};
/**
* @return {Boolean} true это коммент-рекомендация, fasle обычный коммент
*/
AjaxCommentProcessor.prototype.isRecommendation = function() {
return this._isRec || (this._isRec = this.constructor.recommendationReg.test(this._actionUrl));
};
/**
* @return {String} Адрес, на который слать запрос
*/
AjaxCommentProcessor.prototype.getUrl = function() {
// Если это рекомендация комментария
if (this.isRecommendation() && this._commentId) {
return '/api/post/' + this._postId + '/' + this._commentId + '/r';
} else {
return '/api/post' + this._actionUrl;
}
};
/**
* Подкладывает CSRF-токен в заголовки запроса
* @param {XMLHttpRequest} xhr Объект запроса
*/
AjaxCommentProcessor.prototype.beforeSend = function(xhr) {
xhr.setRequestHeader('X-CSRF', this._CSRF);
};
/**
* Скрывает форму отправки комментария
* @return {[type]} [description]
*/
AjaxCommentProcessor.prototype.hideForm = function() {
this._$form.prev().prop('checked', false);
};
/**
* Создаёт новый комментарий, скрывает форму, снимает прогресс.
* @param {Object} data Ответ сервера
* @param {String} textStatus Статус ответа
*/
AjaxCommentProcessor.prototype.onSuccess = function(data, textStatus) {
var $textarea = this._$textarea;
if (textStatus === 'success') {
if (data.error) {
this.onError(null, null, data.error);
} else {
if (this.isRecommendation() && this._text.trim().length === 0) {
this.showSuccessRecommendation();
}/* else {
this.createComment(data);
}*/
this.hideForm();
// Cleaning textarea
$textarea.val('');
this.setProgress(false);
}
}
};
AjaxCommentProcessor.prototype.createComment = function(data) {
/* global create_comment_elements */
create_comment_elements({
id: data.comment_id,
toId: this._commentId || null,
postId: this._postId,
author: $('#name h1').text(),
text: this._text,
fadeOut: true,
isRec: this.isRecommendation()
}, this.insertComment.bind(this));
};
/**
* Вставляет комментарий в DOM
* @param {jQuery} $comment
*/
AjaxCommentProcessor.prototype.insertComment = function($comment) {
var $parentCommentChildren;
if ($('#comments #tree-switch a').eq(0).hasClass('active') || (this._commentId === undefined)) {
// Adding to the end of the list
$('.content-wrap #comments #post-reply').before($comment);
} else {
// Check for children
$parentCommentChildren = this._$post.next('.comments');
// @fixme Find a bug with lost indentation of new comment
// If child comment already exist
if ($parentCommentChildren.length) {
console.log('Child comments found. Appending...');
$parentCommentChildren.append($comment);
} else {
console.log('No child comments found. Creating...');
this._$post.after(
$('<div>')
.addClass('comments')
.append($comment)
);
}
}
this.showComment($comment);
};
AjaxCommentProcessor.prototype.showComment = function($comment) {
$('body').animate({
scrollTop: $comment.offset().top
}, 500);
};
/**
* Показывает алерт с ошибкой и снимает прогресс, если коммент не отправился
* @param {*} req
* @param {*} status
* @param {String} error
*/
AjaxCommentProcessor.prototype.onError = function(req, status, error) {
/* global alert */
alert(chrome.i18n.getMessage('msg_comment_send_failed') + '\n' + error);
this.setProgress(false);
};
/**
* Устанавливает прогресс
* @param {Boolean} isProgress true включить прогресс, false отключить
*/
AjaxCommentProcessor.prototype.setProgress = function(isProgress) {
this._$textarea.prop('disabled', isProgress);
this._$form.toggleClass('pp-progress', isProgress);
};
AjaxCommentProcessor.prototype.getRecommendationLink = function() {
var url = '//point.im/' + this._postId;
var text = '#' + this._postId;
if (this._commentId) {
url += '#' + this._commentId;
text += '/' + this._commentId;
}
return '<a href="' + url + '">' + text + '</a>';
};
AjaxCommentProcessor.prototype.showSuccessRecommendation = function() {
var $notification = $('<div>')
.addClass('pp-notification pp-notification-success');
$notification.html(this.getRecommendationLink() + ' ' + chrome.i18n.getMessage('msg_success_recommendation'));
$notification.on('transitionend', function() {
$notification.remove();
});
$('body').append($notification);
window.requestAnimationFrame(function() {
$notification.addClass('pp-fade');
});
};

View File

@ -1,172 +0,0 @@
/**
* Подгружает картинки через сервер Никиты
* @constructor
* @param {jQuery} $links Коллекция ссылок
* @param {OptionsManager} options Опции
*/
function Booru($links, options) {
this.count = 0;
this.loadAllImages($links, options.is('option_embedding_remove_original_link'));
}
/**
* Base URL of gelbooru picture API (@NokitaKaze)
* @type {String}
*/
Booru.baseUrl = 'https://evidell.xyz/get_booru_picture.php';
/* jshint maxlen:false */
Booru.services = {
danbooru: {
mask: new RegExp('^https?://danbooru\\.donmai\\.us/posts/([0-9]+)', 'i'),
matchNumber: 1
},
gelbooru: {
mask: new RegExp('^https?\\://(www\\.)?gelbooru\\.com\\/index\\.php\\?page\\=post&s\\=view&id=([0-9]+)', 'i'),
matchNumber: 2
},
safebooru: {
mask: new RegExp('^https?\\://(www\\.)?safebooru\\.org\\/index\\.php\\?page\\=post&s\\=view&id=([0-9]+)', 'i'),
matchNumber: 2
},
deviantart: {
mask: new RegExp('^https?\\://(www\\.)?([a-z0-9-]+\\.)?deviantart\\.com\\/art/[0-9a-z-]+?\\-([0-9]+)(\\?.+)?$', 'i'),
matchNumber: 3
},
e621: {
mask: new RegExp('^https?\\://(www\\.)?e621\\.net\\/post\\/show\\/([0-9]+)\\/', 'i'),
matchNumber: 2
},
derpibooru: {
mask: new RegExp('^https?\\://derpiboo\\.ru\\/([0-9]+)', 'i'),
matchNumber: 1
},
tumblr: {
mask: new RegExp('^https?\\://([0-9a-z-]+)\\.tumblr\\.com\\/post\\/([0-9]+)', 'i'),
matchNumber: 2,
params: {
add_username: 1
}
},
pixiv: {
mask: new RegExp('^https?://(www\\.)?pixiv\\.net\\/member_illust\\.php\\?mode\\=medium\\&illust_id\\=([0-9]+)', 'i'),
matchNumber: 2
},
animepicturesnet: {
mask: new RegExp('^http\\:\\/\\/anime\\-pictures\\.net\\/pictures\\/view_post\\/([0-9]+)', 'i'),
matchNumber: 1
}
};
/* jshint maxlen:120 */
/**
* Обрабатывает все картинки
* @param {jQuery} $links Коллекция ссылок
* @param {Boolean} removeOriginal Удалять ли оригинальную ссылку
*/
Booru.prototype.loadAllImages = function($links, removeOriginal) {
var booru = this;
$links.each(function(index, link) {
var $link = $(link);
var href = link.href;
var $image;
if ($link.hasClass('booru_pic')) {
return;
}
Object.keys(booru.constructor.services).some(function(service) {
$image = booru.createImageFromService(service, href);
return $image;
});
if ($image) {
$link.before($image);
this.count++;
if (removeOriginal) {
$link.remove();
}
}
});
};
/**
* Создаёт картинку исходя из сервиса, если адрес картинки матчится
* @param {String} service Идентификатор сервиса
* @param {String} href URL картинки (который вставлен в пост)
*/
Booru.prototype.createImageFromService = function(service, href) {
var serviceInfo = this.constructor.services[service];
var matches = href.match(serviceInfo.mask);
var imageArgs;
var params = {};
var key;
if (matches) {
imageArgs = [ service, matches[serviceInfo.matchNumber] ];
if (serviceInfo.params) {
for (key in serviceInfo.params) {
if (serviceInfo.params.hasOwnProperty(key)) {
params[key] = matches[serviceInfo.params[key]];
}
}
imageArgs.push(params);
}
return this.createImage.apply(this, imageArgs);
}
};
/**
* Создаёт ссылку с картикной
* @param {String} service Ключевое имя сервиса для Никиты
* @param {String} id Идентификатор картинки
* @param {Object} [params] Дополнительные параметры, которые надо добавить в url
* @returns {jQuery} Элемент ссылки
*/
Booru.prototype.createImage = function(service, id, params) {
var $link = $('<a>');
var $img = $('<img>');
var title = service + ' image #' + id;
var imageSource = this.getImageLink(service, id, params);
$link
.addClass('booru_pic')
.addClass('booru-' + service + '-' + id)
.addClass('postimg')
.attr({
href: imageSource,
id: 'booru_pic_' + this.count,
title: title,
target: '_blank'
});
$img.attr({
alt: title,
src: imageSource
});
$link.append($img);
return $link;
};
/**
* Генерирует ссылку на картинку
* @param {String} service Ключевое имя сервиса для Никиты
* @param {String} id Идентификатор картинки
* @param {Object} [params] Дополнительные параметры, которые надо добавить в url
* @returns {String} Ссылка на картинку
*/
Booru.prototype.getImageLink = function(service, id, params) {
return this.constructor.baseUrl + '?' + $.param($.extend({
domain: service,
id: id
}, params));
};

View File

@ -1,307 +1,307 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title data-i18n="options_page_title"></title>
<link rel="stylesheet" href="css/options.css" type="text/css">
</head>
<body>
<main>
<nav class="tabs-list">
<a class="tabs-item selected" href="#media" data-i18n="options_tabs_media"></a>
<a class="tabs-item" href="#other" data-i18n="options_tabs_other"></a>
<a class="tabs-item" href="#websocket" data-i18n="options_tabs_websocket"></a>
<a class="tabs-item" href="#feedback" data-i18n="options_tabs_feedback"></a>
</nav>
<form class="tabs-content">
<section class="tabs-content-item selected" id="media">
<div class="option-node">
<input type="checkbox" name="option-fancybox" id="option-fancybox">
<label for="option-fancybox" data-i18n="option_fancybox"></label>
<label class="option-node">
<input type="checkbox" name="option-fancybox-images">
<span data-i18n="option_fancybox_images"></span>
</label>
<label class="option-node">
<input type="checkbox" name="option-fancybox-videos">
<span data-i18n="option_fancybox_videos"></span>
</label>
<label class="option-node">
<input type="checkbox" name="option-fancybox-posts">
<span data-i18n="option_fancybox_posts"></span>
</label>
<label class="option-node">
<input type="checkbox" name="option-fancybox-bind-images-to-one-flow">
<span data-i18n="option_fancybox_bind_images_to_one_flow"></span>
</label>
</div>
<label class="option-node">
<input type="checkbox" name="option-images-load-original">
<span data-i18n="option_images_load_original"></span>
</label>
<div class="option-node">
<input type="checkbox" name="option-embedding" id="option-embedding">
<label for="option-embedding" data-i18n="option_embedding"></label>
<label class="option-node">
<input type="checkbox" name="option-images-load-booru">
<span data-i18n="option_images_load_booru"></span>
</label>
<div class="option-node">
<input type="checkbox" name="option-videos-parse-links" id="option-videos-parse-links">
<label for="option-videos-parse-links" data-i18n="option_videos_parse_links"></label>
<div class="option-node">
<label>
<input type="radio" name="option-videos-parse-links-type" value="webm">
<span data-i18n="option_videos_parse_webm"></span>
</label>
<label>
<input type="radio" name="option-videos-parse-links-type" value="all" checked="checked">
<span data-i18n="option_videos_parse_all_links"></span>
</label>
</div>
</div>
<label class="option-node">
<input type="checkbox" name="option-audios-parse-links">
<span data-i18n="option_audios_parse_links"></span>
</label>
<label class="option-node">
<input type="checkbox" name="option-embedding-soundcloud">
<span data-i18n="option_embedding_soundcloud"></span>
</label>
<label class="option-node">
<input type="checkbox" name="option-embedding-pleercom">
<span data-i18n="option_embedding_pleercom"></span>
</label>
<label class="option-node">
<input type="checkbox" name="option-embedding-coubcom">
<span data-i18n="option_embedding_coubcom"></span>
</label>
<label class="option-node">
<input type="checkbox" name="option-embedding-twitter-tweets">
<span data-i18n="option_embedding_twitter_tweets"></span>
</label>
<label class="option-node">
<input type="checkbox" name="option-embedding-instagram-posts">
<span data-i18n="option_embedding_instagram_posts"></span>
</label>
<label class="option-node">
<input type="checkbox" name="option-embedding-remove-original-link">
<span data-i18n="option_embedding_remove_original_link">
</label>
</div>
<div class="option-node">
<input type="checkbox" name="option-nsfw" id="option-nsfw">
<label for="option-nsfw" data-i18n="option_nsfw"></label>
<label class="option-node">
<input type="checkbox" name="option-nsfw-hide-posts">
<span data-i18n="option_nsfw_hide_posts"></span>
</label>
<div class="option-node">
<input type="checkbox" name="option-nsfw-blur-posts-images" id="option-nsfw-blur-posts-images">
<label for="option-nsfw-blur-posts-images" data-i18n="option_nsfw_blur_posts_images"></label>
<label class="option-node">
<input type="checkbox" name="option-nsfw-blur-posts-entire">
<span data-i18n="option_nsfw_blur_posts_entire"></span>
</label>
</div>
<div class="option-node">
<input type="checkbox" name="option-nsfw-blur-comments-images" id="option-nsfw-blur-comments-images">
<label for="option-nsfw-blur-comments-images" data-i18n="option_nsfw_blur_comments_images"></label>
<label class="option-node">
<input type="checkbox" name="option-nsfw-blur-comments-entire">
<span data-i18n="option_nsfw_blur_comments_entire"></span>
</label>
</div>
</div>
</section>
<section class="tabs-content-item" id="other">
<div class="option-node">
<input type="checkbox" name="option-ajax" id="option-ajax">
<label for="option-ajax" data-i18n="option_ajax"></label>
<label class="option-node">
<input type="checkbox" name="option-ajax-comments">
<span data-i18n="option_ajax_comments"></span>
</label>
</div>
<div class="option-node">
<input type="checkbox" name="option-right-panel" id="option-right-panel">
<label for="option-right-panel" data-i18n="option_right_panel"></label>
<label class="option-node">
<input type="checkbox" name="option-right-panel-to-unread">
<span data-i18n="option_right_panel_to_unread"></span>
</label>
</div>
<label class="option-node">
<input type="checkbox" name="option-fluid-layout">
<span data-i18n="option_fluid_layout"></span>
</label>
<label class="option-node">
<input type="checkbox" name="option-visual-editor-post">
<span data-i18n="option_visual_editor_post"></span>
</label>
<label class="option-node">
<input type="checkbox" name="option-search-with-google">
<span data-i18n="option_search_with_google"></span>
</label>
<div class="option-node">
<input type="checkbox" name="option-enlarge-font" id="option-enlarge-font">
<label for="option-enlarge-font" data-i18n="option_enlarge_font"></label>
<div class="option-node">
<label>
<input type="radio" name="option-enlarge-font-size" value="85" checked="checked"> 0.85 em
</label>
<label>
<input type="radio" name="option-enlarge-font-size" value="100"> 1 em
</label>
<label>
<input type="radio" name="option-enlarge-font-size" value="110"> 1.1 em
</label>
</div>
</div>
<label class="option-node">
<input type="checkbox" name="option-at-before-username">
<span data-i18n="option_at_before_username"></span>
</label>
<label class="option-node">
<input type="checkbox" name="option-other-hightlight-post-comments">
<span data-i18n="option_other_hightlight_post_comments"></span>
</label>
<label class="option-node">
<input type="checkbox" name="option-other-show-recommendation-count">
<span data-i18n="option_other_show_recommendation_count"></span>
</label>
<label class="option-node">
<input type="checkbox" name="option-other-scroll-space-key">
<span data-i18n="option_other_scroll_space_key"></span>
</label>
<label class="option-node">
<input type="checkbox" name="option-other-comments-nesting-level">
<span data-i18n="option_other_comments_nesting_level"></span>
</label>
<div class="option-node">
<input type="checkbox" name="option-other-comments-count-refresh" id="option-other-comments-count-refresh">
<label for="option-other-comments-count-refresh" data-i18n="option_other_comments_count_refresh"></label>
<label class="option-node">
<input type="checkbox" name="option-other-comments-count-refresh-title">
<span data-i18n="option_other_comments_count_refresh_title"></span>
</label>
</div>
<label class="option-node">
<input type="checkbox" name="option-other-comments-user-system">
<span data-i18n="option_other_comments_user_system"></span>
</label>
<label class="option-node">
<input type="checkbox" name="option-other-move-all-to-menu">
<span data-i18n="option_other_move_all_to_menu"></span>
</label>
<label class="option-node">
<input type="checkbox" name="option-other-remove-fucking-button">
<span data-i18n="option_other_remove_fucking_button"></span>
</label>
<label class="option-node">
<input type="checkbox" name="option-other-post-draft-save">
<span data-i18n="option_other_post_draft_save"></span>
</label>
</section>
<section class="tabs-content-item" id="websocket">
<div class="option-node">
<input type="checkbox" name="option-ws" id="option-ws">
<label for="option-ws" data-i18n="option_ws"></label>
<div class="option-node">
<input type="checkbox" name="option-ws-comments" id="option-ws-comments">
<label for="option-ws-comments" data-i18n="option_ws_comments"></label>
<label class="option-node">
<input type="checkbox" name="option-ws-comments-color-fadeout">
<span data-i18n="option_ws_comments_color_fadeout"></span>
</label>
<label class="option-node">
<input type="checkbox" name="option-ws-comments-notifications">
<span data-i18n="option_ws_comments_notifications"></span>
</label>
</div>
<div class="option-node">
<input type="checkbox" name="option-ws-posts" id="option-ws-posts">
<label for="option-ws-posts" data-i18n="option_ws_posts"></label>
<label class="option-node">
<input type="checkbox" name="option-ws-posts-add" disabled>
<span data-i18n="option_ws_posts_add"></span>
</label>
<label class="option-node">
<input type="checkbox" name="option-ws-posts-notifications">
<span data-i18n="option_ws_posts_notifications"></span>
</label>
</div>
</div>
</section>
<section class="tabs-content-item" id="feedback">
<div data-i18n="options_feedback_text"></div>
</section>
</form>
</main>
<p class="saved hidden" data-i18n="options_text_saved"></p>
<footer class="footer">
<p>Point+ <span id="version"></span> by
<a href="https://skobkin-ru.point.im/" target="_blank">@skobkin-ru</a>,
<a href="https://isqua.point.im/" target="_blank">@isqua</a>,
<a href="https://nokitakaze.point.im/" target="_blank">@NokitaKaze</a>
</p>
</footer>
<script src="js/options.js"></script>
<script src="js/i18n.js"></script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Point Plus options</title>
<meta charset="utf-8">
<link rel="stylesheet" href="css/options.css" type="text/css">
</head>
<body>
<main>
<nav class="tabs-list">
<a class="tabs-item selected" href="#media" data-i18n="options_tabs_media"></a>
<a class="tabs-item" href="#other" data-i18n="options_tabs_other"></a>
<a class="tabs-item" href="#websocket" data-i18n="options_tabs_websocket"></a>
<a class="tabs-item" href="#feedback" data-i18n="options_tabs_feedback"></a>
</nav>
<form class="tabs-content">
<section class="tabs-content-item selected" id="media">
<div class="option-node">
<input type="checkbox" name="option-fancybox" id="option-fancybox">
<label for="option-fancybox" data-i18n="option_fancybox"></label>
<label class="option-node">
<input type="checkbox" name="option-fancybox-images">
<span data-i18n="option_fancybox_images"></span>
</label>
<label class="option-node">
<input type="checkbox" name="option-fancybox-videos">
<span data-i18n="option_fancybox_videos"></span>
</label>
<label class="option-node">
<input type="checkbox" name="option-fancybox-posts">
<span data-i18n="option_fancybox_posts"></span>
</label>
<label class="option-node">
<input type="checkbox" name="option-fancybox-bind-images-to-one-flow">
<span data-i18n="option_fancybox_bind_images_to_one_flow"></span>
</label>
<label class="option-node">
<input type="checkbox" name="option-fancybox-smart-hints">
<span data-i18n="option_fancybox_smart_hints"></span>
</label>
</div>
<label class="option-node">
<input type="checkbox" name="option-images-load-original">
<span data-i18n="option_images_load_original"></span>
</label>
<div class="option-node">
<input type="checkbox" name="option-embedding" id="option-embedding">
<label for="option-embedding" data-i18n="option_embedding"></label>
<label class="option-node">
<input type="checkbox" name="option-images-load-booru">
<span data-i18n="option_images_load_booru"></span>
</label>
<div class="option-node">
<input type="checkbox" name="option-videos-parse-links" id="option-videos-parse-links">
<label for="option-videos-parse-links" data-i18n="option_videos_parse_links"></label>
<div class="option-node">
<label>
<input type="radio" name="option-videos-parse-links-type" value="webm">
<span data-i18n="option_videos_parse_webm"></span>
</label>
<label>
<input type="radio" name="option-videos-parse-links-type" value="all" checked="checked">
<span data-i18n="option_videos_parse_all_links"></span>
</label>
</div>
<label class="option-node">
<input type="checkbox" name="option-videos-parse-leave-links">
<span data-i18n="option_videos_parse_leave_links"></span>
</label>
</div>
<div class="option-node">
<input type="checkbox" name="option-audios-parse-links" id="option-audios-parse-links">
<label for="option-audios-parse-links" data-i18n="option_audios_parse_links"></label>
<label class="option-node">
<input type="checkbox" name="option-audios-parse-leave-links">
<span data-i18n="option_embedding_soundcloud_orig_link"></span>
</label>
</div>
<div class="option-node">
<input type="checkbox" name="option-embedding-soundcloud" id="option-embedding-soundcloud">
<label for="option-embedding-soundcloud" data-i18n="option_embedding_soundcloud"></label>
<label class="option-node">
<input type="checkbox" name="option-embedding-soundcloud-orig-link">
<span data-i18n="option_embedding_soundcloud_orig_link"></span>
</label>
</div>
<div class="option-node">
<input type="checkbox" name="option-embedding-pleercom" id="option-embedding-pleercom">
<label for="option-embedding-pleercom" data-i18n="option_embedding_pleercom"></label>
<label class="option-node">
<input type="checkbox" name="option-embedding-pleercom-nokita-server">
<span data-i18n="option_embedding_pleercom_nokita_server"></span>
</label>
<label class="option-node">
<input type="checkbox" name="option-embedding-pleercom-orig-link">
<span data-i18n="option_embedding_soundcloud_orig_link"></span>
</label>
</div>
<div class="option-node">
<input type="checkbox" name="option-embedding-coubcom" id="option-embedding-coubcom">
<label for="option-embedding-coubcom" data-i18n="option_embedding_coubcom"></label>
<label class="option-node">
<input type="checkbox" name="option-embedding-coubcom-orig-link">
<span data-i18n="option_embedding_coubcom_orig_link"></span>
</label>
</div>
<label class="option-node">
<input type="checkbox" name="option-embedding-twitter-tweets">
<span data-i18n="option_embedding_twitter_tweets"></span>
</label>
</div>
<div class="option-node">
<input type="checkbox" name="option-nsfw" id="option-nsfw">
<label for="option-nsfw" data-i18n="option_nsfw"></label>
<label class="option-node">
<input type="checkbox" name="option-nsfw-hide-posts">
<span data-i18n="option_nsfw_hide_posts"></span>
</label>
<div class="option-node">
<input type="checkbox" name="option-nsfw-blur-posts-images" id="option-nsfw-blur-posts-images">
<label for="option-nsfw-blur-posts-images" data-i18n="option_nsfw_blur_posts_images"></label>
<label class="option-node">
<input type="checkbox" name="option-nsfw-blur-posts-entire">
<span data-i18n="option_nsfw_blur_posts_entire"></span>
</label>
</div>
<div class="option-node">
<input type="checkbox" name="option-nsfw-blur-comments-images" id="option-nsfw-blur-comments-images">
<label for="option-nsfw-blur-comments-images" data-i18n="option_nsfw_blur_comments_images"></label>
<label class="option-node">
<input type="checkbox" name="option-nsfw-blur-comments-entire">
<span data-i18n="option_nsfw_blur_comments_entire"></span>
</label>
</div>
</div>
</section>
<section class="tabs-content-item" id="other">
<div class="option-node">
<input type="checkbox" name="option-ajax" id="option-ajax">
<label for="option-ajax" data-i18n="option_ajax"></label>
<label class="option-node">
<input type="checkbox" name="option-ajax-comments">
<span data-i18n="option_ajax_comments"></span>
</label>
</div>
<label class="option-node">
<input type="checkbox" name="option-fluid-layout">
<span data-i18n="option_fluid_layout"></span>
</label>
<label class="option-node">
<input type="checkbox" name="option-visual-editor-post">
<span data-i18n="option_visual_editor_post"></span>
</label>
<label class="option-node">
<input type="checkbox" name="option-search-with-google">
<span data-i18n="option_search_with_google"></span>
</label>
<div class="option-node">
<input type="checkbox" name="option-enlarge-font" id="option-enlarge-font">
<label for="option-enlarge-font" data-i18n="option_enlarge_font"></label>
<div class="option-node">
<label>
<input type="radio" name="option-enlarge-font-size" value="85" checked="checked"> 0.85 em
</label>
<label>
<input type="radio" name="option-enlarge-font-size" value="100"> 1 em
</label>
<label>
<input type="radio" name="option-enlarge-font-size" value="110"> 1.1 em
</label>
</div>
</div>
<label class="option-node">
<input type="checkbox" name="option-at-before-username">
<span data-i18n="option_at_before_username"></span>
</label>
<label class="option-node">
<input type="checkbox" name="option-other-hightlight-post-comments">
<span data-i18n="option_other_hightlight_post_comments"></span>
</label>
<label class="option-node">
<input type="checkbox" name="option-other-show-recommendation-count">
<span data-i18n="option_other_show_recommendation_count"></span>
</label>
<label class="option-node">
<input type="checkbox" name="option-other-scroll-space-key">
<span data-i18n="option_other_scroll_space_key"></span>
</label>
<label class="option-node">
<input type="checkbox" name="option-other-comments-nesting-level">
<span data-i18n="option_other_comments_nesting_level"></span>
</label>
<div class="option-node">
<input type="checkbox" name="option-other-comments-count-refresh" id="option-other-comments-count-refresh">
<label for="option-other-comments-count-refresh" data-i18n="option_other_comments_count_refresh"></label>
<label class="option-node">
<input type="checkbox" name="option-other-comments-count-refresh-title">
<span data-i18n="option_other_comments_count_refresh_title"></span>
</label>
</div>
<label class="option-node">
<input type="checkbox" name="option-other-comments-user-system">
<span data-i18n="option_other_comments_user_system"></span>
</label>
</section>
<section class="tabs-content-item" id="websocket">
<div class="option-node">
<input type="checkbox" name="option-ws" id="option-ws">
<label for="option-ws" data-i18n="option_ws"></label>
<div class="option-node">
<input type="checkbox" name="option-ws-comments" id="option-ws-comments">
<label for="option-ws-comments" data-i18n="option_ws_comments"></label>
<label class="option-node">
<input type="checkbox" name="option-ws-comments-color-fadeout">
<span data-i18n="option_ws_comments_color_fadeout"></span>
</label>
<label class="option-node">
<input type="checkbox" name="option-ws-comments-notifications">
<span data-i18n="option_ws_comments_notifications"></span>
</label>
</div>
<div class="option-node">
<input type="checkbox" name="option-ws-posts" id="option-ws-posts">
<label for="option-ws-posts" data-i18n="option_ws_posts"></label>
<label class="option-node">
<input type="checkbox" name="option-ws-posts-add" disabled>
<span data-i18n="option_ws_posts_add"></span>
</label>
<label class="option-node">
<input type="checkbox" name="option-ws-posts-notifications">
<span data-i18n="option_ws_posts_notifications"></span>
</label>
</div>
</div>
</section>
<section class="tabs-content-item" id="feedback">
<div data-i18n="options_feedback_text"></div>
</section>
</form>
</main>
<p class="saved hidden" data-i18n="options_text_saved"></p>
<footer class="footer">
<p>Point+ <span id="version"></span> by
<a href="https://skobkin-ru.point.im/" target="_blank">@skobkin-ru</a>,
<a href="https://isqua.point.im/" target="_blank">@isqua</a>,
<a href="https://nokitakaze.point.im/" target="_blank">@NokitaKaze</a>
</p>
</footer>
<script src="js/options.js"></script>
<script src="js/i18n.js"></script>
</body>
</html>

View File

@ -0,0 +1,18 @@
auxiliary.org-netbeans-modules-css-prep.less_2e_compiler_2e_options=
auxiliary.org-netbeans-modules-css-prep.less_2e_enabled=false
auxiliary.org-netbeans-modules-css-prep.less_2e_mappings=/less:/css
auxiliary.org-netbeans-modules-css-prep.sass_2e_compiler_2e_options=
auxiliary.org-netbeans-modules-css-prep.sass_2e_enabled=false
auxiliary.org-netbeans-modules-css-prep.sass_2e_mappings=/scss:/css
auxiliary.org-netbeans-modules-javascript2-requirejs.enabled=false
auxiliary.org-netbeans-modules-web-clientproject-api.js_2e_libs_2e_folder=node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/linq/observable
browser.autorefresh.Chrome.INTEGRATED=true
browser.highlightselection.Chrome.INTEGRATED=true
config.folder=
file.reference.src-chrome_point_plus=.
files.encoding=UTF-8
grunt.action.build=
site.root.folder=${file.reference.src-chrome_point_plus}
start.file=chrome_point_plus/options.html
test.folder=
web.context.root=/file:///chrome_point_plus

9
nbproject/project.xml Normal file
View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.web.clientproject</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/clientside-project/1">
<name>chrome_point_plus</name>
</data>
</configuration>
</project>

View File

@ -1,8 +0,0 @@
#!/usr/bin/env bash
BROWSER_BINARY=$1
PATH_EXTENSION=$2
PATH_KEY=$3
echo "Packing extension using $BROWSER_BINARY and key from $PATH_KEY"
#echo "$BROWSER_BINARY --pack-extension=$PATH_EXTENSION --pack-extension-key=$PATH_KEY"
eval "$BROWSER_BINARY --pack-extension=$PATH_EXTENSION --pack-extension-key=$PATH_KEY"

View File

@ -1,2 +0,0 @@
#!/usr/bin/env bash
zip -9 -r chrome_point_plus.zip chrome_point_plus

View File

@ -1,12 +1,10 @@
{
"name": "chrome-point-plus",
"version": "1.42.1",
"version": "1.35.1",
"description": "Chrome extension for point.im",
"main": "index.js",
"scripts": {
"postinstall": "./node_modules/.bin/bower install && grunt",
"lint": "./node_modules/.bin/jshint . && ./node_modules/.bin/jscs .",
"test": "npm run lint"
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
@ -17,9 +15,7 @@
"devDependencies": {
"bower": "^1.3.12",
"grunt": "^0.4.5",
"grunt-bump": "^0.3.0",
"grunt-contrib-copy": "^0.7.0",
"jscs": "^1.10.0",
"jshint": "^2.6.0"
"grunt-bump": "git://github.com/nkirkes/grunt-bump.git#nkirkes/restrict-version-key-name",
"grunt-contrib-copy": "^0.7.0"
}
}