mirror of
https://bitbucket.org/skobkin/chrome_point_plus.git
synced 2024-11-23 18:56:04 +00:00
Dynamic injection of JS and CSS.
This commit is contained in:
parent
3447244261
commit
a62d45c8c1
|
@ -141,6 +141,20 @@ $(document).ready(function() {
|
||||||
|
|
||||||
// Fancybox
|
// Fancybox
|
||||||
if (options.is('option_fancybox')) {
|
if (options.is('option_fancybox')) {
|
||||||
|
// Injecting Fancybox to the page
|
||||||
|
chrome.extension.sendMessage({
|
||||||
|
type: 'injectJSFile',
|
||||||
|
file: 'vendor/fancybox/source/jquery.fancybox.pack.js'
|
||||||
|
});
|
||||||
|
chrome.extension.sendMessage({
|
||||||
|
type: 'injectJSFile',
|
||||||
|
file: 'vendor/fancybox/source/helpers/jquery.fancybox-media.js'
|
||||||
|
});
|
||||||
|
chrome.extension.sendMessage({
|
||||||
|
type: 'injectCSSFile',
|
||||||
|
file: 'vendor/fancybox/source/jquery.fancybox.css'
|
||||||
|
});
|
||||||
|
|
||||||
if (options.is('option_fancybox_bind_images_to_one_flow')) {
|
if (options.is('option_fancybox_bind_images_to_one_flow')) {
|
||||||
// Linking images in posts to the galleries
|
// Linking images in posts to the galleries
|
||||||
$('.post-content .text').each(function() {
|
$('.post-content .text').each(function() {
|
||||||
|
@ -268,6 +282,26 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
// Visual editor
|
// Visual editor
|
||||||
if (options.is('option_visual_editor_post')) {
|
if (options.is('option_visual_editor_post')) {
|
||||||
|
// Injecting editor JS
|
||||||
|
chrome.extension.sendMessage({
|
||||||
|
type: 'injectJSFile',
|
||||||
|
file: 'vendor/markitup/markitup/jquery.markitup.js'
|
||||||
|
});
|
||||||
|
// Getting mySettings from set.js
|
||||||
|
chrome.extension.sendMessage({
|
||||||
|
type: 'injectJSFile',
|
||||||
|
file: 'js/markitup/sets/markdown/set.js'
|
||||||
|
});
|
||||||
|
// CSS
|
||||||
|
chrome.extension.sendMessage({
|
||||||
|
type: 'injectCSSFile',
|
||||||
|
file: 'vendor/markitup/markitup/skins/markitup/style.css'
|
||||||
|
});
|
||||||
|
chrome.extension.sendMessage({
|
||||||
|
type: 'injectCSSFile',
|
||||||
|
file: 'css/markitup/sets/markdown/style.css'
|
||||||
|
});
|
||||||
|
|
||||||
// Add classes
|
// Add classes
|
||||||
$('#new-post-form #text-input, .post-content #text-input').addClass('markitup').css('height', '20em');
|
$('#new-post-form #text-input, .post-content #text-input').addClass('markitup').css('height', '20em');
|
||||||
// Init
|
// Init
|
||||||
|
|
|
@ -29,10 +29,6 @@
|
||||||
"js": [
|
"js": [
|
||||||
"vendor/jquery/jquery.min.js",
|
"vendor/jquery/jquery.min.js",
|
||||||
|
|
||||||
"vendor/fancybox/source/jquery.fancybox.pack.js",
|
|
||||||
"vendor/fancybox/source/helpers/jquery.fancybox-media.js",
|
|
||||||
|
|
||||||
"vendor/markitup/markitup/jquery.markitup.js",
|
|
||||||
"js/markitup/sets/markdown/set.js",
|
"js/markitup/sets/markdown/set.js",
|
||||||
|
|
||||||
"js/bquery_ajax.js",
|
"js/bquery_ajax.js",
|
||||||
|
@ -40,11 +36,6 @@
|
||||||
"js/point-plus.js"
|
"js/point-plus.js"
|
||||||
],
|
],
|
||||||
"css": [
|
"css": [
|
||||||
"vendor/fancybox/source/jquery.fancybox.css",
|
|
||||||
|
|
||||||
"vendor/markitup/markitup/skins/markitup/style.css",
|
|
||||||
"css/markitup/sets/markdown/style.css",
|
|
||||||
|
|
||||||
"css/point-plus.css"
|
"css/point-plus.css"
|
||||||
],
|
],
|
||||||
"run_at": "document_end"
|
"run_at": "document_end"
|
||||||
|
|
Loading…
Reference in a new issue