Compare commits
279 Commits
Author | SHA1 | Date |
---|---|---|
Alexey Skobkin | 787d5b1c37 | |
Alexey Skobkin | 58a38460f9 | |
Alexey Skobkin | 02c0594509 | |
Alexey Skobkin | 552e65520d | |
Alexey Skobkin | af6cf59fdd | |
Alexey Skobkin | 7fcbc7c039 | |
Alexey Skobkin | fe15a1633f | |
Alexey Skobkin | 07b6a8d8bf | |
Alexey Skobkin | afee3205dc | |
Alexey Skobkin | 0674268548 | |
Alexey Skobkin | be749ff31f | |
Alexey Skobkin | 207dff9e67 | |
Alexey Skobkin | b2fc048450 | |
Alexey Skobkin | a771b26952 | |
Alexey Skobkin | 2fc1134124 | |
Alexey Skobkin | 6ee91fbb25 | |
Alexey Skobkin | 072ece28cd | |
Alexey Skobkin | e7a48b467f | |
Alexey Skobkin | 0ba765e181 | |
Alexey Skobkin | 8f75c8d315 | |
Alexey Skobkin | e67eb36443 | |
Alexey Skobkin | ffef920411 | |
Alexey Skobkin | 99760d2eb7 | |
Alexey Skobkin | dc58ac8532 | |
Alexey Skobkin | f91dfc4ba7 | |
Alexey Skobkin | 75bc6636b2 | |
Alexey Skobkin | eecd3133b8 | |
Alexey Skobkin | 06682d3222 | |
Alexey Skobkin | 6c286150fa | |
Alexey Skobkin | 1df716d694 | |
Alexey Skobkin | 7715c43ba1 | |
Alexey Skobkin | 465c10137e | |
Alexey Skobkin | a3a82d6087 | |
isqua | b2d1bfdf4a | |
Alexey Skobkin | cc647700f0 | |
isqua | e865c41504 | |
Alexey Skobkin | a64719424d | |
Alexey Skobkin | 643919c62f | |
Alexey Skobkin | 11b1338841 | |
isqua | af70f93ec0 | |
isqua | d45df7d629 | |
isqua | 4e6d09a774 | |
Alexey Skobkin | 0bea1baa24 | |
Alexey Skobkin | 2a0546fd65 | |
isqua | 0089798f86 | |
Alexey Skobkin | 2d98767bdd | |
Alexey Skobkin | 25fc9af6fa | |
Alexey Skobkin | 4f7fc33cbd | |
isqua | 9d012c676f | |
isqua | 7b4e3f250a | |
isqua | 35b1a2c309 | |
isqua | 00846a56cc | |
isqua | 62e20aca51 | |
isqua | a9a879b273 | |
isqua | 4615113a44 | |
isqua | 5faabf04bd | |
isqua | ec6eb34e22 | |
isqua | ad5ace57cb | |
isqua | 94846f28f3 | |
isqua | 13ee04dcc2 | |
isqua | a5accb5be3 | |
isqua | 6b7df230b6 | |
isqua | 639b72620b | |
isqua | 74c0e0319f | |
isqua | 0a2b4c7538 | |
isqua | bd2aa28afc | |
isqua | 98982c6145 | |
isqua | 82b88b2146 | |
isqua | 2af04fb767 | |
isqua | eb32411fa7 | |
isqua | 81ad370af1 | |
isqua | 358d44b3bd | |
isqua | 795298c94f | |
Alexey Skobkin | f8e573a8b5 | |
isqua | fe6381ccfd | |
isqua | 18e75842f8 | |
isqua | a2f6aab453 | |
isqua | 82c2ef8442 | |
isqua | fad1e5e689 | |
isqua | cb7cb397c1 | |
Alexey Skobkin | d35dc6036e | |
isqua | 1f97b6d19c | |
isqua | 0f9cb4e167 | |
isqua | 08fa6c7bfa | |
isqua | 21cab163d5 | |
Alexey Skobkin | 068c461070 | |
isqua | 54966185d1 | |
isqua | fa02bd8f7b | |
Alexey Skobkin | 5f88797a93 | |
Alexey Skobkin | 62673d3790 | |
Alexey Skobkin | eb6b67f612 | |
isqua | 13aa8595e7 | |
Alexey Skobkin | d818c7dc66 | |
Alexey Skobkin | 6a951ea8d3 | |
Alexey Skobkin | f7d399c41a | |
Alexey Skobkin | 3e6e3d5855 | |
Alexey Skobkin | aa7b9649d1 | |
Alexey Skobkin | 684f6c15fe | |
Alexey Skobkin | 429c432dc5 | |
Alexey Skobkin | afa1ef0fb0 | |
isqua | 633410061a | |
isqua | 49328a4b4a | |
isqua | 4a8d6f49f4 | |
Alexey Skobkin | d90ebd48f3 | |
isqua | 552b997ba3 | |
isqua | b7768ca8a9 | |
isqua | 26893fbb4f | |
Alexey Skobkin | 0eca347c7d | |
Alexey Skobkin | 9bf72cbeb0 | |
Alexey Skobkin | 5d3e09d99c | |
Alexey Skobkin | 2fb3dca119 | |
Alexey Skobkin | 454976daa7 | |
Alexey Skobkin | e30b440956 | |
Alexey Skobkin | 60d5a7351e | |
isqua | 46c430a3d8 | |
Alexey Skobkin | 612052e5ca | |
Alexey Skobkin | 4203ba62ed | |
Alexey Skobkin | 2a5e9da2d8 | |
Alexey Skobkin | 6d6a9fa3d6 | |
Alexey Skobkin | 56bd3117ec | |
Alexey Skobkin | c5ba450afe | |
Alexey Skobkin | dcb1dcf529 | |
Alexey Skobkin | 26b5da4e93 | |
Alexey Skobkin | fadfc43aa1 | |
Alexey Skobkin | b49ecaf937 | |
Alexey Skobkin | 01387be169 | |
Alexey Skobkin | c4e6683c80 | |
isqua | 1a190e04e8 | |
isqua | bf9e8940ed | |
Alexey Skobkin | 62e357dad6 | |
Alexey Skobkin | 1b5cd3ce97 | |
isqua | 338fd8682a | |
Alexey Skobkin | f12cdc0b9f | |
Alexey Skobkin | ffc6ce084b | |
isqua | aabd83881a | |
isqua | 08a94616cc | |
isqua | 23dcf17f3f | |
Alexey Skobkin | bb5f9f87f0 | |
Alexey Skobkin | 8fccbe9137 | |
Alexey Skobkin | 1820146431 | |
Alexey Skobkin | fa5c12539e | |
Alexey Skobkin | 438e7b15fa | |
Alexey Skobkin | 3499dd317a | |
Alexey Skobkin | 96a640d57f | |
Alexey Skobkin | 7db44c4715 | |
Alexey Skobkin | e894e2756b | |
Alexey Skobkin | 3c66c1fbb5 | |
Alexey Skobkin | e8bbd4dc36 | |
Alexey Skobkin | c0e18f8807 | |
Alexey Skobkin | 8f9d880cb2 | |
Alexey Skobkin | 27e97f138b | |
Alexey Skobkin | 0dae3f8661 | |
Alexey Skobkin | 93a24c57d4 | |
Alexey Skobkin | 180d58b464 | |
isqua | 769d1bb71a | |
Alexey Skobkin | cb2ca9766b | |
Alexey Skobkin | a8f430deb4 | |
Alexey Skobkin | 0f87a60f64 | |
Alexey Skobkin | 3a059fe899 | |
isqua | 1057506f05 | |
Alexey Skobkin | 21eb253031 | |
Alexey Skobkin | f32dfa9cce | |
Alexey Skobkin | 194b7c63fc | |
Alexey Skobkin | a62d45c8c1 | |
isqua | d02b78d25d | |
skobkin | 3447244261 | |
Alexey Skobkin | 9c365446eb | |
isqua | 1ced5d9c49 | |
Sofya Ilinova | 4bf58b0927 | |
Alexey Skobkin | b750f50f3c | |
Nokita Kaze | 4165bb0d97 | |
Nokita Kaze | 5e88304b72 | |
Nokita Kaze | 95f8dab7f5 | |
Nokita Kaze | 993a446a5c | |
Alexey Skobkin | 9b42e4b982 | |
Никита Ветров | 3f820c5b39 | |
isqua | ce79f820ba | |
Nokita Kaze | 98367c52c0 | |
Никита Ветров | b26eeea548 | |
Alexey Skobkin | ead197bf78 | |
Nokita Kaze | e3a2a71b2a | |
Nokita Kaze | e6d8c31d7a | |
Nokita Kaze | d166ece3dd | |
Sofya Ilinova | 311bbc55e1 | |
Nokita Kaze | 8287bf4da1 | |
Nokita Kaze | 4df5409ba2 | |
Nokita Kaze | 865f489dc0 | |
Никита Ветров | 442cb4ad15 | |
Nokita Kaze | 026130913c | |
Nokita Kaze | 6c054b8dba | |
Alexey Skobkin | 4a98f8d317 | |
Sofya Ilinova | 26b5ac3fe8 | |
Sofya Ilinova | 7e324cd3bf | |
Sofya Ilinova | 0b33ae6322 | |
Sofya Ilinova | c732ad74d0 | |
Nokita Kaze | 17b7274665 | |
Nokita Kaze | 96dbb19ea4 | |
Nokita Kaze | 0599990e2d | |
Nokita Kaze | c56e31c14c | |
Nokita Kaze | 0aa4e8c886 | |
Nokita Kaze | c46b58fb0e | |
Nokita Kaze | b41b20e5eb | |
Nokita Kaze | 6110aa6785 | |
Nokita Kaze | 8d368ab4a6 | |
Nokita Kaze | 6777d8b241 | |
Nokita Kaze | fbe0b698c2 | |
Никита Ветров | 0d4051855b | |
Sofya Ilinova | 0ea6b24e88 | |
Sofya Ilinova | 18299ea0a6 | |
Alexey Skobkin | f931fedd29 | |
Никита Ветров | 9c96fc54db | |
Alexey Skobkin | 48f49af2a4 | |
Alexey Skobkin | 882f6627a8 | |
Nokita Kaze | 2a8ac706c9 | |
Nokita Kaze | 4b13936dfa | |
Nokita Kaze | 817ef68473 | |
Nokita Kaze | 572f137b5d | |
Nokita Kaze | d14e69c7b5 | |
Nokita Kaze | 3aad05956e | |
Никита Ветров | 6d8368be93 | |
Alexey Skobkin | b4a039843d | |
Alexey Skobkin | fbec7b4a2d | |
Alexey Skobkin | b607c04045 | |
Alexey Skobkin | 699fd726c4 | |
Alexey Skobkin | 5293443c86 | |
Никита Ветров | 11511d9fdf | |
Alexey Skobkin | ceb01f9d8d | |
Никита Ветров | 5590f32163 | |
Alexey Skobkin | 082e7dbdb2 | |
Alexey Skobkin | a742438da7 | |
Alexey Skobkin | 8f5a6d7185 | |
Alexey Skobkin | b28d228513 | |
Nokita Kaze | 1b34833f7c | |
Nokita Kaze | 3d9e54b62d | |
Никита Ветров | 79fad70964 | |
Alexey Skobkin | d749c1e2c5 | |
Alexey Skobkin | 34cc000ef8 | |
Alexey Skobkin | 282314d9d6 | |
Alexey Skobkin | dcf7346078 | |
Nokita Kaze | 7b7836b2b2 | |
Nokita Kaze | ae7b78ac16 | |
Nokita Kaze | 7bbbf90582 | |
Nokita Kaze | 0ca4d58805 | |
Nokita Kaze | 16b86255ec | |
Никита Ветров | ff51da8c3a | |
Alexey Skobkin | bedb73e754 | |
Alexey Skobkin | 33db041b92 | |
Никита Ветров | f47e2b52fd | |
Alexey Skobkin | 3243242583 | |
Никита Ветров | 0125014935 | |
Alexey Skobkin | 320869316e | |
Nokita Kaze | d308786127 | |
Nokita Kaze | efd276deec | |
Nokita Kaze | 78defcc344 | |
Nokita Kaze | 7970c15c92 | |
Nokita Kaze | e3f5358ad0 | |
Никита Ветров | 185339769f | |
Alexey Skobkin | 322e8a6edd | |
Alexey Skobkin | 898a9ecb21 | |
Alexey Skobkin | aef434a8a8 | |
Alexey Skobkin | 93362d112a | |
Nokita Kaze | 80d0686cbf | |
Nokita Kaze | 23a6897289 | |
Никита Ветров | 3a756b7452 | |
Alexey Skobkin | d07a560233 | |
Nokita Kaze | 3c399fab5e | |
Никита Ветров | 5519280c3d | |
Alexey Skobkin | bc29a53984 | |
Alexey Skobkin | dbd857b9a7 | |
Alexey Skobkin | 6951f07bdd | |
Alexey Skobkin | 7a23b3a518 | |
Alexey Skobkin | 599ccc551c | |
Alexey Skobkin | 8d1222766c | |
Alexey Skobkin | b57492bb5f | |
Alexey Skobkin | 06f03697b9 | |
Alexey Skobkin | a620fb954c | |
Никита Ветров | 7a73404f98 | |
Alexey Skobkin | ab4abe7337 | |
Nokita Kaze | bbbb97ca5f |
|
@ -0,0 +1,12 @@
|
|||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
[{package.json,bower.json}]
|
||||
indent_size = 2
|
||||
|
|
@ -1,2 +1,7 @@
|
|||
/nbproject/private/
|
||||
chrome_point_plus/vendor/
|
||||
/nbproject/
|
||||
node_modules/
|
||||
npm-debug.log
|
||||
publish
|
||||
vendor/
|
||||
/.idea/
|
|
@ -0,0 +1,119 @@
|
|||
{
|
||||
"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/**"
|
||||
]
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
.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/**
|
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
"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
|
||||
}
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
var vendorCopy = [
|
||||
'jquery/dist/jquery.min.js',
|
||||
|
||||
'fancybox/source/jquery.fancybox.pack.js',
|
||||
'fancybox/source/helpers/jquery.fancybox-media.js',
|
||||
'fancybox/source/jquery.fancybox.css',
|
||||
|
||||
'markitup/markitup/jquery.markitup.js',
|
||||
'markitup/markitup/skins/markitup/style.css',
|
||||
|
||||
'soundcloud/soundcloud.player.api.js'
|
||||
].map(function(file) {
|
||||
return {
|
||||
src: 'vendor/' + file,
|
||||
dest: 'chrome_point_plus/vendor/' + file
|
||||
};
|
||||
});
|
||||
|
||||
vendorCopy.push({
|
||||
expand: true,
|
||||
src: [
|
||||
'vendor/fancybox/source/*.png',
|
||||
'vendor/fancybox/source/*.gif'
|
||||
],
|
||||
dest: 'chrome_point_plus/'
|
||||
});
|
||||
|
||||
/* global module */
|
||||
module.exports = function(grunt) {
|
||||
// Настройки
|
||||
grunt.initConfig({
|
||||
pkg: grunt.file.readJSON('package.json'),
|
||||
// Что копировать
|
||||
copy: {
|
||||
main: {
|
||||
files: vendorCopy
|
||||
}
|
||||
},
|
||||
bump: {
|
||||
options: {
|
||||
files: [ 'package.json', 'bower.json', 'chrome_point_plus/manifest.json' ],
|
||||
commit: true,
|
||||
commitMessage: 'Release %VERSION%',
|
||||
commitFiles: [ 'package.json', 'bower.json', 'chrome_point_plus/manifest.json' ],
|
||||
createTag: true,
|
||||
tagName: '%VERSION%',
|
||||
tagMessage: 'Version %VERSION%',
|
||||
push: false,
|
||||
gitDescribeOptions: '--tags --always --abbrev=1 --dirty=-d',
|
||||
globalReplace: true
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Загрузить плагины
|
||||
grunt.loadNpmTasks('grunt-contrib-copy');
|
||||
grunt.loadNpmTasks('grunt-bump');
|
||||
|
||||
// Что выполнять по команде `grunt`
|
||||
grunt.registerTask('default', [ 'copy' ]);
|
||||
};
|
|
@ -1,21 +1,21 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Alexey Skobkin
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
The MIT License (MIT), reference http://www.opensource.org/licenses/mit-license.php
|
||||
|
||||
Copyright (c) 2014 Alexey Skobkin <skobkin-ru@ya.ru>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
|
@ -0,0 +1,63 @@
|
|||
# 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
|
||||
```
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"name": "chrome-point-plus",
|
||||
"version": "1.42.1",
|
||||
"authors": [
|
||||
"Alexey Skobkin"
|
||||
],
|
||||
"description": "Chrome extension for point.im",
|
||||
"license": "MIT",
|
||||
"homepage": "https://bitbucket.org/skobkin/chrome_point_plus",
|
||||
"private": true,
|
||||
"ignore": [
|
||||
"**/.*",
|
||||
"node_modules",
|
||||
"chrome_point_plus/vendors/**"
|
||||
],
|
||||
"dependencies": {
|
||||
"jquery": "~3",
|
||||
"fancybox": "~2.1.5",
|
||||
"markitup": "~1.1.14",
|
||||
"soundcloud": "git@github.com:soundcloud/Widget-JS-API.git"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,204 @@
|
|||
{
|
||||
"ext_description": {
|
||||
"message": "More features for point.im"
|
||||
},
|
||||
"ext_author": {
|
||||
"message": "Alexey Skobkin"
|
||||
},
|
||||
"ext_page_action_title": {
|
||||
"message": "Settings"
|
||||
},
|
||||
|
||||
"options_page_title": {
|
||||
"message": "Point+ settings"
|
||||
},
|
||||
|
||||
"options_text_saved": {
|
||||
"message": "Reload page to apply changes."
|
||||
},
|
||||
"options_text_new_version": {
|
||||
"message": "Point+ just updated.\nWould you like to check new features?"
|
||||
},
|
||||
|
||||
|
||||
"options_tabs_media": {
|
||||
"message": "Media"
|
||||
},
|
||||
"options_tabs_other": {
|
||||
"message": "Other"
|
||||
},
|
||||
"options_tabs_websocket": {
|
||||
"message": "WebSockets"
|
||||
},
|
||||
"options_tabs_feedback": {
|
||||
"message": "Feedback"
|
||||
},
|
||||
|
||||
|
||||
"option_fancybox": {
|
||||
"message": "Enable Fancybox ▼"
|
||||
},
|
||||
"option_fancybox_images": {
|
||||
"message": "Use for images"
|
||||
},
|
||||
"option_fancybox_videos": {
|
||||
"message": "Use for videos (YouTube, etc)"
|
||||
},
|
||||
"option_fancybox_posts": {
|
||||
"message": "Use for post links"
|
||||
},
|
||||
"option_fancybox_bind_images_to_one_flow": {
|
||||
"message": "Bind all images to one Fancybox gallery"
|
||||
},
|
||||
"option_images_load_original": {
|
||||
"message": "Load original images instead of thumbnails"
|
||||
},
|
||||
"option_embedding": {
|
||||
"message": "Enable embedding ▼"
|
||||
},
|
||||
"option_images_load_booru": {
|
||||
"message": "Load pictures from Booru, Tumblr, etc via @NokitaKaze server"
|
||||
},
|
||||
"option_audios_parse_links": {
|
||||
"message": "Audio from direct links"
|
||||
},
|
||||
"option_videos_parse_links": {
|
||||
"message": "Video from direct links ▼"
|
||||
},
|
||||
"option_videos_parse_webm": {
|
||||
"message": "Only webm"
|
||||
},
|
||||
"option_videos_parse_all_links": {
|
||||
"message": "Parse all links"
|
||||
},
|
||||
"option_embedding_soundcloud": {
|
||||
"message": "Soundcloud"
|
||||
},
|
||||
"option_embedding_pleercom": {
|
||||
"message": "Pleer.com"
|
||||
},
|
||||
"option_embedding_coubcom": {
|
||||
"message": "Coub.com"
|
||||
},
|
||||
"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"
|
||||
},
|
||||
"option_nsfw_hide_posts":{
|
||||
"message": "Hide posts with `nsfw` tag from feed"
|
||||
},
|
||||
"option_nsfw_blur_posts_images": {
|
||||
"message": "Blur images in nsfw posts"
|
||||
},
|
||||
"option_nsfw_blur_posts_entire": {
|
||||
"message": "Blur entire nsfw posts"
|
||||
},
|
||||
"option_nsfw_blur_comments_images": {
|
||||
"message": "Blur images in comments in nsfw posts"
|
||||
},
|
||||
"option_nsfw_blur_comments_entire": {
|
||||
"message": "Blur entire comments in nsfw posts"
|
||||
},
|
||||
"option_ajax": {
|
||||
"message": "AJAX"
|
||||
},
|
||||
"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"
|
||||
},
|
||||
"option_visual_editor_post": {
|
||||
"message": "Show visual editor for posts"
|
||||
},
|
||||
"option_search_with_google": {
|
||||
"message": "Use Google search in header"
|
||||
},
|
||||
"option_ws": {
|
||||
"message": "Enable WebSockets ▼"
|
||||
},
|
||||
"option_ws_comments": {
|
||||
"message": "Process comments ▼"
|
||||
},
|
||||
"option_ws_comments_color_fadeout": {
|
||||
"message": "Fade out highlight in 20 sec"
|
||||
},
|
||||
"option_ws_comments_notifications": {
|
||||
"message": "Show desktop notifications"
|
||||
},
|
||||
"option_ws_posts": {
|
||||
"message": "Process posts ▼"
|
||||
},
|
||||
"option_ws_posts_add": {
|
||||
"message": "Add posts to the feed"
|
||||
},
|
||||
"option_ws_posts_notifications": {
|
||||
"message": "Show desktop notifications"
|
||||
},
|
||||
"option_enlarge_font": {
|
||||
"message": "Enlarge font size ▼"
|
||||
},
|
||||
"option_at_before_username": {
|
||||
"message": "@ before username"
|
||||
},
|
||||
"option_other_hightlight_post_comments": {
|
||||
"message": "Highlight post with new comments"
|
||||
},
|
||||
"option_other_show_recommendation_count": {
|
||||
"message": "Show recommendation count and unique commentators count (using @NokitaKaze server)"
|
||||
},
|
||||
|
||||
"option_other_scroll_space_key":{
|
||||
"message": "Scrolling posts with `space` key"
|
||||
},
|
||||
"option_other_comments_nesting_level":{
|
||||
"message": "Comments Nesting level indicator"
|
||||
},
|
||||
"option_other_comments_user_system":{
|
||||
"message": "Your hints about users"
|
||||
},
|
||||
"option_other_comments_count_refresh":{
|
||||
"message": "Refresh unread posts and comments count in the sidebar"
|
||||
},
|
||||
"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"
|
||||
},
|
||||
|
||||
"options_feedback_text": {
|
||||
"message": "<p>If you find an error do not hesitate to <a href=\"https:\/\/bitbucket.org\/skobkin\/chrome_point_plus\/issues?status=new&status=open\" target=\"_blank\">send me a bug report<\/a>.<\/p><p>Also you can make a donation in the following ways:<\/p><p><iframe frameborder=\"0\" allowtransparency=\"true\" scrolling=\"no\" src=\"https:\/\/money.yandex.ru\/embed\/small.xml?account=41001539215836&quickpay=small&yamoney-payment-type=on&button-text=04&button-size=s&button-color=black&targets=Point%2B&default-sum=150&successURL=https%3A%2F%2Fbitbucket.org%2Fskobkin%2Fchrome_point_plus\" width=\"158\" height=\"31\"><\/p><p><\/iframe><\/p><p><iframe frameborder=\"0\" allowtransparency=\"true\" scrolling=\"no\" src=\"https:\/\/money.yandex.ru\/embed\/small.xml?account=41001539215836&quickpay=small&any-card-payment-type=on&button-text=04&button-size=s&button-color=black&targets=Point%2B&default-sum=150&successURL=https%3A%2F%2Fbitbucket.org%2Fskobkin%2Fchrome_point_plus\" width=\"158\" height=\"31\"><\/iframe><\/p><p><form action=\"https:\/\/www.paypal.com\/cgi-bin\/webscr\" method=\"post\" target=\"_top\"><input type=\"hidden\" name=\"cmd\" value=\"_s-xclick\"><input type=\"hidden\" name=\"hosted_button_id\" value=\"RCW5V6UFXYTRE\"><input type=\"image\" src=\"https:\/\/www.paypalobjects.com\/ru_RU\/RU\/i\/btn\/btn_donateCC_LG.gif\" border=\"0\" name=\"submit\" alt=\"PayPal — более безопасный и легкий способ оплаты через Интернет!\"><img alt=\"\" border=\"0\" src=\"https:\/\/www.paypalobjects.com\/en_US\/i\/scr\/pixel.gif\" width=\"1\" height=\"1\"><\/form><\/p>"
|
||||
},
|
||||
|
||||
|
||||
"msg_comment_send_failed":{
|
||||
"message": "Comment send error:"
|
||||
},
|
||||
"msg_saving_post_draft":{
|
||||
"message": "Saving the post..."
|
||||
},
|
||||
"msg_success_recommendation": {
|
||||
"message": "is recommended"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,205 @@
|
|||
{
|
||||
"ext_description": {
|
||||
"message": "Больше полезных функций для point.im"
|
||||
},
|
||||
"ext_author": {
|
||||
"message": "Алексей Скобкин"
|
||||
},
|
||||
"ext_page_action_title": {
|
||||
"message": "Настройки"
|
||||
},
|
||||
|
||||
"options_page_title": {
|
||||
"message": "Настройки Point+"
|
||||
},
|
||||
|
||||
"options_text_saved": {
|
||||
"message": "Для применения изменений перезагрузите страницу."
|
||||
},
|
||||
"options_text_new_version": {
|
||||
"message": "Point+ только что обновился.\nХотите оценить новые функции?"
|
||||
},
|
||||
|
||||
|
||||
"options_tabs_media": {
|
||||
"message": "Медиа"
|
||||
},
|
||||
"options_tabs_other": {
|
||||
"message": "Прочее"
|
||||
},
|
||||
"options_tabs_websocket": {
|
||||
"message": "Вебсокеты"
|
||||
},
|
||||
"options_tabs_feedback": {
|
||||
"message": "Связь и донейт"
|
||||
},
|
||||
|
||||
|
||||
"option_fancybox": {
|
||||
"message": "Включить Fancybox ▼"
|
||||
},
|
||||
"option_fancybox_images": {
|
||||
"message": "Использовать для картинок"
|
||||
},
|
||||
"option_fancybox_videos": {
|
||||
"message": "Использовать для видео (YouTube и т.п.)"
|
||||
},
|
||||
"option_fancybox_posts": {
|
||||
"message": "Использовать для ссылок на посты"
|
||||
},
|
||||
"option_fancybox_bind_images_to_one_flow": {
|
||||
"message": "Связать все картинки в одну галерею Fancybox"
|
||||
},
|
||||
"option_images_load_original": {
|
||||
"message": "Загружать оригиналы вместо миниатюр"
|
||||
},
|
||||
"option_embedding": {
|
||||
"message": "Включить встраивание ▼"
|
||||
},
|
||||
"option_images_load_booru": {
|
||||
"message": "Загружать картинки с Booru, Tumblr и т.п. через сервер @NokitaKaze"
|
||||
},
|
||||
"option_audios_parse_links": {
|
||||
"message": "Аудио по прямой ссылке"
|
||||
},
|
||||
"option_videos_parse_links": {
|
||||
"message": "Видео по прямой ссылке ▼"
|
||||
},
|
||||
"option_videos_parse_webm": {
|
||||
"message": "Только webm"
|
||||
},
|
||||
"option_videos_parse_all_links": {
|
||||
"message": "Все ссылки на видео"
|
||||
},
|
||||
"option_embedding_soundcloud": {
|
||||
"message": "Soundcloud"
|
||||
},
|
||||
"option_embedding_pleercom": {
|
||||
"message": "Pleer.com"
|
||||
},
|
||||
"option_embedding_coubcom": {
|
||||
"message": "Coub.com"
|
||||
},
|
||||
"option_embedding_twitter_tweets": {
|
||||
"message": "Twitter"
|
||||
},
|
||||
"option_embedding_instagram_posts": {
|
||||
"message": "Instagram"
|
||||
},
|
||||
"option_embedding_remove_original_link": {
|
||||
"message": "Удалять оригинальную ссылку"
|
||||
},
|
||||
"option_nsfw": {
|
||||
"message": "Фильтрация NSFW-контента"
|
||||
},
|
||||
"option_nsfw_hide_posts":{
|
||||
"message": "Скрывать посты из ленты"
|
||||
},
|
||||
"option_nsfw_blur_posts_images": {
|
||||
"message": "Размытие картинок в постах"
|
||||
},
|
||||
"option_nsfw_blur_posts_entire": {
|
||||
"message": "Размытие постов полностью"
|
||||
},
|
||||
"option_nsfw_blur_comments_images": {
|
||||
"message": "Размытие картинок в комментариях"
|
||||
},
|
||||
"option_nsfw_blur_comments_entire": {
|
||||
"message": "Размытие комментариев целиком"
|
||||
},
|
||||
"option_ajax": {
|
||||
"message": "AJAX"
|
||||
},
|
||||
"option_ajax_comments": {
|
||||
"message": "Отправка комментариев через AJAX (CTRL+Enter)"
|
||||
},
|
||||
"option_right_panel": {
|
||||
"message": "Боковая панель справа"
|
||||
},
|
||||
"option_right_panel_to_unread": {
|
||||
"message": "Кнопка \"Перейти к непрочитанному\""
|
||||
},
|
||||
"option_fluid_layout": {
|
||||
"message": ""Резиновая" вёрстка (растянуть сайт по горизонтали)"
|
||||
},
|
||||
"option_visual_editor_post": {
|
||||
"message": "Визуальный редактор постов"
|
||||
},
|
||||
"option_search_with_google": {
|
||||
"message": "Поиск по сайту с помощью Google"
|
||||
},
|
||||
"option_ws": {
|
||||
"message": "Включить вебсокеты ▼"
|
||||
},
|
||||
"option_ws_comments": {
|
||||
"message": "Получать комментарии ▼"
|
||||
},
|
||||
"option_ws_comments_color_fadeout": {
|
||||
"message": "Затухание подсветки через 20 секунд"
|
||||
},
|
||||
"option_ws_comments_notifications": {
|
||||
"message": "Показывать всплывающие уведомления"
|
||||
},
|
||||
"option_ws_posts": {
|
||||
"message": "Обрабатывать посты ▼"
|
||||
},
|
||||
"option_ws_posts_add": {
|
||||
"message": "Автоматически добавлять в ленту"
|
||||
},
|
||||
"option_ws_posts_notifications": {
|
||||
"message": "Показывать всплывающие уведомления"
|
||||
},
|
||||
"option_enlarge_font": {
|
||||
"message": "Увеличить шрифт ▼"
|
||||
},
|
||||
"option_at_before_username": {
|
||||
"message": "Пёс перед юзернеймом"
|
||||
},
|
||||
"option_other_hightlight_post_comments": {
|
||||
"message": "Подсвечивать посты с новыми комментариями"
|
||||
},
|
||||
"option_other_show_recommendation_count": {
|
||||
"message": "Показывать количество рекомендаций и уникальных комментаторов в посте (используя сервер @NokitaKaze)"
|
||||
},
|
||||
|
||||
"option_other_scroll_space_key":{
|
||||
"message": "Скроллинг постов пробелом"
|
||||
},
|
||||
"option_other_comments_nesting_level":{
|
||||
"message": "Индикатор уровня вложенности коммнентариев"
|
||||
},
|
||||
"option_other_comments_user_system":{
|
||||
"message": "Заметки о пользователях на полях"
|
||||
},
|
||||
"option_other_comments_count_refresh":{
|
||||
"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": "Сохранение черновика поста"
|
||||
},
|
||||
|
||||
|
||||
"options_feedback_text": {
|
||||
"message": "<p>Нашли ошибку? Не стесняйтесь <a href=\"https:\/\/bitbucket.org\/skobkin\/chrome_point_plus\/issues?status=new&status=open\" target=\"_blank\">сообщить о ней<\/a>.<\/p><p>Также вы можете сделать пожертвование автору:<\/p><p><iframe frameborder=\"0\" allowtransparency=\"true\" scrolling=\"no\" src=\"https:\/\/money.yandex.ru\/embed\/small.xml?account=41001539215836&quickpay=small&yamoney-payment-type=on&button-text=04&button-size=s&button-color=black&targets=Point%2B&default-sum=150&successURL=https%3A%2F%2Fbitbucket.org%2Fskobkin%2Fchrome_point_plus\" width=\"158\" height=\"31\"><\/iframe><\/p><p><iframe frameborder=\"0\" allowtransparency=\"true\" scrolling=\"no\" src=\"https:\/\/money.yandex.ru\/embed\/small.xml?account=41001539215836&quickpay=small&any-card-payment-type=on&button-text=04&button-size=s&button-color=black&targets=Point%2B&default-sum=150&successURL=https%3A%2F%2Fbitbucket.org%2Fskobkin%2Fchrome_point_plus\" width=\"158\" height=\"31\"><\/iframe><\/p><p><form action=\"https:\/\/www.paypal.com\/cgi-bin\/webscr\" method=\"post\" target=\"_top\"><input type=\"hidden\" name=\"cmd\" value=\"_s-xclick\"><input type=\"hidden\" name=\"hosted_button_id\" value=\"WW33X5J5WFSP4\"><input type=\"image\" src=\"https:\/\/www.paypalobjects.com\/ru_RU\/RU\/i\/btn\/btn_donateCC_LG.gif\" border=\"0\" name=\"submit\" alt=\"PayPal — более безопасный и легкий способ оплаты через Интернет!\"><img alt=\"\" border=\"0\" src=\"https:\/\/www.paypalobjects.com\/en_US\/i\/scr\/pixel.gif\" width=\"1\" height=\"1\"><\/form><\/p>"
|
||||
},
|
||||
|
||||
|
||||
"msg_comment_send_failed":{
|
||||
"message": "Ошибка отправки комментария:"
|
||||
},
|
||||
"msg_saving_post_draft":{
|
||||
"message": "Сохранение поста..."
|
||||
},
|
||||
"msg_success_recommendation": {
|
||||
"message": "рекомендовано"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
Created on : Jan 7, 2015, 8:58:42 AM
|
||||
Author : skobkin
|
||||
*/
|
||||
|
||||
/* Fancybox fix */
|
||||
#fancybox-loading, .fancybox-close, .fancybox-prev span, .fancybox-next span {
|
||||
background-image: url('chrome-extension://__MSG_@@extension_id__/vendor/fancybox/source/fancybox_sprite.png');
|
||||
}
|
||||
|
||||
#fancybox-loading div {
|
||||
background-image: url('chrome-extension://__MSG_@@extension_id__/vendor/fancybox/source/fancybox_loading.gif');
|
||||
}
|
||||
|
||||
.fancybox-overlay {
|
||||
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');
|
||||
}
|
||||
|
||||
#fancybox-loading div {
|
||||
background-image: url('chrome-extension://__MSG_@@extension_id__/vendor/fancybox/source/fancybox_loading@2x.gif');
|
||||
}
|
||||
}
|
|
@ -1,274 +0,0 @@
|
|||
/*! fancyBox v2.1.5 fancyapps.com | fancyapps.com/fancybox/#license */
|
||||
.fancybox-wrap,
|
||||
.fancybox-skin,
|
||||
.fancybox-outer,
|
||||
.fancybox-inner,
|
||||
.fancybox-image,
|
||||
.fancybox-wrap iframe,
|
||||
.fancybox-wrap object,
|
||||
.fancybox-nav,
|
||||
.fancybox-nav span,
|
||||
.fancybox-tmp
|
||||
{
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
border: 0;
|
||||
outline: none;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.fancybox-wrap {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 8020;
|
||||
}
|
||||
|
||||
.fancybox-skin {
|
||||
position: relative;
|
||||
background: #f9f9f9;
|
||||
color: #444;
|
||||
text-shadow: none;
|
||||
-webkit-border-radius: 4px;
|
||||
-moz-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.fancybox-opened {
|
||||
z-index: 8030;
|
||||
}
|
||||
|
||||
.fancybox-opened .fancybox-skin {
|
||||
-webkit-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
|
||||
-moz-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
|
||||
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
.fancybox-outer, .fancybox-inner {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.fancybox-inner {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.fancybox-type-iframe .fancybox-inner {
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
.fancybox-error {
|
||||
color: #444;
|
||||
font: 14px/20px "Helvetica Neue",Helvetica,Arial,sans-serif;
|
||||
margin: 0;
|
||||
padding: 15px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.fancybox-image, .fancybox-iframe {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.fancybox-image {
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
}
|
||||
|
||||
#fancybox-loading, .fancybox-close, .fancybox-prev span, .fancybox-next span {
|
||||
background-image: url('chrome-extension://__MSG_@@extension_id__/images/fancybox_sprite.png');
|
||||
}
|
||||
|
||||
#fancybox-loading {
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
margin-top: -22px;
|
||||
margin-left: -22px;
|
||||
background-position: 0 -108px;
|
||||
opacity: 0.8;
|
||||
cursor: pointer;
|
||||
z-index: 8060;
|
||||
}
|
||||
|
||||
#fancybox-loading div {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
background: url('chrome-extension://__MSG_@@extension_id__/images/fancybox_loading.gif') center center no-repeat;
|
||||
}
|
||||
|
||||
.fancybox-close {
|
||||
position: absolute;
|
||||
top: -18px;
|
||||
right: -18px;
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
cursor: pointer;
|
||||
z-index: 8040;
|
||||
}
|
||||
|
||||
.fancybox-nav {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
width: 40%;
|
||||
height: 100%;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
background: transparent url('chrome-extension://__MSG_@@extension_id__/images/blank.gif'); /* helps IE */
|
||||
-webkit-tap-highlight-color: rgba(0,0,0,0);
|
||||
z-index: 8040;
|
||||
}
|
||||
|
||||
.fancybox-prev {
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.fancybox-next {
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.fancybox-nav span {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
width: 36px;
|
||||
height: 34px;
|
||||
margin-top: -18px;
|
||||
cursor: pointer;
|
||||
z-index: 8040;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.fancybox-prev span {
|
||||
left: 10px;
|
||||
background-position: 0 -36px;
|
||||
}
|
||||
|
||||
.fancybox-next span {
|
||||
right: 10px;
|
||||
background-position: 0 -72px;
|
||||
}
|
||||
|
||||
.fancybox-nav:hover span {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
.fancybox-tmp {
|
||||
position: absolute;
|
||||
top: -99999px;
|
||||
left: -99999px;
|
||||
visibility: hidden;
|
||||
max-width: 99999px;
|
||||
max-height: 99999px;
|
||||
overflow: visible !important;
|
||||
}
|
||||
|
||||
/* Overlay helper */
|
||||
|
||||
.fancybox-lock {
|
||||
overflow: hidden !important;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.fancybox-lock body {
|
||||
overflow: hidden !important;
|
||||
}
|
||||
|
||||
.fancybox-lock-test {
|
||||
overflow-y: hidden !important;
|
||||
}
|
||||
|
||||
.fancybox-overlay {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
overflow: hidden;
|
||||
display: none;
|
||||
z-index: 8010;
|
||||
background: url('chrome-extension://__MSG_@@extension_id__/images/fancybox_overlay.png');
|
||||
}
|
||||
|
||||
.fancybox-overlay-fixed {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.fancybox-lock .fancybox-overlay {
|
||||
overflow: auto;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
/* Title helper */
|
||||
|
||||
.fancybox-title {
|
||||
visibility: hidden;
|
||||
font: normal 13px/20px "Helvetica Neue",Helvetica,Arial,sans-serif;
|
||||
position: relative;
|
||||
text-shadow: none;
|
||||
z-index: 8050;
|
||||
}
|
||||
|
||||
.fancybox-opened .fancybox-title {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
.fancybox-title-float-wrap {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
right: 50%;
|
||||
margin-bottom: -35px;
|
||||
z-index: 8050;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.fancybox-title-float-wrap .child {
|
||||
display: inline-block;
|
||||
margin-right: -100%;
|
||||
padding: 2px 20px;
|
||||
background: transparent; /* Fallback for web browsers that doesn't support RGBa */
|
||||
background: rgba(0, 0, 0, 0.8);
|
||||
-webkit-border-radius: 15px;
|
||||
-moz-border-radius: 15px;
|
||||
border-radius: 15px;
|
||||
text-shadow: 0 1px 2px #222;
|
||||
color: #FFF;
|
||||
font-weight: bold;
|
||||
line-height: 24px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.fancybox-title-outside-wrap {
|
||||
position: relative;
|
||||
margin-top: 10px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.fancybox-title-inside-wrap {
|
||||
padding-top: 10px;
|
||||
}
|
||||
|
||||
.fancybox-title-over-wrap {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
color: #fff;
|
||||
padding: 10px;
|
||||
background: #000;
|
||||
background: rgba(0, 0, 0, .8);
|
||||
}
|
||||
|
||||
/*Retina graphics!*/
|
||||
@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
|
||||
only screen and (min--moz-device-pixel-ratio: 1.5),
|
||||
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__/images/fancybox_sprite@2x.png');
|
||||
background-size: 44px 152px; /*The size of the normal image, half the size of the hi-res image*/
|
||||
}
|
||||
|
||||
#fancybox-loading div {
|
||||
background-image: url('chrome-extension://__MSG_@@extension_id__/images/fancybox_loading@2x.gif');
|
||||
background-size: 24px 24px; /*The size of the normal image, half the size of the hi-res image*/
|
||||
}
|
||||
}
|
|
@ -51,4 +51,4 @@
|
|||
|
||||
.markItUp .preview a {
|
||||
background-image:url(chrome-extension://__MSG_@@extension_id__/images/markitup/sets/markdown/preview.png);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,147 +1,36 @@
|
|||
/* -------------------------------------------------------------------
|
||||
// markItUp! Universal MarkUp Engine, JQuery plugin
|
||||
// By Jay Salvat - http://markitup.jaysalvat.com/
|
||||
// ------------------------------------------------------------------*/
|
||||
.markItUp * {
|
||||
margin:0px; padding:0px;
|
||||
outline:none;
|
||||
}
|
||||
.markItUp a:link,
|
||||
.markItUp a:visited {
|
||||
color:#000;
|
||||
text-decoration:none;
|
||||
}
|
||||
.markItUp {
|
||||
width:700px;
|
||||
margin:5px 0 5px 0;
|
||||
border:5px solid #F5F5F5;
|
||||
}
|
||||
.markItUpContainer {
|
||||
border:1px solid #3C769D;
|
||||
background:#FFF url(chrome-extension://__MSG_@@extension_id__/images/markitup/skins/markitup/bg-container.png) repeat-x top left;
|
||||
padding:5px 5px 2px 5px;
|
||||
font:11px Verdana, Arial, Helvetica, sans-serif;
|
||||
background-image: url(chrome-extension://__MSG_@@extension_id__/images/markitup/skins/markitup/bg-container.png);
|
||||
}
|
||||
.markItUpEditor {
|
||||
font:12px 'Courier New', Courier, monospace;
|
||||
padding:5px 5px 5px 5px/*35px*/;
|
||||
border:3px solid #3C769D;
|
||||
width:643px;
|
||||
height:320px;
|
||||
/*background:#FFF url(chrome-extension://__MSG_@@extension_id__/images/markitup/skins/markitup/bg-editor.png) no-repeat;*/
|
||||
clear:both;
|
||||
line-height:18px;
|
||||
overflow:auto;
|
||||
}
|
||||
.markItUpPreviewFrame {
|
||||
overflow:auto;
|
||||
background-color:#FFFFFF;
|
||||
border:1px solid #3C769D;
|
||||
width:99.9%;
|
||||
height:300px;
|
||||
margin:5px 0;
|
||||
}
|
||||
.markItUpFooter {
|
||||
width:100%;
|
||||
cursor:n-resize;
|
||||
background: none;
|
||||
/* Padding fix */
|
||||
padding-left: 10px;
|
||||
}
|
||||
.markItUpResizeHandle {
|
||||
overflow:hidden;
|
||||
width:22px; height:5px;
|
||||
margin-left:auto;
|
||||
margin-right:auto;
|
||||
background-image:url(chrome-extension://__MSG_@@extension_id__/images/markitup/skins/markitup/handle.png);
|
||||
cursor:n-resize;
|
||||
background-image:url(chrome-extension://__MSG_@@extension_id__/images/markitup/skins/markitup/handle.png);
|
||||
}
|
||||
/***************************************************************************************/
|
||||
/* first row of buttons */
|
||||
.markItUpHeader ul li {
|
||||
list-style:none;
|
||||
float:left;
|
||||
position:relative;
|
||||
}
|
||||
.markItUpHeader ul li ul{
|
||||
display:none;
|
||||
}
|
||||
.markItUpHeader ul li:hover > ul{
|
||||
display:block;
|
||||
}
|
||||
.markItUpHeader ul .markItUpDropMenu {
|
||||
background:transparent url(chrome-extension://__MSG_@@extension_id__/images/markitup/skins/markitup/menu.png) no-repeat 115% 50%;
|
||||
margin-right:5px;
|
||||
}
|
||||
.markItUpHeader ul .markItUpDropMenu li {
|
||||
margin-right:0px;
|
||||
}
|
||||
.markItUpHeader ul .markItUpSeparator {
|
||||
margin:0 10px;
|
||||
width:1px;
|
||||
height:16px;
|
||||
overflow:hidden;
|
||||
background-color:#CCC;
|
||||
}
|
||||
.markItUpHeader ul ul .markItUpSeparator {
|
||||
width:auto; height:1px;
|
||||
margin:0px;
|
||||
}
|
||||
/* next rows of buttons */
|
||||
.markItUpHeader ul ul {
|
||||
display:none;
|
||||
position:absolute;
|
||||
top:18px; left:0px;
|
||||
background:#F5F5F5;
|
||||
border:1px solid #3C769D;
|
||||
height:inherit;
|
||||
}
|
||||
.markItUpHeader ul ul li {
|
||||
float:none;
|
||||
border-bottom:1px solid #3C769D;
|
||||
background-image: url(chrome-extension://__MSG_@@extension_id__/images/markitup/skins/markitup/menu.png);
|
||||
}
|
||||
.markItUpHeader ul ul .markItUpDropMenu {
|
||||
background:#F5F5F5 url(chrome-extension://__MSG_@@extension_id__/images/markitup/skins/markitup/submenu.png) no-repeat 100% 50%;
|
||||
}
|
||||
/* next rows of buttons */
|
||||
.markItUpHeader ul ul ul {
|
||||
position:absolute;
|
||||
top:-1px; left:150px;
|
||||
}
|
||||
.markItUpHeader ul ul ul li {
|
||||
float:none;
|
||||
}
|
||||
.markItUpHeader ul a {
|
||||
display:block;
|
||||
width:16px; height:16px;
|
||||
text-indent:-10000px;
|
||||
background-repeat:no-repeat;
|
||||
padding:3px;
|
||||
margin:0px;
|
||||
}
|
||||
.markItUpHeader ul ul a {
|
||||
display:block;
|
||||
padding-left:0px;
|
||||
text-indent:0;
|
||||
width:120px;
|
||||
padding:5px 5px 5px 25px;
|
||||
background-position:2px 50%;
|
||||
}
|
||||
.markItUpHeader ul ul a:hover {
|
||||
color:#FFF;
|
||||
background-color:#3C769D;
|
||||
background-image: url(chrome-extension://__MSG_@@extension_id__/images/markitup/skins/markitup/submenu.png);
|
||||
}
|
||||
/***************************************************************************************/
|
||||
.html .markItUpEditor {
|
||||
background-image:url(chrome-extension://__MSG_@@extension_id__/images/markitup/skins/markitup/bg-editor-html.png);
|
||||
background-image: url(chrome-extension://__MSG_@@extension_id__/images/markitup/skins/markitup/bg-editor-html.png);
|
||||
}
|
||||
.markdown .markItUpEditor {
|
||||
background-image:url(chrome-extension://__MSG_@@extension_id__/images/markitup/skins/markitup/bg-editor-markdown.png);
|
||||
background-image: url(chrome-extension://__MSG_@@extension_id__/images/markitup/skins/markitup/bg-editor-markdown.png);
|
||||
}
|
||||
.textile .markItUpEditor {
|
||||
background-image:url(chrome-extension://__MSG_@@extension_id__/images/markitup/skins/markitup/bg-editor-textile.png);
|
||||
background-image: url(chrome-extension://__MSG_@@extension_id__/images/markitup/skins/markitup/bg-editor-textile.png);
|
||||
}
|
||||
.bbcode .markItUpEditor {
|
||||
background-image:url(chrome-extension://__MSG_@@extension_id__/images/markitup/skins/markitup/bg-editor-bbcode.png);
|
||||
background-image: url(chrome-extension://__MSG_@@extension_id__/images/markitup/skins/markitup/bg-editor-bbcode.png);
|
||||
}
|
||||
.wiki .markItUpEditor,
|
||||
.dotclear .markItUpEditor {
|
||||
background-image:url(chrome-extension://__MSG_@@extension_id__/images/markitup/skins/markitup/bg-editor-wiki.png);
|
||||
}
|
||||
background-image: url(chrome-extension://__MSG_@@extension_id__/images/markitup/skins/markitup/bg-editor-wiki.png);
|
||||
}
|
||||
|
|
|
@ -1,8 +1,12 @@
|
|||
/* @ before username */
|
||||
#main #content a.user:before {
|
||||
/* Posts */
|
||||
#content .post-content a.user:before,
|
||||
/* Subscribers */
|
||||
#content .users span.user:before,
|
||||
/* Subscriptions */
|
||||
#content .users .info a.user:before {
|
||||
content: "@";
|
||||
}
|
||||
/* Fix for recommendations in the feed */
|
||||
#main #content .rec .user:before {
|
||||
margin-right: -4px;
|
||||
}
|
||||
/* Fix for recommendations */
|
||||
#content .post-content .rec .user:before {
|
||||
margin-right: -3px;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
#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;
|
||||
}
|
|
@ -0,0 +1,162 @@
|
|||
/* Options page */
|
||||
body
|
||||
{
|
||||
font-family: Arial;
|
||||
font-size: 14px;
|
||||
line-height: 20px;
|
||||
|
||||
width: 450px;
|
||||
height: 450px;
|
||||
margin: 0;
|
||||
padding: 5px;
|
||||
|
||||
color: #000;
|
||||
background: #eee;
|
||||
}
|
||||
|
||||
a
|
||||
{
|
||||
color: #1abef1;
|
||||
}
|
||||
|
||||
p
|
||||
{
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.tabs-list
|
||||
{
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
|
||||
display: block;
|
||||
|
||||
margin: 0 0 -1px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.tabs-item
|
||||
{
|
||||
display: inline-block;
|
||||
|
||||
padding: 7px 15px 3px;
|
||||
|
||||
list-style-type: none;
|
||||
|
||||
text-decoration: none;
|
||||
|
||||
border: 1px solid transparent;
|
||||
}
|
||||
|
||||
.tabs-item.selected
|
||||
{
|
||||
cursor: default;
|
||||
|
||||
border-color: #dedede;
|
||||
border-bottom-color: #fff;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.tabs-content
|
||||
{
|
||||
position: relative;
|
||||
|
||||
height: 345px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
border: 1px solid #dedede;
|
||||
border-radius: 0 0 3px 3px;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.tabs-content::before
|
||||
{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
left: 0;
|
||||
|
||||
height: 20px;
|
||||
|
||||
content: '';
|
||||
|
||||
background-image: linear-gradient(to bottom, rgba(255,255,255,1) 0%, rgba(255,255,255,1) 30%, rgba(255,255,255,0) 100%);
|
||||
background-size: 20px 20px;
|
||||
}
|
||||
|
||||
.tabs-content-item
|
||||
{
|
||||
display: none;
|
||||
overflow: auto;
|
||||
|
||||
box-sizing: border-box;
|
||||
max-height: 100%;
|
||||
margin: 0;
|
||||
padding: 20px 15px 5px;
|
||||
|
||||
border: none;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.tabs-content-item.selected
|
||||
{
|
||||
display: block;
|
||||
}
|
||||
|
||||
input[type='checkbox']
|
||||
{
|
||||
margin-right: 5px;
|
||||
margin-left: 0;
|
||||
|
||||
vertical-align: 1px;
|
||||
}
|
||||
.option-node
|
||||
{
|
||||
display: block;
|
||||
|
||||
padding: 0 0 5px 21px;
|
||||
|
||||
text-indent: -21px;
|
||||
}
|
||||
|
||||
.option-node input[type='checkbox']:not(:checked) ~ .option-node
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.option-node input[type='checkbox']:not(:checked) ~ .option-node label
|
||||
{
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.footer
|
||||
{
|
||||
margin: 0;
|
||||
padding: 10px 15px;
|
||||
}
|
||||
|
||||
.saved
|
||||
{
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
|
||||
margin: -2px 1px 0;
|
||||
padding: 10px 15px;
|
||||
|
||||
transition: all .2s;
|
||||
transform-origin: 50% 0;
|
||||
|
||||
color: #fff;
|
||||
border-top: 1px solid #dedede;
|
||||
border-radius: 0 0 2px 2px;
|
||||
background: #4caf50;
|
||||
}
|
||||
|
||||
.saved.hidden
|
||||
{
|
||||
transform: scaleY(.5);
|
||||
|
||||
opacity: 0;
|
||||
}
|
|
@ -27,131 +27,233 @@ div#markItUpText-input {
|
|||
position: relative;
|
||||
}
|
||||
|
||||
/* Options page */
|
||||
.pp-options {
|
||||
width: 450px;
|
||||
height: 450px;
|
||||
background: #EEE;
|
||||
/* Auto-loaded Booru pictures */
|
||||
.booru_pic, .instagram-post-embedded {
|
||||
display: block !important;
|
||||
float: none !important;
|
||||
}
|
||||
|
||||
/* Tabs style */
|
||||
.pp-options .usual {
|
||||
width:450px;
|
||||
margin: 5px;
|
||||
.booru_pic img, .instagram-post-embedded img {
|
||||
border: none;
|
||||
max-width: 60%;
|
||||
max-height: 300px;
|
||||
}
|
||||
|
||||
.pp-options .usual ul {
|
||||
padding: 0 0 10px 0;
|
||||
margin: 0 0 18px 0;
|
||||
/* Unique ID and Recomendation */
|
||||
.pp-post-counters
|
||||
{
|
||||
float: left;
|
||||
color: #999;
|
||||
font-size: 12px;
|
||||
margin-left: 1em;
|
||||
}
|
||||
|
||||
.pp-options .usual li {
|
||||
list-style: none;
|
||||
float: left;
|
||||
}
|
||||
.pp-options .usual ul a {
|
||||
display: block;
|
||||
padding: 6px 10px;
|
||||
text-decoration: none!important;
|
||||
margin: 1px;
|
||||
margin-left: 0;
|
||||
font: 12px Georgia;
|
||||
color: #FFF;
|
||||
background: #C8C8C8;
|
||||
border-radius: 15px 15px 0 0;
|
||||
}
|
||||
.pp-options .usual ul a:hover {
|
||||
color: #FFF;
|
||||
background: #BBB;
|
||||
}
|
||||
.pp-options .usual ul a.selected {
|
||||
margin-bottom: 0;
|
||||
color: #FFF;
|
||||
background: #A5A5A5;
|
||||
cursor: default;
|
||||
}
|
||||
.pp-options .usual div#tabs-content {
|
||||
margin: 0 5px 0 0;
|
||||
padding: 5px;
|
||||
background-color: #A5A5A5;
|
||||
border-radius: 0 15px 0 0;
|
||||
|
||||
}
|
||||
.pp-options .usual #panel {
|
||||
background: #B5B5B5;
|
||||
margin: 0 5px 0 0;
|
||||
padding: 10px;
|
||||
border-radius: 0 0 15px 15px;
|
||||
display: flex;
|
||||
}
|
||||
.pp-options .usual #panel button.button {
|
||||
background-color: #C8C8C8;
|
||||
border-radius:15px;
|
||||
border:1px solid #dcdcdc;
|
||||
display:inline-block;
|
||||
cursor:pointer;
|
||||
color:#000;
|
||||
font-family:Arial;
|
||||
font-size:15px;
|
||||
font-weight:bold;
|
||||
padding: 5px 25px;
|
||||
text-decoration:none;
|
||||
text-shadow:0px 1px 0px #ffffff;
|
||||
}
|
||||
.pp-options .usual #panel button.button:hover{
|
||||
background-color:#BBB;
|
||||
}
|
||||
.pp-options .usual #panel button.button:active {
|
||||
position:relative;
|
||||
top:1px;
|
||||
.pp-unique-comments
|
||||
{
|
||||
margin-right: .5em;
|
||||
}
|
||||
|
||||
.pp-options .usual div a {
|
||||
color: #000;
|
||||
font-weight: bold;
|
||||
/* @todo i18n */
|
||||
.pp-unique-comments::before
|
||||
{
|
||||
content: 'Комментаторов: ';
|
||||
}
|
||||
|
||||
.pp-options .tab-content {
|
||||
padding: 5px 0 0 5px;
|
||||
.pp-recommendation-count::before
|
||||
{
|
||||
content: 'Рекомендаций: ';
|
||||
}
|
||||
|
||||
.pp-options .option {
|
||||
display: block;
|
||||
margin: 5px 0 5px 15px;
|
||||
/* NSFW-content */
|
||||
.post-tag-nsfw.blur-nsfw-images a.postimg img,
|
||||
.post-tag-сиськи.blur-nsfw-images a.postimg img,
|
||||
#comments.blur-nsfw-images a.postimg img {
|
||||
margin-top: 5px;
|
||||
-webkit-filter: blur(30px);
|
||||
}
|
||||
|
||||
.pp-options .option label {
|
||||
font: 10pt Georgia;
|
||||
color: #FFF;
|
||||
.post-tag-nsfw.blur-nsfw-images a.postimg:hover img,
|
||||
.post-tag-сиськи.blur-nsfw-images a.postimg:hover img,
|
||||
#comments.blur-nsfw-images a.postimg:hover img {
|
||||
-webkit-filter: none;
|
||||
}
|
||||
|
||||
.pp-options .tab-content .text {
|
||||
margin-left: 15px;
|
||||
}
|
||||
|
||||
/* Disables subcheckboxes if parent disabled */
|
||||
.pp-options .option input[type="checkbox"]:not(:checked) ~.option {
|
||||
.post-tag-nsfw.hide-nsfw-posts,
|
||||
.post-tag-сиськи.hide-nsfw-posts {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.pp-options .option input[type="checkbox"]:not(:checked) ~.option label {
|
||||
color: #BBB;
|
||||
.post-tag-nsfw.blur-nsfw-entire .post-content .text,
|
||||
.post-tag-сиськи.blur-nsfw-entire .post-content .text,
|
||||
#comments.blur-nsfw-entire .post-content .text {
|
||||
-webkit-filter: blur(30px);
|
||||
}
|
||||
|
||||
/* Panel */
|
||||
.pp-options .left, .pp-options .right {
|
||||
width: 50%;
|
||||
.post-tag-nsfw.hide-nsfw-posts,
|
||||
.post-tag-сиськи.hide-nsfw-posts {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.pp-options .left {
|
||||
float: left;
|
||||
/* Черновики */
|
||||
#new-post-form #text-input {
|
||||
height: 30em !important;
|
||||
}
|
||||
|
||||
.pp-options .right {
|
||||
#new-post-form #draft-save-status {
|
||||
display: none;
|
||||
padding: 3px 5px;
|
||||
color: green;
|
||||
}
|
||||
|
||||
/* point-plus-debug */
|
||||
#point-plus-debug {
|
||||
float: right;
|
||||
display: block;
|
||||
color: rgba(255, 255, 255, .75);
|
||||
padding: 10px 0px;
|
||||
}
|
||||
|
||||
.pp-options #pp-version {
|
||||
margin-top: 6px;
|
||||
text-align: right;
|
||||
/* User hints */
|
||||
.current-user-hint {
|
||||
min-height: 30px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.current-user-hint .edit {
|
||||
position: absolute;
|
||||
right: 5px;
|
||||
top: 5px;
|
||||
display: none;
|
||||
background-image: url('//point.im/img/btn-edit.png');
|
||||
background-size: 100% 100%;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
|
||||
.current-user-hint:hover .edit {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.current-user-hint > .text {
|
||||
margin: 1em 0;
|
||||
color: green;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.aside .aside-content #counters {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.current-user-hint .change_hint_block {
|
||||
|
||||
}
|
||||
|
||||
.current-user-hint .change_hint_block textarea {
|
||||
width: 98%;
|
||||
max-width: 98%;
|
||||
margin-bottom: 10px;
|
||||
height: 140px;
|
||||
}
|
||||
|
||||
.current-user-hint .change_hint_block .button_save {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.current-user-hint .change_hint_block .button_cancel {
|
||||
|
||||
}
|
||||
|
||||
/** Индикация вложенности */
|
||||
|
||||
#comments.nesting_level {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#comments.nesting_level .info::before {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 100%;
|
||||
|
||||
display: block;
|
||||
|
||||
width: 500px;
|
||||
height: 24px;
|
||||
|
||||
content: '';
|
||||
|
||||
opacity: 0;
|
||||
background-image: url('chrome-extension://__MSG_@@extension_id__/images/nesting-point.svg');
|
||||
background-repeat: repeat-x;
|
||||
background-position: right center;
|
||||
}
|
||||
|
||||
#comments.nesting_level .post:hover .info::before {
|
||||
transition: opacity .2s ease-in;
|
||||
|
||||
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;
|
||||
}
|
Before Width: | Height: | Size: 43 B |
Before Width: | Height: | Size: 6.4 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 1003 B |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 6.4 KiB |
|
@ -0,0 +1 @@
|
|||
<svg version="1" xmlns="http://www.w3.org/2000/svg" height="10" width="10"><circle cx="5" cy="5" r="3" fill="#9aacbe"/></svg>
|
After Width: | Height: | Size: 125 B |
|
@ -1,46 +1,204 @@
|
|||
// Message listener
|
||||
chrome.extension.onMessage.addListener(function(message, sender) {
|
||||
console.log('Received message: %O', message);
|
||||
|
||||
if (message) {
|
||||
switch (message.type) {
|
||||
case 'showPageAction':
|
||||
var tab = sender.tab;
|
||||
chrome.pageAction.show(tab.id);
|
||||
break;
|
||||
|
||||
case 'showNotification':
|
||||
console.log(chrome.notifications.create(
|
||||
message.notificationId, {
|
||||
type: 'basic',
|
||||
iconUrl: message.avatarUrl,
|
||||
title: message.title,
|
||||
message: message.text,
|
||||
priority: 0
|
||||
},
|
||||
function() { /* Error checking goes here */}
|
||||
));
|
||||
break;
|
||||
|
||||
case 'injectJS':
|
||||
|
||||
break;
|
||||
|
||||
case 'injectCSSFile':
|
||||
console.log('Injecting CSS: %s', message.file);
|
||||
chrome.tabs.insertCSS(null, {
|
||||
file: message.file
|
||||
});
|
||||
break;
|
||||
|
||||
case 'injectCSSCode':
|
||||
if (message.code !== undefined) {
|
||||
chrome.tabs.insertCSS(null, {
|
||||
code: message.code
|
||||
});
|
||||
}
|
||||
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;
|
||||
|
||||
break;
|
||||
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' });
|
||||
}
|
||||
});
|
||||
|
||||
// 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, '');
|
||||
} else if (notificationId.indexOf('post_') === 0) {
|
||||
tab_url = 'https://point.im/' + notificationId.replace(/post_/g, '');
|
||||
}
|
||||
console.log('Notification %s clicked! Opening new tab: %s', notificationId, tab_url);
|
||||
|
||||
if (tab_url !== undefined) {
|
||||
chrome.tabs.create({
|
||||
url: tab_url
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// Processing all emenents contains data-i18n attribute
|
||||
Array.prototype.forEach.call(document.querySelectorAll('[data-i18n]'), function(elem) {
|
||||
elem.innerHTML = chrome.i18n.getMessage(elem.dataset.i18n);
|
||||
});
|
||||
}, false);
|
|
@ -1,199 +0,0 @@
|
|||
/*!
|
||||
* Media helper for fancyBox
|
||||
* version: 1.0.6 (Fri, 14 Jun 2013)
|
||||
* @requires fancyBox v2.0 or later
|
||||
*
|
||||
* Usage:
|
||||
* $(".fancybox").fancybox({
|
||||
* helpers : {
|
||||
* media: true
|
||||
* }
|
||||
* });
|
||||
*
|
||||
* Set custom URL parameters:
|
||||
* $(".fancybox").fancybox({
|
||||
* helpers : {
|
||||
* media: {
|
||||
* youtube : {
|
||||
* params : {
|
||||
* autoplay : 0
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
* });
|
||||
*
|
||||
* Or:
|
||||
* $(".fancybox").fancybox({,
|
||||
* helpers : {
|
||||
* media: true
|
||||
* },
|
||||
* youtube : {
|
||||
* autoplay: 0
|
||||
* }
|
||||
* });
|
||||
*
|
||||
* Supports:
|
||||
*
|
||||
* Youtube
|
||||
* http://www.youtube.com/watch?v=opj24KnzrWo
|
||||
* http://www.youtube.com/embed/opj24KnzrWo
|
||||
* http://youtu.be/opj24KnzrWo
|
||||
* http://www.youtube-nocookie.com/embed/opj24KnzrWo
|
||||
* Vimeo
|
||||
* http://vimeo.com/40648169
|
||||
* http://vimeo.com/channels/staffpicks/38843628
|
||||
* http://vimeo.com/groups/surrealism/videos/36516384
|
||||
* http://player.vimeo.com/video/45074303
|
||||
* Metacafe
|
||||
* http://www.metacafe.com/watch/7635964/dr_seuss_the_lorax_movie_trailer/
|
||||
* http://www.metacafe.com/watch/7635964/
|
||||
* Dailymotion
|
||||
* http://www.dailymotion.com/video/xoytqh_dr-seuss-the-lorax-premiere_people
|
||||
* Twitvid
|
||||
* http://twitvid.com/QY7MD
|
||||
* Twitpic
|
||||
* http://twitpic.com/7p93st
|
||||
* Instagram
|
||||
* http://instagr.am/p/IejkuUGxQn/
|
||||
* http://instagram.com/p/IejkuUGxQn/
|
||||
* Google maps
|
||||
* http://maps.google.com/maps?q=Eiffel+Tower,+Avenue+Gustave+Eiffel,+Paris,+France&t=h&z=17
|
||||
* http://maps.google.com/?ll=48.857995,2.294297&spn=0.007666,0.021136&t=m&z=16
|
||||
* http://maps.google.com/?ll=48.859463,2.292626&spn=0.000965,0.002642&t=m&z=19&layer=c&cbll=48.859524,2.292532&panoid=YJ0lq28OOy3VT2IqIuVY0g&cbp=12,151.58,,0,-15.56
|
||||
*/
|
||||
(function ($) {
|
||||
"use strict";
|
||||
|
||||
//Shortcut for fancyBox object
|
||||
var F = $.fancybox,
|
||||
format = function( url, rez, params ) {
|
||||
params = params || '';
|
||||
|
||||
if ( $.type( params ) === "object" ) {
|
||||
params = $.param(params, true);
|
||||
}
|
||||
|
||||
$.each(rez, function(key, value) {
|
||||
url = url.replace( '$' + key, value || '' );
|
||||
});
|
||||
|
||||
if (params.length) {
|
||||
url += ( url.indexOf('?') > 0 ? '&' : '?' ) + params;
|
||||
}
|
||||
|
||||
return url;
|
||||
};
|
||||
|
||||
//Add helper object
|
||||
F.helpers.media = {
|
||||
defaults : {
|
||||
youtube : {
|
||||
matcher : /(youtube\.com|youtu\.be|youtube-nocookie\.com)\/(watch\?v=|v\/|u\/|embed\/?)?(videoseries\?list=(.*)|[\w-]{11}|\?listType=(.*)&list=(.*)).*/i,
|
||||
params : {
|
||||
autoplay : 1,
|
||||
autohide : 1,
|
||||
fs : 1,
|
||||
rel : 0,
|
||||
hd : 1,
|
||||
wmode : 'opaque',
|
||||
enablejsapi : 1
|
||||
},
|
||||
type : 'iframe',
|
||||
url : '//www.youtube.com/embed/$3'
|
||||
},
|
||||
vimeo : {
|
||||
matcher : /(?:vimeo(?:pro)?.com)\/(?:[^\d]+)?(\d+)(?:.*)/,
|
||||
params : {
|
||||
autoplay : 1,
|
||||
hd : 1,
|
||||
show_title : 1,
|
||||
show_byline : 1,
|
||||
show_portrait : 0,
|
||||
fullscreen : 1
|
||||
},
|
||||
type : 'iframe',
|
||||
url : '//player.vimeo.com/video/$1'
|
||||
},
|
||||
metacafe : {
|
||||
matcher : /metacafe.com\/(?:watch|fplayer)\/([\w\-]{1,10})/,
|
||||
params : {
|
||||
autoPlay : 'yes'
|
||||
},
|
||||
type : 'swf',
|
||||
url : function( rez, params, obj ) {
|
||||
obj.swf.flashVars = 'playerVars=' + $.param( params, true );
|
||||
|
||||
return '//www.metacafe.com/fplayer/' + rez[1] + '/.swf';
|
||||
}
|
||||
},
|
||||
dailymotion : {
|
||||
matcher : /dailymotion.com\/video\/(.*)\/?(.*)/,
|
||||
params : {
|
||||
additionalInfos : 0,
|
||||
autoStart : 1
|
||||
},
|
||||
type : 'swf',
|
||||
url : '//www.dailymotion.com/swf/video/$1'
|
||||
},
|
||||
twitvid : {
|
||||
matcher : /twitvid\.com\/([a-zA-Z0-9_\-\?\=]+)/i,
|
||||
params : {
|
||||
autoplay : 0
|
||||
},
|
||||
type : 'iframe',
|
||||
url : '//www.twitvid.com/embed.php?guid=$1'
|
||||
},
|
||||
twitpic : {
|
||||
matcher : /twitpic\.com\/(?!(?:place|photos|events)\/)([a-zA-Z0-9\?\=\-]+)/i,
|
||||
type : 'image',
|
||||
url : '//twitpic.com/show/full/$1/'
|
||||
},
|
||||
instagram : {
|
||||
matcher : /(instagr\.am|instagram\.com)\/p\/([a-zA-Z0-9_\-]+)\/?/i,
|
||||
type : 'image',
|
||||
url : '//$1/p/$2/media/?size=l'
|
||||
},
|
||||
google_maps : {
|
||||
matcher : /maps\.google\.([a-z]{2,3}(\.[a-z]{2})?)\/(\?ll=|maps\?)(.*)/i,
|
||||
type : 'iframe',
|
||||
url : function( rez ) {
|
||||
return '//maps.google.' + rez[1] + '/' + rez[3] + '' + rez[4] + '&output=' + (rez[4].indexOf('layer=c') > 0 ? 'svembed' : 'embed');
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
beforeLoad : function(opts, obj) {
|
||||
var url = obj.href || '',
|
||||
type = false,
|
||||
what,
|
||||
item,
|
||||
rez,
|
||||
params;
|
||||
|
||||
for (what in opts) {
|
||||
if (opts.hasOwnProperty(what)) {
|
||||
item = opts[ what ];
|
||||
rez = url.match( item.matcher );
|
||||
|
||||
if (rez) {
|
||||
type = item.type;
|
||||
params = $.extend(true, {}, item.params, obj[ what ] || ($.isPlainObject(opts[ what ]) ? opts[ what ].params : null));
|
||||
|
||||
url = $.type( item.url ) === "function" ? item.url.call( this, rez, params, obj ) : format( item.url, rez, params );
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (type) {
|
||||
obj.href = url;
|
||||
obj.type = type;
|
||||
|
||||
obj.autoHeight = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
}(jQuery));
|
|
@ -1,46 +0,0 @@
|
|||
/*! fancyBox v2.1.5 fancyapps.com | fancyapps.com/fancybox/#license */
|
||||
(function(r,G,f,v){var J=f("html"),n=f(r),p=f(G),b=f.fancybox=function(){b.open.apply(this,arguments)},I=navigator.userAgent.match(/msie/i),B=null,s=G.createTouch!==v,t=function(a){return a&&a.hasOwnProperty&&a instanceof f},q=function(a){return a&&"string"===f.type(a)},E=function(a){return q(a)&&0<a.indexOf("%")},l=function(a,d){var e=parseInt(a,10)||0;d&&E(a)&&(e*=b.getViewport()[d]/100);return Math.ceil(e)},w=function(a,b){return l(a,b)+"px"};f.extend(b,{version:"2.1.5",defaults:{padding:15,margin:20,
|
||||
width:800,height:600,minWidth:100,minHeight:100,maxWidth:9999,maxHeight:9999,pixelRatio:1,autoSize:!0,autoHeight:!1,autoWidth:!1,autoResize:!0,autoCenter:!s,fitToView:!0,aspectRatio:!1,topRatio:0.5,leftRatio:0.5,scrolling:"auto",wrapCSS:"",arrows:!0,closeBtn:!0,closeClick:!1,nextClick:!1,mouseWheel:!0,autoPlay:!1,playSpeed:3E3,preload:3,modal:!1,loop:!0,ajax:{dataType:"html",headers:{"X-fancyBox":!0}},iframe:{scrolling:"auto",preload:!0},swf:{wmode:"transparent",allowfullscreen:"true",allowscriptaccess:"always"},
|
||||
keys:{next:{13:"left",34:"up",39:"left",40:"up"},prev:{8:"right",33:"down",37:"right",38:"down"},close:[27],play:[32],toggle:[70]},direction:{next:"left",prev:"right"},scrollOutside:!0,index:0,type:null,href:null,content:null,title:null,tpl:{wrap:'<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>',image:'<img class="fancybox-image" src="{href}" alt="" />',iframe:'<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen'+
|
||||
(I?' allowtransparency="true"':"")+"></iframe>",error:'<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.</p>',closeBtn:'<a title="Close" class="fancybox-item fancybox-close" href="javascript:;"></a>',next:'<a title="Next" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>',prev:'<a title="Previous" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>'},openEffect:"fade",openSpeed:250,openEasing:"swing",openOpacity:!0,
|
||||
openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:250,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:250,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:!0,title:!0},onCancel:f.noop,beforeLoad:f.noop,afterLoad:f.noop,beforeShow:f.noop,afterShow:f.noop,beforeChange:f.noop,beforeClose:f.noop,afterClose:f.noop},group:{},opts:{},previous:null,coming:null,current:null,isActive:!1,
|
||||
isOpen:!1,isOpened:!1,wrap:null,skin:null,outer:null,inner:null,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(a,d){if(a&&(f.isPlainObject(d)||(d={}),!1!==b.close(!0)))return f.isArray(a)||(a=t(a)?f(a).get():[a]),f.each(a,function(e,c){var k={},g,h,j,m,l;"object"===f.type(c)&&(c.nodeType&&(c=f(c)),t(c)?(k={href:c.data("fancybox-href")||c.attr("href"),title:c.data("fancybox-title")||c.attr("title"),isDom:!0,element:c},f.metadata&&f.extend(!0,k,
|
||||
c.metadata())):k=c);g=d.href||k.href||(q(c)?c:null);h=d.title!==v?d.title:k.title||"";m=(j=d.content||k.content)?"html":d.type||k.type;!m&&k.isDom&&(m=c.data("fancybox-type"),m||(m=(m=c.prop("class").match(/fancybox\.(\w+)/))?m[1]:null));q(g)&&(m||(b.isImage(g)?m="image":b.isSWF(g)?m="swf":"#"===g.charAt(0)?m="inline":q(c)&&(m="html",j=c)),"ajax"===m&&(l=g.split(/\s+/,2),g=l.shift(),l=l.shift()));j||("inline"===m?g?j=f(q(g)?g.replace(/.*(?=#[^\s]+$)/,""):g):k.isDom&&(j=c):"html"===m?j=g:!m&&(!g&&
|
||||
k.isDom)&&(m="inline",j=c));f.extend(k,{href:g,type:m,content:j,title:h,selector:l});a[e]=k}),b.opts=f.extend(!0,{},b.defaults,d),d.keys!==v&&(b.opts.keys=d.keys?f.extend({},b.defaults.keys,d.keys):!1),b.group=a,b._start(b.opts.index)},cancel:function(){var a=b.coming;a&&!1!==b.trigger("onCancel")&&(b.hideLoading(),b.ajaxLoad&&b.ajaxLoad.abort(),b.ajaxLoad=null,b.imgPreload&&(b.imgPreload.onload=b.imgPreload.onerror=null),a.wrap&&a.wrap.stop(!0,!0).trigger("onReset").remove(),b.coming=null,b.current||
|
||||
b._afterZoomOut(a))},close:function(a){b.cancel();!1!==b.trigger("beforeClose")&&(b.unbindEvents(),b.isActive&&(!b.isOpen||!0===a?(f(".fancybox-wrap").stop(!0).trigger("onReset").remove(),b._afterZoomOut()):(b.isOpen=b.isOpened=!1,b.isClosing=!0,f(".fancybox-item, .fancybox-nav").remove(),b.wrap.stop(!0,!0).removeClass("fancybox-opened"),b.transitions[b.current.closeMethod]())))},play:function(a){var d=function(){clearTimeout(b.player.timer)},e=function(){d();b.current&&b.player.isActive&&(b.player.timer=
|
||||
setTimeout(b.next,b.current.playSpeed))},c=function(){d();p.unbind(".player");b.player.isActive=!1;b.trigger("onPlayEnd")};if(!0===a||!b.player.isActive&&!1!==a){if(b.current&&(b.current.loop||b.current.index<b.group.length-1))b.player.isActive=!0,p.bind({"onCancel.player beforeClose.player":c,"onUpdate.player":e,"beforeLoad.player":d}),e(),b.trigger("onPlayStart")}else c()},next:function(a){var d=b.current;d&&(q(a)||(a=d.direction.next),b.jumpto(d.index+1,a,"next"))},prev:function(a){var d=b.current;
|
||||
d&&(q(a)||(a=d.direction.prev),b.jumpto(d.index-1,a,"prev"))},jumpto:function(a,d,e){var c=b.current;c&&(a=l(a),b.direction=d||c.direction[a>=c.index?"next":"prev"],b.router=e||"jumpto",c.loop&&(0>a&&(a=c.group.length+a%c.group.length),a%=c.group.length),c.group[a]!==v&&(b.cancel(),b._start(a)))},reposition:function(a,d){var e=b.current,c=e?e.wrap:null,k;c&&(k=b._getPosition(d),a&&"scroll"===a.type?(delete k.position,c.stop(!0,!0).animate(k,200)):(c.css(k),e.pos=f.extend({},e.dim,k)))},update:function(a){var d=
|
||||
a&&a.type,e=!d||"orientationchange"===d;e&&(clearTimeout(B),B=null);b.isOpen&&!B&&(B=setTimeout(function(){var c=b.current;c&&!b.isClosing&&(b.wrap.removeClass("fancybox-tmp"),(e||"load"===d||"resize"===d&&c.autoResize)&&b._setDimension(),"scroll"===d&&c.canShrink||b.reposition(a),b.trigger("onUpdate"),B=null)},e&&!s?0:300))},toggle:function(a){b.isOpen&&(b.current.fitToView="boolean"===f.type(a)?a:!b.current.fitToView,s&&(b.wrap.removeAttr("style").addClass("fancybox-tmp"),b.trigger("onUpdate")),
|
||||
b.update())},hideLoading:function(){p.unbind(".loading");f("#fancybox-loading").remove()},showLoading:function(){var a,d;b.hideLoading();a=f('<div id="fancybox-loading"><div></div></div>').click(b.cancel).appendTo("body");p.bind("keydown.loading",function(a){if(27===(a.which||a.keyCode))a.preventDefault(),b.cancel()});b.defaults.fixed||(d=b.getViewport(),a.css({position:"absolute",top:0.5*d.h+d.y,left:0.5*d.w+d.x}))},getViewport:function(){var a=b.current&&b.current.locked||!1,d={x:n.scrollLeft(),
|
||||
y:n.scrollTop()};a?(d.w=a[0].clientWidth,d.h=a[0].clientHeight):(d.w=s&&r.innerWidth?r.innerWidth:n.width(),d.h=s&&r.innerHeight?r.innerHeight:n.height());return d},unbindEvents:function(){b.wrap&&t(b.wrap)&&b.wrap.unbind(".fb");p.unbind(".fb");n.unbind(".fb")},bindEvents:function(){var a=b.current,d;a&&(n.bind("orientationchange.fb"+(s?"":" resize.fb")+(a.autoCenter&&!a.locked?" scroll.fb":""),b.update),(d=a.keys)&&p.bind("keydown.fb",function(e){var c=e.which||e.keyCode,k=e.target||e.srcElement;
|
||||
if(27===c&&b.coming)return!1;!e.ctrlKey&&(!e.altKey&&!e.shiftKey&&!e.metaKey&&(!k||!k.type&&!f(k).is("[contenteditable]")))&&f.each(d,function(d,k){if(1<a.group.length&&k[c]!==v)return b[d](k[c]),e.preventDefault(),!1;if(-1<f.inArray(c,k))return b[d](),e.preventDefault(),!1})}),f.fn.mousewheel&&a.mouseWheel&&b.wrap.bind("mousewheel.fb",function(d,c,k,g){for(var h=f(d.target||null),j=!1;h.length&&!j&&!h.is(".fancybox-skin")&&!h.is(".fancybox-wrap");)j=h[0]&&!(h[0].style.overflow&&"hidden"===h[0].style.overflow)&&
|
||||
(h[0].clientWidth&&h[0].scrollWidth>h[0].clientWidth||h[0].clientHeight&&h[0].scrollHeight>h[0].clientHeight),h=f(h).parent();if(0!==c&&!j&&1<b.group.length&&!a.canShrink){if(0<g||0<k)b.prev(0<g?"down":"left");else if(0>g||0>k)b.next(0>g?"up":"right");d.preventDefault()}}))},trigger:function(a,d){var e,c=d||b.coming||b.current;if(c){f.isFunction(c[a])&&(e=c[a].apply(c,Array.prototype.slice.call(arguments,1)));if(!1===e)return!1;c.helpers&&f.each(c.helpers,function(d,e){if(e&&b.helpers[d]&&f.isFunction(b.helpers[d][a]))b.helpers[d][a](f.extend(!0,
|
||||
{},b.helpers[d].defaults,e),c)});p.trigger(a)}},isImage:function(a){return q(a)&&a.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i)},isSWF:function(a){return q(a)&&a.match(/\.(swf)((\?|#).*)?$/i)},_start:function(a){var d={},e,c;a=l(a);e=b.group[a]||null;if(!e)return!1;d=f.extend(!0,{},b.opts,e);e=d.margin;c=d.padding;"number"===f.type(e)&&(d.margin=[e,e,e,e]);"number"===f.type(c)&&(d.padding=[c,c,c,c]);d.modal&&f.extend(!0,d,{closeBtn:!1,closeClick:!1,nextClick:!1,arrows:!1,
|
||||
mouseWheel:!1,keys:null,helpers:{overlay:{closeClick:!1}}});d.autoSize&&(d.autoWidth=d.autoHeight=!0);"auto"===d.width&&(d.autoWidth=!0);"auto"===d.height&&(d.autoHeight=!0);d.group=b.group;d.index=a;b.coming=d;if(!1===b.trigger("beforeLoad"))b.coming=null;else{c=d.type;e=d.href;if(!c)return b.coming=null,b.current&&b.router&&"jumpto"!==b.router?(b.current.index=a,b[b.router](b.direction)):!1;b.isActive=!0;if("image"===c||"swf"===c)d.autoHeight=d.autoWidth=!1,d.scrolling="visible";"image"===c&&(d.aspectRatio=
|
||||
!0);"iframe"===c&&s&&(d.scrolling="scroll");d.wrap=f(d.tpl.wrap).addClass("fancybox-"+(s?"mobile":"desktop")+" fancybox-type-"+c+" fancybox-tmp "+d.wrapCSS).appendTo(d.parent||"body");f.extend(d,{skin:f(".fancybox-skin",d.wrap),outer:f(".fancybox-outer",d.wrap),inner:f(".fancybox-inner",d.wrap)});f.each(["Top","Right","Bottom","Left"],function(a,b){d.skin.css("padding"+b,w(d.padding[a]))});b.trigger("onReady");if("inline"===c||"html"===c){if(!d.content||!d.content.length)return b._error("content")}else if(!e)return b._error("href");
|
||||
"image"===c?b._loadImage():"ajax"===c?b._loadAjax():"iframe"===c?b._loadIframe():b._afterLoad()}},_error:function(a){f.extend(b.coming,{type:"html",autoWidth:!0,autoHeight:!0,minWidth:0,minHeight:0,scrolling:"no",hasError:a,content:b.coming.tpl.error});b._afterLoad()},_loadImage:function(){var a=b.imgPreload=new Image;a.onload=function(){this.onload=this.onerror=null;b.coming.width=this.width/b.opts.pixelRatio;b.coming.height=this.height/b.opts.pixelRatio;b._afterLoad()};a.onerror=function(){this.onload=
|
||||
this.onerror=null;b._error("image")};a.src=b.coming.href;!0!==a.complete&&b.showLoading()},_loadAjax:function(){var a=b.coming;b.showLoading();b.ajaxLoad=f.ajax(f.extend({},a.ajax,{url:a.href,error:function(a,e){b.coming&&"abort"!==e?b._error("ajax",a):b.hideLoading()},success:function(d,e){"success"===e&&(a.content=d,b._afterLoad())}}))},_loadIframe:function(){var a=b.coming,d=f(a.tpl.iframe.replace(/\{rnd\}/g,(new Date).getTime())).attr("scrolling",s?"auto":a.iframe.scrolling).attr("src",a.href);
|
||||
f(a.wrap).bind("onReset",function(){try{f(this).find("iframe").hide().attr("src","//about:blank").end().empty()}catch(a){}});a.iframe.preload&&(b.showLoading(),d.one("load",function(){f(this).data("ready",1);s||f(this).bind("load.fb",b.update);f(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show();b._afterLoad()}));a.content=d.appendTo(a.inner);a.iframe.preload||b._afterLoad()},_preloadImages:function(){var a=b.group,d=b.current,e=a.length,c=d.preload?Math.min(d.preload,
|
||||
e-1):0,f,g;for(g=1;g<=c;g+=1)f=a[(d.index+g)%e],"image"===f.type&&f.href&&((new Image).src=f.href)},_afterLoad:function(){var a=b.coming,d=b.current,e,c,k,g,h;b.hideLoading();if(a&&!1!==b.isActive)if(!1===b.trigger("afterLoad",a,d))a.wrap.stop(!0).trigger("onReset").remove(),b.coming=null;else{d&&(b.trigger("beforeChange",d),d.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove());b.unbindEvents();e=a.content;c=a.type;k=a.scrolling;f.extend(b,{wrap:a.wrap,skin:a.skin,
|
||||
outer:a.outer,inner:a.inner,current:a,previous:d});g=a.href;switch(c){case "inline":case "ajax":case "html":a.selector?e=f("<div>").html(e).find(a.selector):t(e)&&(e.data("fancybox-placeholder")||e.data("fancybox-placeholder",f('<div class="fancybox-placeholder"></div>').insertAfter(e).hide()),e=e.show().detach(),a.wrap.bind("onReset",function(){f(this).find(e).length&&e.hide().replaceAll(e.data("fancybox-placeholder")).data("fancybox-placeholder",!1)}));break;case "image":e=a.tpl.image.replace("{href}",
|
||||
g);break;case "swf":e='<object id="fancybox-swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="movie" value="'+g+'"></param>',h="",f.each(a.swf,function(a,b){e+='<param name="'+a+'" value="'+b+'"></param>';h+=" "+a+'="'+b+'"'}),e+='<embed src="'+g+'" type="application/x-shockwave-flash" width="100%" height="100%"'+h+"></embed></object>"}(!t(e)||!e.parent().is(a.inner))&&a.inner.append(e);b.trigger("beforeShow");a.inner.css("overflow","yes"===k?"scroll":
|
||||
"no"===k?"hidden":k);b._setDimension();b.reposition();b.isOpen=!1;b.coming=null;b.bindEvents();if(b.isOpened){if(d.prevMethod)b.transitions[d.prevMethod]()}else f(".fancybox-wrap").not(a.wrap).stop(!0).trigger("onReset").remove();b.transitions[b.isOpened?a.nextMethod:a.openMethod]();b._preloadImages()}},_setDimension:function(){var a=b.getViewport(),d=0,e=!1,c=!1,e=b.wrap,k=b.skin,g=b.inner,h=b.current,c=h.width,j=h.height,m=h.minWidth,u=h.minHeight,n=h.maxWidth,p=h.maxHeight,s=h.scrolling,q=h.scrollOutside?
|
||||
h.scrollbarWidth:0,x=h.margin,y=l(x[1]+x[3]),r=l(x[0]+x[2]),v,z,t,C,A,F,B,D,H;e.add(k).add(g).width("auto").height("auto").removeClass("fancybox-tmp");x=l(k.outerWidth(!0)-k.width());v=l(k.outerHeight(!0)-k.height());z=y+x;t=r+v;C=E(c)?(a.w-z)*l(c)/100:c;A=E(j)?(a.h-t)*l(j)/100:j;if("iframe"===h.type){if(H=h.content,h.autoHeight&&1===H.data("ready"))try{H[0].contentWindow.document.location&&(g.width(C).height(9999),F=H.contents().find("body"),q&&F.css("overflow-x","hidden"),A=F.outerHeight(!0))}catch(G){}}else if(h.autoWidth||
|
||||
h.autoHeight)g.addClass("fancybox-tmp"),h.autoWidth||g.width(C),h.autoHeight||g.height(A),h.autoWidth&&(C=g.width()),h.autoHeight&&(A=g.height()),g.removeClass("fancybox-tmp");c=l(C);j=l(A);D=C/A;m=l(E(m)?l(m,"w")-z:m);n=l(E(n)?l(n,"w")-z:n);u=l(E(u)?l(u,"h")-t:u);p=l(E(p)?l(p,"h")-t:p);F=n;B=p;h.fitToView&&(n=Math.min(a.w-z,n),p=Math.min(a.h-t,p));z=a.w-y;r=a.h-r;h.aspectRatio?(c>n&&(c=n,j=l(c/D)),j>p&&(j=p,c=l(j*D)),c<m&&(c=m,j=l(c/D)),j<u&&(j=u,c=l(j*D))):(c=Math.max(m,Math.min(c,n)),h.autoHeight&&
|
||||
"iframe"!==h.type&&(g.width(c),j=g.height()),j=Math.max(u,Math.min(j,p)));if(h.fitToView)if(g.width(c).height(j),e.width(c+x),a=e.width(),y=e.height(),h.aspectRatio)for(;(a>z||y>r)&&(c>m&&j>u)&&!(19<d++);)j=Math.max(u,Math.min(p,j-10)),c=l(j*D),c<m&&(c=m,j=l(c/D)),c>n&&(c=n,j=l(c/D)),g.width(c).height(j),e.width(c+x),a=e.width(),y=e.height();else c=Math.max(m,Math.min(c,c-(a-z))),j=Math.max(u,Math.min(j,j-(y-r)));q&&("auto"===s&&j<A&&c+x+q<z)&&(c+=q);g.width(c).height(j);e.width(c+x);a=e.width();
|
||||
y=e.height();e=(a>z||y>r)&&c>m&&j>u;c=h.aspectRatio?c<F&&j<B&&c<C&&j<A:(c<F||j<B)&&(c<C||j<A);f.extend(h,{dim:{width:w(a),height:w(y)},origWidth:C,origHeight:A,canShrink:e,canExpand:c,wPadding:x,hPadding:v,wrapSpace:y-k.outerHeight(!0),skinSpace:k.height()-j});!H&&(h.autoHeight&&j>u&&j<p&&!c)&&g.height("auto")},_getPosition:function(a){var d=b.current,e=b.getViewport(),c=d.margin,f=b.wrap.width()+c[1]+c[3],g=b.wrap.height()+c[0]+c[2],c={position:"absolute",top:c[0],left:c[3]};d.autoCenter&&d.fixed&&
|
||||
!a&&g<=e.h&&f<=e.w?c.position="fixed":d.locked||(c.top+=e.y,c.left+=e.x);c.top=w(Math.max(c.top,c.top+(e.h-g)*d.topRatio));c.left=w(Math.max(c.left,c.left+(e.w-f)*d.leftRatio));return c},_afterZoomIn:function(){var a=b.current;a&&(b.isOpen=b.isOpened=!0,b.wrap.css("overflow","visible").addClass("fancybox-opened"),b.update(),(a.closeClick||a.nextClick&&1<b.group.length)&&b.inner.css("cursor","pointer").bind("click.fb",function(d){!f(d.target).is("a")&&!f(d.target).parent().is("a")&&(d.preventDefault(),
|
||||
b[a.closeClick?"close":"next"]())}),a.closeBtn&&f(a.tpl.closeBtn).appendTo(b.skin).bind("click.fb",function(a){a.preventDefault();b.close()}),a.arrows&&1<b.group.length&&((a.loop||0<a.index)&&f(a.tpl.prev).appendTo(b.outer).bind("click.fb",b.prev),(a.loop||a.index<b.group.length-1)&&f(a.tpl.next).appendTo(b.outer).bind("click.fb",b.next)),b.trigger("afterShow"),!a.loop&&a.index===a.group.length-1?b.play(!1):b.opts.autoPlay&&!b.player.isActive&&(b.opts.autoPlay=!1,b.play()))},_afterZoomOut:function(a){a=
|
||||
a||b.current;f(".fancybox-wrap").trigger("onReset").remove();f.extend(b,{group:{},opts:{},router:!1,current:null,isActive:!1,isOpened:!1,isOpen:!1,isClosing:!1,wrap:null,skin:null,outer:null,inner:null});b.trigger("afterClose",a)}});b.transitions={getOrigPosition:function(){var a=b.current,d=a.element,e=a.orig,c={},f=50,g=50,h=a.hPadding,j=a.wPadding,m=b.getViewport();!e&&(a.isDom&&d.is(":visible"))&&(e=d.find("img:first"),e.length||(e=d));t(e)?(c=e.offset(),e.is("img")&&(f=e.outerWidth(),g=e.outerHeight())):
|
||||
(c.top=m.y+(m.h-g)*a.topRatio,c.left=m.x+(m.w-f)*a.leftRatio);if("fixed"===b.wrap.css("position")||a.locked)c.top-=m.y,c.left-=m.x;return c={top:w(c.top-h*a.topRatio),left:w(c.left-j*a.leftRatio),width:w(f+j),height:w(g+h)}},step:function(a,d){var e,c,f=d.prop;c=b.current;var g=c.wrapSpace,h=c.skinSpace;if("width"===f||"height"===f)e=d.end===d.start?1:(a-d.start)/(d.end-d.start),b.isClosing&&(e=1-e),c="width"===f?c.wPadding:c.hPadding,c=a-c,b.skin[f](l("width"===f?c:c-g*e)),b.inner[f](l("width"===
|
||||
f?c:c-g*e-h*e))},zoomIn:function(){var a=b.current,d=a.pos,e=a.openEffect,c="elastic"===e,k=f.extend({opacity:1},d);delete k.position;c?(d=this.getOrigPosition(),a.openOpacity&&(d.opacity=0.1)):"fade"===e&&(d.opacity=0.1);b.wrap.css(d).animate(k,{duration:"none"===e?0:a.openSpeed,easing:a.openEasing,step:c?this.step:null,complete:b._afterZoomIn})},zoomOut:function(){var a=b.current,d=a.closeEffect,e="elastic"===d,c={opacity:0.1};e&&(c=this.getOrigPosition(),a.closeOpacity&&(c.opacity=0.1));b.wrap.animate(c,
|
||||
{duration:"none"===d?0:a.closeSpeed,easing:a.closeEasing,step:e?this.step:null,complete:b._afterZoomOut})},changeIn:function(){var a=b.current,d=a.nextEffect,e=a.pos,c={opacity:1},f=b.direction,g;e.opacity=0.1;"elastic"===d&&(g="down"===f||"up"===f?"top":"left","down"===f||"right"===f?(e[g]=w(l(e[g])-200),c[g]="+=200px"):(e[g]=w(l(e[g])+200),c[g]="-=200px"));"none"===d?b._afterZoomIn():b.wrap.css(e).animate(c,{duration:a.nextSpeed,easing:a.nextEasing,complete:b._afterZoomIn})},changeOut:function(){var a=
|
||||
b.previous,d=a.prevEffect,e={opacity:0.1},c=b.direction;"elastic"===d&&(e["down"===c||"up"===c?"top":"left"]=("up"===c||"left"===c?"-":"+")+"=200px");a.wrap.animate(e,{duration:"none"===d?0:a.prevSpeed,easing:a.prevEasing,complete:function(){f(this).trigger("onReset").remove()}})}};b.helpers.overlay={defaults:{closeClick:!0,speedOut:200,showEarly:!0,css:{},locked:!s,fixed:!0},overlay:null,fixed:!1,el:f("html"),create:function(a){a=f.extend({},this.defaults,a);this.overlay&&this.close();this.overlay=
|
||||
f('<div class="fancybox-overlay"></div>').appendTo(b.coming?b.coming.parent:a.parent);this.fixed=!1;a.fixed&&b.defaults.fixed&&(this.overlay.addClass("fancybox-overlay-fixed"),this.fixed=!0)},open:function(a){var d=this;a=f.extend({},this.defaults,a);this.overlay?this.overlay.unbind(".overlay").width("auto").height("auto"):this.create(a);this.fixed||(n.bind("resize.overlay",f.proxy(this.update,this)),this.update());a.closeClick&&this.overlay.bind("click.overlay",function(a){if(f(a.target).hasClass("fancybox-overlay"))return b.isActive?
|
||||
b.close():d.close(),!1});this.overlay.css(a.css).show()},close:function(){var a,b;n.unbind("resize.overlay");this.el.hasClass("fancybox-lock")&&(f(".fancybox-margin").removeClass("fancybox-margin"),a=n.scrollTop(),b=n.scrollLeft(),this.el.removeClass("fancybox-lock"),n.scrollTop(a).scrollLeft(b));f(".fancybox-overlay").remove().hide();f.extend(this,{overlay:null,fixed:!1})},update:function(){var a="100%",b;this.overlay.width(a).height("100%");I?(b=Math.max(G.documentElement.offsetWidth,G.body.offsetWidth),
|
||||
p.width()>b&&(a=p.width())):p.width()>n.width()&&(a=p.width());this.overlay.width(a).height(p.height())},onReady:function(a,b){var e=this.overlay;f(".fancybox-overlay").stop(!0,!0);e||this.create(a);a.locked&&(this.fixed&&b.fixed)&&(e||(this.margin=p.height()>n.height()?f("html").css("margin-right").replace("px",""):!1),b.locked=this.overlay.append(b.wrap),b.fixed=!1);!0===a.showEarly&&this.beforeShow.apply(this,arguments)},beforeShow:function(a,b){var e,c;b.locked&&(!1!==this.margin&&(f("*").filter(function(){return"fixed"===
|
||||
f(this).css("position")&&!f(this).hasClass("fancybox-overlay")&&!f(this).hasClass("fancybox-wrap")}).addClass("fancybox-margin"),this.el.addClass("fancybox-margin")),e=n.scrollTop(),c=n.scrollLeft(),this.el.addClass("fancybox-lock"),n.scrollTop(e).scrollLeft(c));this.open(a)},onUpdate:function(){this.fixed||this.update()},afterClose:function(a){this.overlay&&!b.coming&&this.overlay.fadeOut(a.speedOut,f.proxy(this.close,this))}};b.helpers.title={defaults:{type:"float",position:"bottom"},beforeShow:function(a){var d=
|
||||
b.current,e=d.title,c=a.type;f.isFunction(e)&&(e=e.call(d.element,d));if(q(e)&&""!==f.trim(e)){d=f('<div class="fancybox-title fancybox-title-'+c+'-wrap">'+e+"</div>");switch(c){case "inside":c=b.skin;break;case "outside":c=b.wrap;break;case "over":c=b.inner;break;default:c=b.skin,d.appendTo("body"),I&&d.width(d.width()),d.wrapInner('<span class="child"></span>'),b.current.margin[2]+=Math.abs(l(d.css("margin-bottom")))}d["top"===a.position?"prependTo":"appendTo"](c)}}};f.fn.fancybox=function(a){var d,
|
||||
e=f(this),c=this.selector||"",k=function(g){var h=f(this).blur(),j=d,k,l;!g.ctrlKey&&(!g.altKey&&!g.shiftKey&&!g.metaKey)&&!h.is(".fancybox-wrap")&&(k=a.groupAttr||"data-fancybox-group",l=h.attr(k),l||(k="rel",l=h.get(0)[k]),l&&(""!==l&&"nofollow"!==l)&&(h=c.length?f(c):e,h=h.filter("["+k+'="'+l+'"]'),j=h.index(this)),a.index=j,!1!==b.open(h,a)&&g.preventDefault())};a=a||{};d=a.index||0;!c||!1===a.live?e.unbind("click.fb-start").bind("click.fb-start",k):p.undelegate(c,"click.fb-start").delegate(c+
|
||||
":not('.fancybox-item, .fancybox-nav')","click.fb-start",k);this.filter("[data-fancybox-start=1]").trigger("click");return this};p.ready(function(){var a,d;f.scrollbarWidth===v&&(f.scrollbarWidth=function(){var a=f('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo("body"),b=a.children(),b=b.innerWidth()-b.height(99).innerWidth();a.remove();return b});if(f.support.fixedPosition===v){a=f.support;d=f('<div style="position:fixed;top:20px;"></div>').appendTo("body");var e=20===
|
||||
d[0].offsetTop||15===d[0].offsetTop;d.remove();a.fixedPosition=e}f.extend(b.defaults,{scrollbarWidth:f.scrollbarWidth(),fixed:f.support.fixedPosition,parent:f("body")});a=f(r).width();J.addClass("fancybox-lock-test");d=f(r).width();J.removeClass("fancybox-lock-test");f("<style type='text/css'>.fancybox-margin{margin-right:"+(d-a)+"px;}</style>").appendTo("head")})})(window,document,jQuery);
|
|
@ -1 +0,0 @@
|
|||
(function(){var g={jQuery:"http://code.jquery.com/jquery-latest.min.js"};var j=function(){(function(k){k.fn.idTabs=function(){var n={};for(var m=0;m<arguments.length;++m){var l=arguments[m];switch(l.constructor){case Object:k.extend(n,l);break;case Boolean:n.change=l;break;case Number:n.start=l;break;case Function:n.click=l;break;case String:if(l.charAt(0)=="."){n.selected=l}else{if(l.charAt(0)=="!"){n.event=l}else{n.start=l}}break}}if(typeof n["return"]=="function"){n.change=n["return"]}return this.each(function(){k.idTabs(this,n)})};k.idTabs=function(n,m){var q=(k.metadata)?k(n).metadata():{};var o=k.extend({},k.idTabs.settings,q,m);if(o.selected.charAt(0)=="."){o.selected=o.selected.substr(1)}if(o.event.charAt(0)=="!"){o.event=o.event.substr(1)}if(o.start==null){o.start=-1}var l=function(){if(k(this).is("."+o.selected)){return o.change}var u="#"+this.href.split("#")[1];var s=[];var t=[];k("a",n).each(function(){if(this.href.match(/#/)){s.push(this);t.push("#"+this.href.split("#")[1])}});if(o.click&&!o.click.apply(this,[u,t,n,o])){return o.change}for(i in s){k(s[i]).removeClass(o.selected)}for(i in t){k(t[i]).hide()}k(this).addClass(o.selected);k(u).show();return o.change};var p=k("a[href*='#']",n).unbind(o.event,l).bind(o.event,l);p.each(function(){k("#"+this.href.split("#")[1]).hide()});var r=false;if((r=p.filter("."+o.selected)).length){}else{if(typeof o.start=="number"&&(r=p.eq(o.start)).length){}else{if(typeof o.start=="string"&&(r=p.filter("[href*='#"+o.start+"']")).length){}}}if(r){r.removeClass(o.selected);r.trigger(o.event)}return o};k.idTabs.settings={start:0,change:false,click:null,selected:".selected",event:"!click"};k.idTabs.version="2.2";k(function(){k(".idTabs").idTabs()})})(jQuery)};var a=function(l,k){k=k.split(".");while(l&&k.length){l=l[k.shift()]}return l};var c=document.getElementsByTagName("head")[0];var f=function(k){var l=document.createElement("script");l.type="text/javascript";l.src=k;c.appendChild(l)};var e=document.getElementsByTagName("script");var h=e[e.length-1].src;var b=true;for(d in g){if(a(this,d)){continue}b=false;f(g[d])}if(b){return j()}f(h)})();
|
|
@ -1,665 +0,0 @@
|
|||
// ----------------------------------------------------------------------------
|
||||
// markItUp! Universal MarkUp Engine, JQuery plugin
|
||||
// v 1.1.x
|
||||
// Dual licensed under the MIT and GPL licenses.
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright (C) 2007-2012 Jay Salvat
|
||||
// http://markitup.jaysalvat.com/
|
||||
// ----------------------------------------------------------------------------
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
// ----------------------------------------------------------------------------
|
||||
(function($) {
|
||||
$.fn.markItUp = function(settings, extraSettings) {
|
||||
var method, params, options, ctrlKey, shiftKey, altKey; ctrlKey = shiftKey = altKey = false;
|
||||
|
||||
if (typeof settings == 'string') {
|
||||
method = settings;
|
||||
params = extraSettings;
|
||||
}
|
||||
|
||||
options = { id: '',
|
||||
nameSpace: '',
|
||||
root: '',
|
||||
previewHandler: false,
|
||||
previewInWindow: '', // 'width=800, height=600, resizable=yes, scrollbars=yes'
|
||||
previewInElement: '',
|
||||
previewAutoRefresh: true,
|
||||
previewPosition: 'after',
|
||||
previewTemplatePath: chrome.extension.getURL('/includes/preview.html'),
|
||||
previewParser: false,
|
||||
previewParserPath: '',
|
||||
previewParserVar: 'data',
|
||||
resizeHandle: true,
|
||||
beforeInsert: '',
|
||||
afterInsert: '',
|
||||
onEnter: {},
|
||||
onShiftEnter: {},
|
||||
onCtrlEnter: {},
|
||||
onTab: {},
|
||||
markupSet: [ { /* set */ } ]
|
||||
};
|
||||
$.extend(options, settings, extraSettings);
|
||||
|
||||
// compute markItUp! path
|
||||
if (!options.root) {
|
||||
$('script').each(function(a, tag) {
|
||||
miuScript = $(tag).get(0).src.match(/(.*)jquery\.markitup(\.pack)?\.js$/);
|
||||
if (miuScript !== null) {
|
||||
options.root = miuScript[1];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Quick patch to keep compatibility with jQuery 1.9
|
||||
var uaMatch = function(ua) {
|
||||
ua = ua.toLowerCase();
|
||||
|
||||
var match = /(chrome)[ \/]([\w.]+)/.exec(ua) ||
|
||||
/(webkit)[ \/]([\w.]+)/.exec(ua) ||
|
||||
/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) ||
|
||||
/(msie) ([\w.]+)/.exec(ua) ||
|
||||
ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) ||
|
||||
[];
|
||||
|
||||
return {
|
||||
browser: match[ 1 ] || "",
|
||||
version: match[ 2 ] || "0"
|
||||
};
|
||||
};
|
||||
var matched = uaMatch( navigator.userAgent );
|
||||
var browser = {};
|
||||
|
||||
if (matched.browser) {
|
||||
browser[matched.browser] = true;
|
||||
browser.version = matched.version;
|
||||
}
|
||||
if (browser.chrome) {
|
||||
browser.webkit = true;
|
||||
} else if (browser.webkit) {
|
||||
browser.safari = true;
|
||||
}
|
||||
|
||||
return this.each(function() {
|
||||
var $$, textarea, levels, scrollPosition, caretPosition, caretOffset,
|
||||
clicked, hash, header, footer, previewWindow, template, iFrame, abort;
|
||||
$$ = $(this);
|
||||
textarea = this;
|
||||
levels = [];
|
||||
abort = false;
|
||||
scrollPosition = caretPosition = 0;
|
||||
caretOffset = -1;
|
||||
|
||||
options.previewParserPath = localize(options.previewParserPath);
|
||||
options.previewTemplatePath = localize(options.previewTemplatePath);
|
||||
|
||||
if (method) {
|
||||
switch(method) {
|
||||
case 'remove':
|
||||
remove();
|
||||
break;
|
||||
case 'insert':
|
||||
markup(params);
|
||||
break;
|
||||
default:
|
||||
$.error('Method ' + method + ' does not exist on jQuery.markItUp');
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// apply the computed path to ~/
|
||||
function localize(data, inText) {
|
||||
if (inText) {
|
||||
return data.replace(/("|')~\//g, "$1"+options.root);
|
||||
}
|
||||
return data.replace(/^~\//, options.root);
|
||||
}
|
||||
|
||||
// init and build editor
|
||||
function init() {
|
||||
id = ''; nameSpace = '';
|
||||
if (options.id) {
|
||||
id = 'id="'+options.id+'"';
|
||||
} else if ($$.attr("id")) {
|
||||
id = 'id="markItUp'+($$.attr("id").substr(0, 1).toUpperCase())+($$.attr("id").substr(1))+'"';
|
||||
|
||||
}
|
||||
if (options.nameSpace) {
|
||||
nameSpace = 'class="'+options.nameSpace+'"';
|
||||
}
|
||||
$$.wrap('<div '+nameSpace+'></div>');
|
||||
$$.wrap('<div '+id+' class="markItUp"></div>');
|
||||
$$.wrap('<div class="markItUpContainer"></div>');
|
||||
$$.addClass("markItUpEditor");
|
||||
|
||||
// add the header before the textarea
|
||||
header = $('<div class="markItUpHeader"></div>').insertBefore($$);
|
||||
$(dropMenus(options.markupSet)).appendTo(header);
|
||||
|
||||
// add the footer after the textarea
|
||||
footer = $('<div class="markItUpFooter"></div>').insertAfter($$);
|
||||
|
||||
// add the resize handle after textarea
|
||||
if (options.resizeHandle === true && browser.safari !== true) {
|
||||
resizeHandle = $('<div class="markItUpResizeHandle"></div>')
|
||||
.insertAfter($$)
|
||||
.bind("mousedown.markItUp", function(e) {
|
||||
var h = $$.height(), y = e.clientY, mouseMove, mouseUp;
|
||||
mouseMove = function(e) {
|
||||
$$.css("height", Math.max(20, e.clientY+h-y)+"px");
|
||||
return false;
|
||||
};
|
||||
mouseUp = function(e) {
|
||||
$("html").unbind("mousemove.markItUp", mouseMove).unbind("mouseup.markItUp", mouseUp);
|
||||
return false;
|
||||
};
|
||||
$("html").bind("mousemove.markItUp", mouseMove).bind("mouseup.markItUp", mouseUp);
|
||||
});
|
||||
footer.append(resizeHandle);
|
||||
}
|
||||
|
||||
// listen key events
|
||||
$$.bind('keydown.markItUp', keyPressed).bind('keyup', keyPressed);
|
||||
|
||||
// bind an event to catch external calls
|
||||
$$.bind("insertion.markItUp", function(e, settings) {
|
||||
if (settings.target !== false) {
|
||||
get();
|
||||
}
|
||||
if (textarea === $.markItUp.focused) {
|
||||
markup(settings);
|
||||
}
|
||||
});
|
||||
|
||||
// remember the last focus
|
||||
$$.bind('focus.markItUp', function() {
|
||||
$.markItUp.focused = this;
|
||||
});
|
||||
|
||||
if (options.previewInElement) {
|
||||
refreshPreview();
|
||||
}
|
||||
}
|
||||
|
||||
// recursively build header with dropMenus from markupset
|
||||
function dropMenus(markupSet) {
|
||||
var ul = $('<ul></ul>'), i = 0;
|
||||
$('li:hover > ul', ul).css('display', 'block');
|
||||
$.each(markupSet, function() {
|
||||
var button = this, t = '', title, li, j;
|
||||
title = (button.key) ? (button.name||'')+' [Ctrl+'+button.key+']' : (button.name||'');
|
||||
key = (button.key) ? 'accesskey="'+button.key+'"' : '';
|
||||
if (button.separator) {
|
||||
li = $('<li class="markItUpSeparator">'+(button.separator||'')+'</li>').appendTo(ul);
|
||||
} else {
|
||||
i++;
|
||||
for (j = levels.length -1; j >= 0; j--) {
|
||||
t += levels[j]+"-";
|
||||
}
|
||||
li = $('<li class="markItUpButton markItUpButton'+t+(i)+' '+(button.className||'')+'"><a href="" '+key+' title="'+title+'">'+(button.name||'')+'</a></li>')
|
||||
.bind("contextmenu.markItUp", function() { // prevent contextmenu on mac and allow ctrl+click
|
||||
return false;
|
||||
}).bind('click.markItUp', function(e) {
|
||||
e.preventDefault();
|
||||
}).bind("focusin.markItUp", function(){
|
||||
$$.focus();
|
||||
}).bind('mouseup', function() {
|
||||
if (button.call) {
|
||||
eval(button.call)();
|
||||
}
|
||||
setTimeout(function() { markup(button) },1);
|
||||
return false;
|
||||
}).bind('mouseenter.markItUp', function() {
|
||||
$('> ul', this).show();
|
||||
$(document).one('click', function() { // close dropmenu if click outside
|
||||
$('ul ul', header).hide();
|
||||
}
|
||||
);
|
||||
}).bind('mouseleave.markItUp', function() {
|
||||
$('> ul', this).hide();
|
||||
}).appendTo(ul);
|
||||
if (button.dropMenu) {
|
||||
levels.push(i);
|
||||
$(li).addClass('markItUpDropMenu').append(dropMenus(button.dropMenu));
|
||||
}
|
||||
}
|
||||
});
|
||||
levels.pop();
|
||||
return ul;
|
||||
}
|
||||
|
||||
// markItUp! markups
|
||||
function magicMarkups(string) {
|
||||
if (string) {
|
||||
string = string.toString();
|
||||
string = string.replace(/\(\!\(([\s\S]*?)\)\!\)/g,
|
||||
function(x, a) {
|
||||
var b = a.split('|!|');
|
||||
if (altKey === true) {
|
||||
return (b[1] !== undefined) ? b[1] : b[0];
|
||||
} else {
|
||||
return (b[1] === undefined) ? "" : b[0];
|
||||
}
|
||||
}
|
||||
);
|
||||
// [![prompt]!], [![prompt:!:value]!]
|
||||
string = string.replace(/\[\!\[([\s\S]*?)\]\!\]/g,
|
||||
function(x, a) {
|
||||
var b = a.split(':!:');
|
||||
if (abort === true) {
|
||||
return false;
|
||||
}
|
||||
value = prompt(b[0], (b[1]) ? b[1] : '');
|
||||
if (value === null) {
|
||||
abort = true;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
);
|
||||
return string;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
// prepare action
|
||||
function prepare(action) {
|
||||
if ($.isFunction(action)) {
|
||||
action = action(hash);
|
||||
}
|
||||
return magicMarkups(action);
|
||||
}
|
||||
|
||||
// build block to insert
|
||||
function build(string) {
|
||||
var openWith = prepare(clicked.openWith);
|
||||
var placeHolder = prepare(clicked.placeHolder);
|
||||
var replaceWith = prepare(clicked.replaceWith);
|
||||
var closeWith = prepare(clicked.closeWith);
|
||||
var openBlockWith = prepare(clicked.openBlockWith);
|
||||
var closeBlockWith = prepare(clicked.closeBlockWith);
|
||||
var multiline = clicked.multiline;
|
||||
|
||||
if (replaceWith !== "") {
|
||||
block = openWith + replaceWith + closeWith;
|
||||
} else if (selection === '' && placeHolder !== '') {
|
||||
block = openWith + placeHolder + closeWith;
|
||||
} else {
|
||||
string = string || selection;
|
||||
|
||||
var lines = [string], blocks = [];
|
||||
|
||||
if (multiline === true) {
|
||||
lines = string.split(/\r?\n/);
|
||||
}
|
||||
|
||||
for (var l = 0; l < lines.length; l++) {
|
||||
line = lines[l];
|
||||
var trailingSpaces;
|
||||
if (trailingSpaces = line.match(/ *$/)) {
|
||||
blocks.push(openWith + line.replace(/ *$/g, '') + closeWith + trailingSpaces);
|
||||
} else {
|
||||
blocks.push(openWith + line + closeWith);
|
||||
}
|
||||
}
|
||||
|
||||
block = blocks.join("\n");
|
||||
}
|
||||
|
||||
block = openBlockWith + block + closeBlockWith;
|
||||
|
||||
return { block:block,
|
||||
openBlockWith:openBlockWith,
|
||||
openWith:openWith,
|
||||
replaceWith:replaceWith,
|
||||
placeHolder:placeHolder,
|
||||
closeWith:closeWith,
|
||||
closeBlockWith:closeBlockWith
|
||||
};
|
||||
}
|
||||
|
||||
// define markup to insert
|
||||
function markup(button) {
|
||||
var len, j, n, i;
|
||||
hash = clicked = button;
|
||||
get();
|
||||
$.extend(hash, { line:"",
|
||||
root:options.root,
|
||||
textarea:textarea,
|
||||
selection:(selection||''),
|
||||
caretPosition:caretPosition,
|
||||
ctrlKey:ctrlKey,
|
||||
shiftKey:shiftKey,
|
||||
altKey:altKey
|
||||
}
|
||||
);
|
||||
// callbacks before insertion
|
||||
prepare(options.beforeInsert);
|
||||
prepare(clicked.beforeInsert);
|
||||
if ((ctrlKey === true && shiftKey === true) || button.multiline === true) {
|
||||
prepare(clicked.beforeMultiInsert);
|
||||
}
|
||||
$.extend(hash, { line:1 });
|
||||
|
||||
if ((ctrlKey === true && shiftKey === true)) {
|
||||
lines = selection.split(/\r?\n/);
|
||||
for (j = 0, n = lines.length, i = 0; i < n; i++) {
|
||||
if ($.trim(lines[i]) !== '') {
|
||||
$.extend(hash, { line:++j, selection:lines[i] } );
|
||||
lines[i] = build(lines[i]).block;
|
||||
} else {
|
||||
lines[i] = "";
|
||||
}
|
||||
}
|
||||
|
||||
string = { block:lines.join('\n')};
|
||||
start = caretPosition;
|
||||
len = string.block.length + ((browser.opera) ? n-1 : 0);
|
||||
} else if (ctrlKey === true) {
|
||||
string = build(selection);
|
||||
start = caretPosition + string.openWith.length;
|
||||
len = string.block.length - string.openWith.length - string.closeWith.length;
|
||||
len = len - (string.block.match(/ $/) ? 1 : 0);
|
||||
len -= fixIeBug(string.block);
|
||||
} else if (shiftKey === true) {
|
||||
string = build(selection);
|
||||
start = caretPosition;
|
||||
len = string.block.length;
|
||||
len -= fixIeBug(string.block);
|
||||
} else {
|
||||
string = build(selection);
|
||||
start = caretPosition + string.block.length ;
|
||||
len = 0;
|
||||
start -= fixIeBug(string.block);
|
||||
}
|
||||
if ((selection === '' && string.replaceWith === '')) {
|
||||
caretOffset += fixOperaBug(string.block);
|
||||
|
||||
start = caretPosition + string.openBlockWith.length + string.openWith.length;
|
||||
len = string.block.length - string.openBlockWith.length - string.openWith.length - string.closeWith.length - string.closeBlockWith.length;
|
||||
|
||||
caretOffset = $$.val().substring(caretPosition, $$.val().length).length;
|
||||
caretOffset -= fixOperaBug($$.val().substring(0, caretPosition));
|
||||
}
|
||||
$.extend(hash, { caretPosition:caretPosition, scrollPosition:scrollPosition } );
|
||||
|
||||
if (string.block !== selection && abort === false) {
|
||||
insert(string.block);
|
||||
set(start, len);
|
||||
} else {
|
||||
caretOffset = -1;
|
||||
}
|
||||
get();
|
||||
|
||||
$.extend(hash, { line:'', selection:selection });
|
||||
|
||||
// callbacks after insertion
|
||||
if ((ctrlKey === true && shiftKey === true) || button.multiline === true) {
|
||||
prepare(clicked.afterMultiInsert);
|
||||
}
|
||||
prepare(clicked.afterInsert);
|
||||
prepare(options.afterInsert);
|
||||
|
||||
// refresh preview if opened
|
||||
if (previewWindow && options.previewAutoRefresh) {
|
||||
refreshPreview();
|
||||
}
|
||||
|
||||
// reinit keyevent
|
||||
shiftKey = altKey = ctrlKey = abort = false;
|
||||
}
|
||||
|
||||
// Substract linefeed in Opera
|
||||
function fixOperaBug(string) {
|
||||
if (browser.opera) {
|
||||
return string.length - string.replace(/\n*/g, '').length;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
// Substract linefeed in IE
|
||||
function fixIeBug(string) {
|
||||
if (browser.msie) {
|
||||
return string.length - string.replace(/\r*/g, '').length;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// add markup
|
||||
function insert(block) {
|
||||
if (document.selection) {
|
||||
var newSelection = document.selection.createRange();
|
||||
newSelection.text = block;
|
||||
} else {
|
||||
textarea.value = textarea.value.substring(0, caretPosition) + block + textarea.value.substring(caretPosition + selection.length, textarea.value.length);
|
||||
}
|
||||
}
|
||||
|
||||
// set a selection
|
||||
function set(start, len) {
|
||||
if (textarea.createTextRange){
|
||||
// quick fix to make it work on Opera 9.5
|
||||
if (browser.opera && browser.version >= 9.5 && len == 0) {
|
||||
return false;
|
||||
}
|
||||
range = textarea.createTextRange();
|
||||
range.collapse(true);
|
||||
range.moveStart('character', start);
|
||||
range.moveEnd('character', len);
|
||||
range.select();
|
||||
} else if (textarea.setSelectionRange ){
|
||||
textarea.setSelectionRange(start, start + len);
|
||||
}
|
||||
textarea.scrollTop = scrollPosition;
|
||||
textarea.focus();
|
||||
}
|
||||
|
||||
// get the selection
|
||||
function get() {
|
||||
textarea.focus();
|
||||
|
||||
scrollPosition = textarea.scrollTop;
|
||||
if (document.selection) {
|
||||
selection = document.selection.createRange().text;
|
||||
if (browser.msie) { // ie
|
||||
var range = document.selection.createRange(), rangeCopy = range.duplicate();
|
||||
rangeCopy.moveToElementText(textarea);
|
||||
caretPosition = -1;
|
||||
while(rangeCopy.inRange(range)) {
|
||||
rangeCopy.moveStart('character');
|
||||
caretPosition ++;
|
||||
}
|
||||
} else { // opera
|
||||
caretPosition = textarea.selectionStart;
|
||||
}
|
||||
} else { // gecko & webkit
|
||||
caretPosition = textarea.selectionStart;
|
||||
|
||||
selection = textarea.value.substring(caretPosition, textarea.selectionEnd);
|
||||
}
|
||||
return selection;
|
||||
}
|
||||
|
||||
// open preview window
|
||||
function preview() {
|
||||
if (typeof options.previewHandler === 'function') {
|
||||
previewWindow = true;
|
||||
} else if (options.previewInElement) {
|
||||
previewWindow = $(options.previewInElement);
|
||||
} else if (!previewWindow || previewWindow.closed) {
|
||||
if (options.previewInWindow) {
|
||||
previewWindow = window.open('', 'preview', options.previewInWindow);
|
||||
$(window).unload(function() {
|
||||
previewWindow.close();
|
||||
});
|
||||
} else {
|
||||
iFrame = $('<iframe class="markItUpPreviewFrame"></iframe>');
|
||||
if (options.previewPosition == 'after') {
|
||||
iFrame.insertAfter(footer);
|
||||
} else {
|
||||
iFrame.insertBefore(header);
|
||||
}
|
||||
previewWindow = iFrame[iFrame.length - 1].contentWindow || frame[iFrame.length - 1];
|
||||
}
|
||||
} else if (altKey === true) {
|
||||
if (iFrame) {
|
||||
iFrame.remove();
|
||||
} else {
|
||||
previewWindow.close();
|
||||
}
|
||||
previewWindow = iFrame = false;
|
||||
}
|
||||
if (!options.previewAutoRefresh) {
|
||||
refreshPreview();
|
||||
}
|
||||
if (options.previewInWindow) {
|
||||
previewWindow.focus();
|
||||
}
|
||||
}
|
||||
|
||||
// refresh Preview window
|
||||
function refreshPreview() {
|
||||
renderPreview();
|
||||
}
|
||||
|
||||
function renderPreview() {
|
||||
var phtml;
|
||||
if (options.previewHandler && typeof options.previewHandler === 'function') {
|
||||
options.previewHandler( $$.val() );
|
||||
} else if (options.previewParser && typeof options.previewParser === 'function') {
|
||||
var data = options.previewParser( $$.val() );
|
||||
writeInPreview(localize(data, 1) );
|
||||
} else if (options.previewParserPath !== '') {
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
dataType: 'text',
|
||||
global: false,
|
||||
url: options.previewParserPath,
|
||||
data: options.previewParserVar+'='+encodeURIComponent($$.val()),
|
||||
success: function(data) {
|
||||
writeInPreview( localize(data, 1) );
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (!template) {
|
||||
$.ajax({
|
||||
url: options.previewTemplatePath,
|
||||
dataType: 'text',
|
||||
global: false,
|
||||
success: function(data) {
|
||||
writeInPreview( localize(data, 1).replace(/<!-- content -->/g, $$.val()) );
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function writeInPreview(data) {
|
||||
if (options.previewInElement) {
|
||||
$(options.previewInElement).html(data);
|
||||
} else if (previewWindow && previewWindow.document) {
|
||||
try {
|
||||
sp = previewWindow.document.documentElement.scrollTop
|
||||
} catch(e) {
|
||||
sp = 0;
|
||||
}
|
||||
previewWindow.document.open();
|
||||
previewWindow.document.write(data);
|
||||
previewWindow.document.close();
|
||||
previewWindow.document.documentElement.scrollTop = sp;
|
||||
}
|
||||
}
|
||||
|
||||
// set keys pressed
|
||||
function keyPressed(e) {
|
||||
shiftKey = e.shiftKey;
|
||||
altKey = e.altKey;
|
||||
ctrlKey = (!(e.altKey && e.ctrlKey)) ? (e.ctrlKey || e.metaKey) : false;
|
||||
|
||||
if (e.type === 'keydown') {
|
||||
if (ctrlKey === true) {
|
||||
li = $('a[accesskey="'+((e.keyCode == 13) ? '\\n' : String.fromCharCode(e.keyCode))+'"]', header).parent('li');
|
||||
if (li.length !== 0) {
|
||||
ctrlKey = false;
|
||||
setTimeout(function() {
|
||||
li.triggerHandler('mouseup');
|
||||
},1);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (e.keyCode === 13 || e.keyCode === 10) { // Enter key
|
||||
if (ctrlKey === true) { // Enter + Ctrl
|
||||
ctrlKey = false;
|
||||
markup(options.onCtrlEnter);
|
||||
return options.onCtrlEnter.keepDefault;
|
||||
} else if (shiftKey === true) { // Enter + Shift
|
||||
shiftKey = false;
|
||||
markup(options.onShiftEnter);
|
||||
return options.onShiftEnter.keepDefault;
|
||||
} else { // only Enter
|
||||
markup(options.onEnter);
|
||||
return options.onEnter.keepDefault;
|
||||
}
|
||||
}
|
||||
if (e.keyCode === 9) { // Tab key
|
||||
if (shiftKey == true || ctrlKey == true || altKey == true) {
|
||||
return false;
|
||||
}
|
||||
if (caretOffset !== -1) {
|
||||
get();
|
||||
caretOffset = $$.val().length - caretOffset;
|
||||
set(caretOffset, 0);
|
||||
caretOffset = -1;
|
||||
return false;
|
||||
} else {
|
||||
markup(options.onTab);
|
||||
return options.onTab.keepDefault;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function remove() {
|
||||
$$.unbind(".markItUp").removeClass('markItUpEditor');
|
||||
$$.parent('div').parent('div.markItUp').parent('div').replaceWith($$);
|
||||
$$.data('markItUp', null);
|
||||
}
|
||||
|
||||
init();
|
||||
});
|
||||
};
|
||||
|
||||
$.fn.markItUpRemove = function() {
|
||||
return this.each(function() {
|
||||
$(this).markItUp('remove');
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
$.markItUp = function(settings) {
|
||||
var options = { target:false };
|
||||
$.extend(options, settings);
|
||||
if (options.target) {
|
||||
return $(options.target).each(function() {
|
||||
$(this).focus();
|
||||
$(this).trigger('insertion', [options]);
|
||||
});
|
||||
} else {
|
||||
$('textarea').trigger('insertion', [options]);
|
||||
}
|
||||
};
|
||||
})(jQuery);
|
|
@ -49,4 +49,4 @@ miu = {
|
|||
}
|
||||
return '\n'+heading;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
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);
|
||||
};
|
|
@ -0,0 +1,37 @@
|
|||
/**
|
||||
* Объект для получения опций
|
||||
* @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;
|
||||
};
|
|
@ -1,203 +1,242 @@
|
|||
var ppOptions = [
|
||||
// Fancybox
|
||||
'option_fancybox', 'option_fancybox_images', 'option_fancybox_videos', 'option_fancybox_posts',
|
||||
// CTRL+Enter
|
||||
'option_ctrl_enter',
|
||||
// Load original images
|
||||
'option_images_load_original',
|
||||
// Fluid layout
|
||||
'option_fluid_layout',
|
||||
// Visual editor for posts
|
||||
'option_visual_editor_post',
|
||||
// Google search
|
||||
'option_search_with_google',
|
||||
// WebSocket
|
||||
'option_ws',
|
||||
// Comments
|
||||
'option_ws_comments', 'option_ws_comments_color_fadeout', 'option_ws_comments_notifications',
|
||||
// Feeds
|
||||
'option_ws_feeds', 'option_ws_feeds_subscriptions', 'option_ws_feeds_blogs',
|
||||
// Font size
|
||||
'option_enlarge_font', 'option_enlarge_font_size',
|
||||
// @ before username
|
||||
'option_at_before_username'
|
||||
];
|
||||
/**
|
||||
* Объект, управляющий сохранением настроек на странице настроек
|
||||
*
|
||||
* При создании сохраняет версию, восстанавливает настройки, слушает изменения на инпутах.
|
||||
* @constructor
|
||||
*/
|
||||
function OptionsPage() {
|
||||
this.form = document.querySelector('form');
|
||||
|
||||
// Saves options to localStorage.
|
||||
function pp_save_options() {
|
||||
// CTRL+Enter
|
||||
var option_ctrl_enter = document.getElementById('option-ctrl-enter');
|
||||
// Fancybox
|
||||
//
|
||||
var option_fancybox = document.getElementById('option-fancybox');
|
||||
// Images
|
||||
var option_fancybox_images = document.getElementById('option-fancybox-images');
|
||||
// Videos
|
||||
var option_fancybox_videos = document.getElementById('option-fancybox-videos');
|
||||
// Posts
|
||||
var option_fancybox_posts = document.getElementById('option-fancybox-posts');
|
||||
// Fluid layout
|
||||
var option_fluid_layout = document.getElementById('option-layout-fluid');
|
||||
// Load original images
|
||||
var option_images_load_original = document.getElementById('option-images-load-original');
|
||||
// Visual editor for posts
|
||||
var option_visual_editor_post = document.getElementById('option-visual-editor-post');
|
||||
// Google search
|
||||
var checkbox_search_with_google = document.getElementById('option-search-with-google');
|
||||
// WebSocket
|
||||
//
|
||||
var option_ws = document.getElementById('option-ws');
|
||||
// Comments
|
||||
var option_ws_comments = document.getElementById('option-ws-comments');
|
||||
// Fade out highlight comments
|
||||
var option_ws_comments_color_fadeout = document.getElementById('option-ws-comments-color-fadeout');
|
||||
// Comments desktop notifications
|
||||
var option_ws_comments_notifications = document.getElementById('option-ws-comments-notifications');
|
||||
// Feeds
|
||||
var option_ws_feeds = document.getElementById('option-ws-feeds');
|
||||
// Subscriptions
|
||||
var option_ws_feeds_subscriptions = document.getElementById('option-ws-feeds-subscriptions');
|
||||
// Blogs
|
||||
var option_ws_feeds_blogs = document.getElementById('option-ws-feeds-blogs');
|
||||
// Font size
|
||||
var option_enlarge_font = document.getElementById('option-enlarge-font');
|
||||
// Size ratio
|
||||
var option_enlarge_font_size = document.querySelector('input[name="pp-font-size"]:checked');
|
||||
// @ before username
|
||||
var option_at_before_username = document.getElementById('option-at-before-username');
|
||||
|
||||
// Saving parameters
|
||||
chrome.storage.sync.set({
|
||||
'option_ctrl_enter': option_ctrl_enter.checked,
|
||||
'option_fancybox': option_fancybox.checked,
|
||||
'option_fancybox_images': option_fancybox_images.checked,
|
||||
'option_fancybox_videos': option_fancybox_videos.checked,
|
||||
'option_fancybox_posts': option_fancybox_posts.checked,
|
||||
'option_fluid_layout': option_fluid_layout.checked,
|
||||
'option_images_load_original': option_images_load_original.checked,
|
||||
'option_visual_editor_post': option_visual_editor_post.checked,
|
||||
'option_search_with_google': checkbox_search_with_google.checked,
|
||||
'option_ws': option_ws.checked,
|
||||
'option_ws_comments': option_ws_comments.checked,
|
||||
'option_ws_comments_color_fadeout': option_ws_comments_color_fadeout.checked,
|
||||
'option_ws_comments_notifications': option_ws_comments_notifications.checked,
|
||||
'option_ws_feeds': option_ws_feeds.checked,
|
||||
'option_ws_feeds_subscriptions': option_ws_feeds_subscriptions.checked,
|
||||
'option_ws_feeds_blogs': option_ws_feeds_blogs.checked,
|
||||
'option_enlarge_font': option_enlarge_font.checked,
|
||||
'option_enlarge_font_size': option_enlarge_font_size.value,
|
||||
'option_at_before_username': option_at_before_username.checked
|
||||
}, function() {
|
||||
// Update status to let user know options were saved.
|
||||
var status = document.getElementById('status');
|
||||
status.innerHTML = 'Options Saved.';
|
||||
setTimeout(function() {
|
||||
window.close();
|
||||
}, 1500);
|
||||
});
|
||||
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));
|
||||
}
|
||||
|
||||
// Restores select box state to saved value from localStorage.
|
||||
function pp_restore_options() {
|
||||
// Loading options
|
||||
chrome.storage.sync.get(ppOptions, function(options) {
|
||||
// CTRL+Enter
|
||||
if (options.option_ctrl_enter == true) {
|
||||
document.getElementById('option-ctrl-enter').checked = true;
|
||||
/**
|
||||
* Получает версию настроек. Если она не равна версии приложения, записывает в сторедж плагина настройки из инпутов
|
||||
* и версию приложения.
|
||||
*/
|
||||
OptionsPage.prototype.updateOptionsFromFrom = function() {
|
||||
chrome.storage.sync.get('options_version', function(data) {
|
||||
this.logVersion(data.options_version);
|
||||
|
||||
if (data.options_version !== this.version) {
|
||||
console.log('Initializing options...');
|
||||
|
||||
Array.prototype.forEach.call(this.form.elements, this.updateOptionFromInput.bind(this));
|
||||
|
||||
chrome.storage.sync.set({
|
||||
options: this.getValues(),
|
||||
options_version: this.version
|
||||
}, function() {
|
||||
console.log('Default options initialized. Version upgraded to %s.', this.version);
|
||||
|
||||
/* global confirm */
|
||||
if (! confirm(chrome.i18n.getMessage('options_text_new_version'))) {
|
||||
window.close();
|
||||
}
|
||||
});
|
||||
}
|
||||
// Fancybox
|
||||
//
|
||||
if (options.option_fancybox == true) {
|
||||
document.getElementById('option-fancybox').checked = true;
|
||||
}.bind(this));
|
||||
};
|
||||
|
||||
/**
|
||||
* Сохраняет настройки
|
||||
*/
|
||||
OptionsPage.prototype.save = function() {
|
||||
var ppOptions = this.getValues();
|
||||
|
||||
console.log('Saving options: %O', ppOptions);
|
||||
|
||||
chrome.storage.sync.set({ options: ppOptions }, this.updateStatus.bind(this));
|
||||
};
|
||||
|
||||
/**
|
||||
* Получает настройки из стореджа плагина, устанавливает соответствующим инпутам соответствующие значения.
|
||||
*/
|
||||
OptionsPage.prototype.restore = function() {
|
||||
this.checkOldStyle();
|
||||
|
||||
chrome.storage.sync.get('options', function(data) {
|
||||
this._options = data.options || {};
|
||||
|
||||
// Setting options in DOM
|
||||
Object.keys(this._options).forEach(function(key) {
|
||||
var data = this._options[key],
|
||||
input = this.form.elements[this.getOptionName(key)];
|
||||
|
||||
if (input) {
|
||||
switch (data.type) {
|
||||
case 'boolean':
|
||||
input.checked = data.value;
|
||||
break;
|
||||
|
||||
case 'enum':
|
||||
case 'plain':
|
||||
input.value = data.value;
|
||||
break;
|
||||
|
||||
default:
|
||||
console.warn('Invalid option "%s" type: %O', key, data);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}.bind(this));
|
||||
|
||||
this.updateOptionsFromFrom();
|
||||
}.bind(this));
|
||||
};
|
||||
|
||||
/**
|
||||
* @returns {Object} Хеш настроек вида { имя_настроки: значение_настройки }
|
||||
*/
|
||||
OptionsPage.prototype.getValues = function() {
|
||||
return this._options;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {Event} event Событие изменения
|
||||
*/
|
||||
OptionsPage.prototype._onChange = function(event) {
|
||||
this.updateOptionFromInput(event.target);
|
||||
this.save();
|
||||
};
|
||||
|
||||
OptionsPage.prototype.updateOptionFromInput = function(input) {
|
||||
var key = this.getOptionKey(input.name);
|
||||
|
||||
if (this.isBoolean(input)) {
|
||||
this._options[key] = {
|
||||
type: 'boolean',
|
||||
value: input.checked
|
||||
};
|
||||
} else if (this.isEnum(input)) {
|
||||
this._options[key] = {
|
||||
type: 'enum',
|
||||
value: input.value
|
||||
};
|
||||
} else {
|
||||
this._options[key] = {
|
||||
type: 'plain',
|
||||
value: input.value
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {HTMLElement} option Элемент опции
|
||||
* @returns {Boolean} Является ли настройка булевой
|
||||
*/
|
||||
OptionsPage.prototype.isBoolean = function(option) {
|
||||
return option.getAttribute('type') === 'checkbox';
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {HTMLElement} option Элемент опции
|
||||
* @returns {Boolean} Является ли настройка енумом
|
||||
*/
|
||||
OptionsPage.prototype.isEnum = function(option) {
|
||||
return option.getAttribute('type') === 'radio';
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {String} name Имя инпута
|
||||
* @returns {String} Ключ для хеша настроек
|
||||
*/
|
||||
OptionsPage.prototype.getOptionKey = function(name) {
|
||||
return name.replace(/-/g, '_');
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {String} Ключ хеша настроек
|
||||
* @returns {String} Имя инпута
|
||||
*/
|
||||
OptionsPage.prototype.getOptionName = function(key) {
|
||||
return key.replace(/_/g, '-');
|
||||
};
|
||||
|
||||
/**
|
||||
* Выводит в консоль версию настроек и версию плагина
|
||||
* @param {String} optionsVersion
|
||||
*/
|
||||
OptionsPage.prototype.logVersion = function(optionsVersion) {
|
||||
console.info('Point+ %s, local options are for %s', this.version, optionsVersion);
|
||||
};
|
||||
|
||||
/**
|
||||
* Добавляет номер версии в подвал
|
||||
*/
|
||||
OptionsPage.prototype.showVersion = function() {
|
||||
document.querySelector('#version').innerHTML = this.version;
|
||||
};
|
||||
|
||||
/**
|
||||
* Проверяет, не старого ли формата настройки. И если старого, то удаляет их.
|
||||
*/
|
||||
OptionsPage.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);
|
||||
}
|
||||
}
|
||||
|
||||
console.log('All old data removed');
|
||||
});
|
||||
}
|
||||
// Images
|
||||
if (options.option_fancybox_images == true) {
|
||||
document.getElementById('option-fancybox-images').checked = true;
|
||||
}
|
||||
// Videos
|
||||
if (options.option_fancybox_videos == true) {
|
||||
document.getElementById('option-fancybox-videos').checked = true;
|
||||
}
|
||||
// Posts
|
||||
if (options.option_fancybox_posts == true) {
|
||||
document.getElementById('option-fancybox-posts').checked = true;
|
||||
}
|
||||
// Fluid layout
|
||||
if (options.option_fluid_layout == true) {
|
||||
document.getElementById('option-layout-fluid').checked = true;
|
||||
}
|
||||
// Load original images
|
||||
if (options.option_images_load_original == true) {
|
||||
document.getElementById('option-images-load-original').checked = true;
|
||||
}
|
||||
// Visual editor for posts
|
||||
if (options.option_visual_editor_post == true) {
|
||||
document.getElementById('option-visual-editor-post').checked = true;
|
||||
}
|
||||
// Google search
|
||||
if (options.option_search_with_google == true) {
|
||||
document.getElementById('option-search-with-google').checked = true;
|
||||
}
|
||||
// WebSocket
|
||||
//
|
||||
if (options.option_ws == true) {
|
||||
document.getElementById('option-ws').checked = true;
|
||||
}
|
||||
// Comments
|
||||
if (options.option_ws_comments == true) {
|
||||
document.getElementById('option-ws-comments').checked = true;
|
||||
}
|
||||
// Fade out highlight comments
|
||||
if (options.option_ws_comments_color_fadeout == true) {
|
||||
document.getElementById('option-ws-comments-color-fadeout').checked = true;
|
||||
}
|
||||
// Comments desktop notifications
|
||||
// Disabling for Opera
|
||||
if (/OPR/.test(navigator.userAgent)) {
|
||||
document.getElementById('option-ws-comments-notifications').setAttribute('disabled', 'disabled');
|
||||
}
|
||||
if (options.option_ws_comments_notifications == true) {
|
||||
document.getElementById('option-ws-comments-notifications').checked = true;
|
||||
}
|
||||
// Feeds
|
||||
if (options.option_ws_feeds == true) {
|
||||
document.getElementById('option-ws-feeds').checked = true;
|
||||
}
|
||||
// Subscriptions
|
||||
if (options.option_ws_feeds_subscriptions == true) {
|
||||
document.getElementById('option-ws-feeds-subscriptions').checked = true;
|
||||
}
|
||||
// Blogs
|
||||
if (options.option_ws_feeds_blogs == true) {
|
||||
document.getElementById('option-ws-feeds-blogs').checked = true;
|
||||
}
|
||||
// Font size
|
||||
if (options.option_enlarge_font == true) {
|
||||
document.getElementById('option-enlarge-font').checked = true;
|
||||
}
|
||||
// Size ratio
|
||||
if (options.option_enlarge_font_size !== undefined) {
|
||||
document.getElementById('option-enlarge-font-' + options.option_enlarge_font_size).checked = true;
|
||||
}
|
||||
// @ before username
|
||||
if (options.option_at_before_username == true) {
|
||||
document.getElementById('option-at-before-username').checked = true;
|
||||
}
|
||||
|
||||
// Showing version
|
||||
document.getElementById('pp-version').innerHTML = 'Point+ ' + getVersion() + ' by <a href="http://skobkin-ru.point.im/" target="_blank">@skobkin-ru</a>';
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
document.addEventListener('DOMContentLoaded', pp_restore_options);
|
||||
document.querySelector('#save').addEventListener('click', pp_save_options);
|
||||
/**
|
||||
* Показывает плашку про то, что настройки сохранились и надо обновить страницу
|
||||
*/
|
||||
OptionsPage.prototype.updateStatus = function() {
|
||||
this.status = this.status || document.querySelector('.saved');
|
||||
|
||||
// Getting version from manifest.json
|
||||
function getVersion() {
|
||||
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;
|
||||
}
|
||||
this.status.classList.remove('hidden');
|
||||
};
|
||||
|
||||
/**
|
||||
* Слушает события на табах
|
||||
*/
|
||||
OptionsPage.prototype.listenTabs = function() {
|
||||
var options = this;
|
||||
|
||||
options._selectedItem = document.querySelector('.tabs-item.selected');
|
||||
options._selectedContent = document.querySelector('.tabs-content-item.selected');
|
||||
|
||||
Array.prototype.forEach.call(document.querySelectorAll('.tabs-item'), function(tabItem) {
|
||||
var tabContent = document.querySelector(tabItem.getAttribute('href'));
|
||||
|
||||
tabItem.addEventListener('click', function() {
|
||||
options._selectedItem.classList.remove('selected');
|
||||
options._selectedContent.classList.remove('selected');
|
||||
|
||||
this.classList.add('selected');
|
||||
tabContent.classList.add('selected');
|
||||
|
||||
options._selectedItem = this;
|
||||
options._selectedContent = tabContent;
|
||||
}, false);
|
||||
});
|
||||
};
|
||||
|
||||
new OptionsPage();
|
||||
|
|
|
@ -1,58 +1,68 @@
|
|||
{
|
||||
"manifest_version": 2,
|
||||
"name": "Point+",
|
||||
"version": "1.8",
|
||||
"author": "Alexey Skobkin",
|
||||
"homepage_url": "https://bitbucket.org/skobkin/chrome_point_plus",
|
||||
"description": "More features for point.im",
|
||||
"options_page": "options.html",
|
||||
"page_action": {
|
||||
"default_icon": {
|
||||
"19": "images/icon19.png",
|
||||
"38": "images/icon38.png"
|
||||
},
|
||||
"default_title": "Point+",
|
||||
"default_popup": "options.html"
|
||||
},
|
||||
"icons": {
|
||||
"16": "images/icon16.png",
|
||||
"32": "images/icon32.png",
|
||||
"48": "images/icon48.png",
|
||||
"64": "images/icon64.png",
|
||||
"128": "images/icon128.png",
|
||||
"256": "images/icon256.png"
|
||||
},
|
||||
"content_scripts": [
|
||||
{
|
||||
"matches": ["http://*.point.im/*", "https://*.point.im/*"],
|
||||
"js": [
|
||||
"js/jquery-1.10.1.min.js",
|
||||
"js/jquery.fancybox.pack.js", "js/jquery.fancybox-media.js",
|
||||
"js/markitup/jquery.markitup.js", "js/markitup/sets/markdown/set.js",
|
||||
"js/options.js",
|
||||
"js/point-plus.js"
|
||||
],
|
||||
"css": [
|
||||
"css/jquery.fancybox.css",
|
||||
"css/markitup/skins/markitup/style.css", "css/markitup/sets/markdown/style.css",
|
||||
"css/point-plus.css"
|
||||
],
|
||||
"run_at": "document_end"
|
||||
}
|
||||
],
|
||||
"web_accessible_resources": [
|
||||
"images/*",
|
||||
"includes/*",
|
||||
"manifest.json"
|
||||
],
|
||||
"background": {
|
||||
"scripts": ["js/background.js"]
|
||||
},
|
||||
"permissions": [
|
||||
"http://*.point.im/*",
|
||||
"https://*.point.im/*",
|
||||
"storage",
|
||||
"notifications",
|
||||
"tabs"
|
||||
]
|
||||
}
|
||||
{
|
||||
"manifest_version": 2,
|
||||
"name": "Point+",
|
||||
"version": "1.42.1",
|
||||
"default_locale": "ru",
|
||||
"author": "__MSG_ext_author__",
|
||||
"homepage_url": "https://bitbucket.org/skobkin/chrome_point_plus",
|
||||
"description": "__MSG_ext_description__",
|
||||
"options_page": "options.html",
|
||||
"page_action": {
|
||||
"default_icon": {
|
||||
"19": "images/icon19.png",
|
||||
"38": "images/icon38.png"
|
||||
},
|
||||
"default_title": "__MSG_ext_page_action_title__",
|
||||
"default_popup": "options.html"
|
||||
},
|
||||
"icons": {
|
||||
"16": "images/icon16.png",
|
||||
"32": "images/icon32.png",
|
||||
"48": "images/icon48.png",
|
||||
"64": "images/icon64.png",
|
||||
"128": "images/icon128.png",
|
||||
"256": "images/icon256.png"
|
||||
},
|
||||
"content_scripts": [
|
||||
{
|
||||
"matches": ["http://*.point.im/*", "https://*.point.im/*"],
|
||||
"js": [
|
||||
"vendor/jquery/dist/jquery.min.js",
|
||||
|
||||
"js/options-manager.js",
|
||||
"js/message-sender.js",
|
||||
|
||||
"js/point-plus.js"
|
||||
],
|
||||
"css": [
|
||||
"css/point-plus.css"
|
||||
],
|
||||
"run_at": "document_end"
|
||||
}
|
||||
],
|
||||
"web_accessible_resources": [
|
||||
"images/*",
|
||||
"includes/*",
|
||||
"vendor/*",
|
||||
"manifest.json"
|
||||
],
|
||||
"background": {
|
||||
"scripts": ["js/background.js"]
|
||||
},
|
||||
"permissions": [
|
||||
"http://point.im/*",
|
||||
"https://point.im/*",
|
||||
"http://*.point.im/*",
|
||||
"https://*.point.im/*",
|
||||
"https://pleer.com/*",
|
||||
"http://player.soundcloud.com/*",
|
||||
"https://player.soundcloud.com/*",
|
||||
"https://api.kanaria.ru/point/*",
|
||||
"https://*.twitter.com/*",
|
||||
"https://api.instagram.com/*",
|
||||
"https://coub.com/embed/*",
|
||||
"storage",
|
||||
"notifications",
|
||||
"tabs"
|
||||
]
|
||||
}
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
.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;
|
||||
}
|
|
@ -0,0 +1,311 @@
|
|||
/**
|
||||
* Находит элемент #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');
|
||||
});
|
||||
};
|
|
@ -0,0 +1,172 @@
|
|||
/**
|
||||
* Подгружает картинки через сервер Никиты
|
||||
* @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));
|
||||
};
|
|
@ -1,153 +1,307 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>Point Plus options</title>
|
||||
|
||||
<link rel="stylesheet" href="css/point-plus.css" type="text/css"/>
|
||||
<script src="js/jquery-1.10.1.min.js"></script>
|
||||
<script src="js/jquery.idTabs.min.js"></script>
|
||||
</head>
|
||||
|
||||
<body class="pp-options">
|
||||
<div class="tabs usual">
|
||||
<ul class="idTabs">
|
||||
<li><a href="#media">Media</a></li>
|
||||
<li><a href="#other">Other</a></li>
|
||||
<li><a href="#websocket">WebSockets</a></li>
|
||||
<li><a href="#feedback">Feedback</a></li>
|
||||
</ul>
|
||||
|
||||
<div id="tabs-content">
|
||||
<div class="tab-content" id="media">
|
||||
<div class="option">
|
||||
<input type="checkbox" id="option-fancybox"><label for="option-fancybox">Enable Fancybox</label>
|
||||
|
||||
<div class="option">
|
||||
<input type="checkbox" id="option-fancybox-images"><label for="option-fancybox-images">Use for images</label>
|
||||
</div>
|
||||
|
||||
<div class="option">
|
||||
<input type="checkbox" id="option-fancybox-videos"><label for="option-fancybox-videos">Use for videos (YouTube, ...)</label>
|
||||
</div>
|
||||
|
||||
<div class="option">
|
||||
<input type="checkbox" id="option-fancybox-posts"><label for="option-fancybox-posts">Use for post links (including comments)</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="option">
|
||||
<input type="checkbox" id="option-images-load-original"><label for="option-images-load-original">Load original images instead of thumbnails</label>
|
||||
</div>
|
||||
|
||||
<div class="option">
|
||||
<input type="checkbox" id="option-embedding" disabled><label for="option-embedding">Enable embedding</label>
|
||||
|
||||
<div class="option">
|
||||
<input type="checkbox" id="option-embedding-soundcloud"><label for="option-embedding-soundcloud">Soundcloud</label>
|
||||
</div>
|
||||
|
||||
<div class="option">
|
||||
<input type="checkbox" id="option-embedding-youtube" disabled><label for="option-embedding-youtube">YouTube</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-content" id="other">
|
||||
<div class="option">
|
||||
<input type="checkbox" id="option-ctrl-enter"><label for="option-ctrl-enter">Send post and comments by CTRL+Enter</label>
|
||||
</div>
|
||||
|
||||
<div class="option">
|
||||
<input type="checkbox" id="option-layout-fluid"><label for="option-layout-fluid">Fluid layout</label>
|
||||
</div>
|
||||
|
||||
<div class="option">
|
||||
<input type="checkbox" id="option-visual-editor-post"><label for="option-visual-editor-post">Show visual editor for posts</label>
|
||||
</div>
|
||||
|
||||
<div class="option">
|
||||
<input type="checkbox" id="option-search-with-google"><label for="option-search-with-google">Use Google search in header</label>
|
||||
</div>
|
||||
|
||||
<div class="option">
|
||||
<input type="checkbox" id="option-enlarge-font"><label for="option-enlarge-font">Enlarge font size</label>
|
||||
|
||||
<div class="option">
|
||||
<input name="pp-font-size" id="option-enlarge-font-85" type="radio" value="85" checked="checked"><label for="option-enlarge-font-85">0.85em</label>
|
||||
<input name="pp-font-size" id="option-enlarge-font-100" type="radio" value="100"><label for="option-enlarge-font-100">1em</label>
|
||||
<input name="pp-font-size" id="option-enlarge-font-110" type="radio" value="110"><label for="option-enlarge-font-110">1.1em</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="option">
|
||||
<input type="checkbox" id="option-at-before-username"><label for="option-at-before-username">@ before username</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-content" id="websocket">
|
||||
<div class="option">
|
||||
<input type="checkbox" id="option-ws"><label for="option-ws">Enable WebSockets</label>
|
||||
|
||||
<div class="option">
|
||||
<input type="checkbox" id="option-ws-comments"><label for="option-ws-comments">Process comments</label>
|
||||
|
||||
<div class="option">
|
||||
<input type="checkbox" id="option-ws-comments-color-fadeout"><label for="option-ws-comments-color-fadeout">Fade out highlight in 20 sec</label>
|
||||
</div>
|
||||
|
||||
<div class="option">
|
||||
<input type="checkbox" id="option-ws-comments-notifications"><label for="option-ws-comments-notifications">Show desktop notifications (Chrome only)</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="option">
|
||||
<input type="checkbox" id="option-ws-feeds" disabled><label for="option-ws-feeds">Process feeds</label>
|
||||
|
||||
<div class="option">
|
||||
<input type="checkbox" id="option-ws-feeds-subscriptions"><label for="option-ws-feeds-subscriptions">Subscriptions feed</label>
|
||||
</div>
|
||||
|
||||
<div class="option">
|
||||
<input type="checkbox" id="option-ws-feeds-blogs"><label for="option-ws-feeds-blogs">User blog pages (only when subscribed)</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-content" id="feedback">
|
||||
<div class="text">
|
||||
<p>
|
||||
If you find an error do not hesitate to <a href="https://bitbucket.org/skobkin/chrome_point_plus/issues?status=new&status=open" target="_blank">send me a bug report</a>.
|
||||
</p>
|
||||
<p>
|
||||
You can make a donation in the following ways:
|
||||
</p>
|
||||
<p>
|
||||
Yandex.Money: 41001539215836
|
||||
</p>
|
||||
<p>
|
||||
Novacoin: 4d1ctdZtKkv3kxGdAXjfNEjfFvtDVdbf65
|
||||
</p>
|
||||
<p>
|
||||
<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=WW33X5J5WFSP4" target="_blank">PayPal</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="panel">
|
||||
<div id="status"></div>
|
||||
|
||||
<div class="left">
|
||||
<button id="save" class="button">Save</button>
|
||||
</div>
|
||||
|
||||
<div class="right">
|
||||
<div id="pp-version"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="js/options.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
<!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>
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
config.folder=
|
||||
file.reference.src-chrome_point_plus=.
|
||||
files.encoding=UTF-8
|
||||
site.root.folder=${file.reference.src-chrome_point_plus}
|
||||
test.folder=
|
|
@ -1,9 +0,0 @@
|
|||
<?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>
|
|
@ -0,0 +1,8 @@
|
|||
#!/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"
|
|
@ -0,0 +1,2 @@
|
|||
#!/usr/bin/env bash
|
||||
zip -9 -r chrome_point_plus.zip chrome_point_plus
|
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
"name": "chrome-point-plus",
|
||||
"version": "1.42.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"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git@bitbucket.org:skobkin/chrome_point_plus.git"
|
||||
},
|
||||
"author": "\"Alexey Skobkin\"",
|
||||
"license": "MIT",
|
||||
"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"
|
||||
}
|
||||
}
|