From 358d44b3bdfb3fb86c7e59ed8895c7499b7d6447 Mon Sep 17 00:00:00 2001 From: isqua Date: Sat, 31 Jan 2015 20:45:00 +0300 Subject: [PATCH] Add info about Nokita server to options --- chrome_point_plus/_locales/en/messages.json | 2 +- chrome_point_plus/_locales/ru/messages.json | 2 +- chrome_point_plus/modules/booru.js | 11 ++++++----- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/chrome_point_plus/_locales/en/messages.json b/chrome_point_plus/_locales/en/messages.json index 9aa5015..548d89a 100644 --- a/chrome_point_plus/_locales/en/messages.json +++ b/chrome_point_plus/_locales/en/messages.json @@ -60,7 +60,7 @@ "message": "Enable embedding ▼" }, "option_images_load_booru": { - "message": "Load pictures from Booru, Tumblr, etc" + "message": "Load pictures from Booru, Tumblr, etc via NokitaKaze server" }, "option_audios_parse_links": { "message": "Audio from direct links" diff --git a/chrome_point_plus/_locales/ru/messages.json b/chrome_point_plus/_locales/ru/messages.json index 3cfa8e8..82c3561 100644 --- a/chrome_point_plus/_locales/ru/messages.json +++ b/chrome_point_plus/_locales/ru/messages.json @@ -60,7 +60,7 @@ "message": "Включить встраивание ▼" }, "option_images_load_booru": { - "message": "Загружать картинки с Booru, Tumblr и т.п." + "message": "Загружать картинки с Booru, Tumblr и т.п. через сервер Никиты" }, "option_audios_parse_links": { "message": "Аудио по прямой ссылке" diff --git a/chrome_point_plus/modules/booru.js b/chrome_point_plus/modules/booru.js index dd748ac..3dbb66c 100644 --- a/chrome_point_plus/modules/booru.js +++ b/chrome_point_plus/modules/booru.js @@ -16,6 +16,7 @@ function Booru($links, options) { */ Booru.baseUrl = 'https://api.kanaria.ru/point/get_booru_picture.php'; +/* jshint maxlen:false */ Booru.services = { danbooru: { mask: new RegExp('^https?://danbooru\\.donmai\\.us/posts/([0-9]+)', 'i'), @@ -50,13 +51,14 @@ Booru.services = { }, pixiv: { mask: new RegExp('^https?://(www\\.)?pixiv\\.net\\/member_illust\\.php\\?mode\\=medium\\&illust_id\\=([0-9]+)', 'i'), - matchNumber: 2, + matchNumber: 2 }, animepicturesnet: { mask: new RegExp('^http\\:\\/\\/anime\\-pictures\\.net\\/pictures\\/view_post\\/([0-9]+)', 'i'), matchNumber: 1 } }; +/* jshint maxlen:120 */ /** * Обрабатывает все картинки @@ -86,7 +88,7 @@ Booru.prototype.loadAllImages = function($links, removeOriginal) { this.count++; if (removeOriginal) { - $link.remove(); + $link.remove(); } } }); @@ -110,7 +112,7 @@ Booru.prototype.createImageFromService = function(service, href) { if (serviceInfo.params) { for (key in serviceInfo.params) { if (serviceInfo.params.hasOwnProperty(key)) { - params[key] = mathes[serviceInfo.params[key]]; + params[key] = matches[serviceInfo.params[key]]; } } @@ -165,7 +167,6 @@ Booru.prototype.createImage = function(service, id, params) { Booru.prototype.getImageLink = function(service, id, params) { return this.constructor.baseUrl + '?' + $.param($.extend({ domain: service, - id: id, + id: id }, params)); }; -