08-27-周三_17-09-29
This commit is contained in:
92
node_modules/gitbook-plugin-splitter/.npmignore
generated
vendored
Normal file
92
node_modules/gitbook-plugin-splitter/.npmignore
generated
vendored
Normal file
@@ -0,0 +1,92 @@
|
||||
### https://raw.github.com/github/gitignore/a4ec7f03ca5ae0bf09fad42c0fb7d1e8346bcf25/Node.gitignore
|
||||
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
|
||||
# Runtime data
|
||||
pids
|
||||
*.pid
|
||||
*.seed
|
||||
|
||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||
lib-cov
|
||||
|
||||
# Coverage directory used by tools like istanbul
|
||||
coverage
|
||||
|
||||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
|
||||
.grunt
|
||||
|
||||
# node-waf configuration
|
||||
.lock-wscript
|
||||
|
||||
# Compiled binary addons (http://nodejs.org/api/addons.html)
|
||||
build/Release
|
||||
|
||||
# Dependency directory
|
||||
# https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git
|
||||
node_modules
|
||||
|
||||
|
||||
### https://raw.github.com/github/gitignore/a4ec7f03ca5ae0bf09fad42c0fb7d1e8346bcf25/Global/OSX.gitignore
|
||||
|
||||
.DS_Store
|
||||
.AppleDouble
|
||||
.LSOverride
|
||||
|
||||
# Icon must end with two \r
|
||||
Icon
|
||||
|
||||
|
||||
# Thumbnails
|
||||
._*
|
||||
|
||||
# Files that might appear in the root of a volume
|
||||
.DocumentRevisions-V100
|
||||
.fseventsd
|
||||
.Spotlight-V100
|
||||
.TemporaryItems
|
||||
.Trashes
|
||||
.VolumeIcon.icns
|
||||
|
||||
# Directories potentially created on remote AFP share
|
||||
.AppleDB
|
||||
.AppleDesktop
|
||||
Network Trash Folder
|
||||
Temporary Items
|
||||
.apdisk
|
||||
|
||||
|
||||
### https://raw.github.com/github/gitignore/a4ec7f03ca5ae0bf09fad42c0fb7d1e8346bcf25/Global/Windows.gitignore
|
||||
|
||||
# Windows image file caches
|
||||
Thumbs.db
|
||||
ehthumbs.db
|
||||
|
||||
# Folder config file
|
||||
Desktop.ini
|
||||
|
||||
# Recycle Bin used on file shares
|
||||
$RECYCLE.BIN/
|
||||
|
||||
# Windows Installer files
|
||||
*.cab
|
||||
*.msi
|
||||
*.msm
|
||||
*.msp
|
||||
|
||||
# Windows shortcuts
|
||||
*.lnk
|
||||
|
||||
|
||||
### https://raw.github.com/github/gitignore/a4ec7f03ca5ae0bf09fad42c0fb7d1e8346bcf25/Global/Linux.gitignore
|
||||
|
||||
*~
|
||||
|
||||
# KDE directory preferences
|
||||
.directory
|
||||
|
||||
# Linux trash folder which might appear on any partition or disk
|
||||
.Trash-*
|
||||
|
21
node_modules/gitbook-plugin-splitter/LICENSE.txt
generated
vendored
Normal file
21
node_modules/gitbook-plugin-splitter/LICENSE.txt
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 yoshidax
|
||||
|
||||
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.
|
45
node_modules/gitbook-plugin-splitter/README.md
generated
vendored
Normal file
45
node_modules/gitbook-plugin-splitter/README.md
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
gitbook-plugin-splitter
|
||||
==============
|
||||
|
||||

|
||||
|
||||
this plug-in provides a vertical bar that divides the summary and main content.
|
||||
|
||||
[](https://nodei.co/npm/gitbook-plugin-splitter/)
|
||||
|
||||
### other feature
|
||||
|
||||
* It will save the position information of the splitter to sessionStorage.
|
||||
|
||||
### How to use it?
|
||||
|
||||
Add it to your `book.json` configuration:
|
||||
|
||||
```json
|
||||
{
|
||||
"plugins": ["splitter"]
|
||||
}
|
||||
```
|
||||
|
||||
Install your plugins using:
|
||||
|
||||
```bash
|
||||
$ gitbook install
|
||||
```
|
||||
|
||||
### change logs
|
||||
|
||||
#### version 0.0.6 (2016-12-06T16:54:38)
|
||||
|
||||
* fix: Fixed not to do anything when the width of the screen size was 600px or less (#6)
|
||||
* fix: changed the position of the bar position from "localStorage" to "sessiongStorage" (#10)
|
||||
|
||||
#### version 0.0.6 (2015-11-06T16:54:38)
|
||||
|
||||
* supported Gitbook v3
|
||||
|
||||
#### version 0.0.5 (2015-11-06T16:54:38)
|
||||
|
||||
* fixed don't work toggle button of summary view display from Gitbook V2.5.x
|
||||
|
||||
This software is released under the MIT License, see LICENSE.txt.
|
22
node_modules/gitbook-plugin-splitter/book/splitter.css
generated
vendored
Normal file
22
node_modules/gitbook-plugin-splitter/book/splitter.css
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
.divider-content-summary {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
height: 100%;
|
||||
width: 5px;
|
||||
display: table;
|
||||
cursor: col-resize;
|
||||
color: #ccc;
|
||||
-webkit-transition: color 350ms ease;
|
||||
-moz-transition: color 350ms ease;
|
||||
-o-transition: color 350ms ease;
|
||||
transition: color 350ms ease
|
||||
}
|
||||
.divider-content-summary:hover {
|
||||
color: #444;
|
||||
}
|
||||
.divider-content-summary__icon {
|
||||
display: table-cell;
|
||||
vertical-align: middle;
|
||||
text-align: center;
|
||||
}
|
128
node_modules/gitbook-plugin-splitter/book/splitter.js
generated
vendored
Normal file
128
node_modules/gitbook-plugin-splitter/book/splitter.js
generated
vendored
Normal file
@@ -0,0 +1,128 @@
|
||||
require(['gitbook', 'jQuery'], function (gitbook, $) {
|
||||
|
||||
// MEMO:
|
||||
// Gitbook is calculated as "calc (100% - 60px)" in the horizontal width when the width of the screen size is 600px
|
||||
// or less.
|
||||
// In this case, since contradiction occurs in the implementation of this module, return.
|
||||
if($(window).width() <= 600) {
|
||||
return;
|
||||
}
|
||||
|
||||
gitbook.events.bind('start', function () {
|
||||
});
|
||||
|
||||
gitbook.events.bind('page.change', function () {
|
||||
|
||||
var KEY_SPLIT_STATE = 'plugin_gitbook_split';
|
||||
|
||||
var dividerWidth = null;
|
||||
var isDraggable = false;
|
||||
var dividerCenterOffsetLeft = null;
|
||||
var splitState = null;
|
||||
var grabPointWidth = null;
|
||||
|
||||
var $body = $('body');
|
||||
var $book = $('.book');
|
||||
var $summary = $('.book-summary');
|
||||
var $bookBody = $('.book-body');
|
||||
var $divider = $('<div class="divider-content-summary">' +
|
||||
'<div class="divider-content-summary__icon">' +
|
||||
'<i class="fa fa-ellipsis-v"></i>' +
|
||||
'</div>' +
|
||||
'</div>');
|
||||
|
||||
$summary.append($divider);
|
||||
|
||||
dividerWidth = $divider.outerWidth();
|
||||
dividerCenterOffsetLeft = $divider.outerWidth() / 2;
|
||||
|
||||
// restore split state from sessionStorage
|
||||
splitState = getSplitState();
|
||||
setSplitState(
|
||||
splitState.summaryWidth,
|
||||
splitState.summaryOffset,
|
||||
splitState.bookBodyOffset
|
||||
);
|
||||
|
||||
setTimeout(function() {
|
||||
var isGreaterThanEqualGitbookV2_5 = !Boolean($('.toggle-summary').length);
|
||||
|
||||
var $toggleSummary = isGreaterThanEqualGitbookV2_5
|
||||
? $('.fa.fa-align-justify').parent() : $('.toggle-summary');
|
||||
|
||||
$toggleSummary.on('click', function () {
|
||||
|
||||
var summaryOffset = null;
|
||||
var bookBodyOffset = null;
|
||||
|
||||
var isOpen = isGreaterThanEqualGitbookV2_5
|
||||
? !gitbook.sidebar.isOpen() : $book.hasClass('with-summary');
|
||||
|
||||
if (isOpen) {
|
||||
summaryOffset = -($summary.outerWidth());
|
||||
bookBodyOffset = 0;
|
||||
} else {
|
||||
summaryOffset = 0;
|
||||
bookBodyOffset = $summary.outerWidth();
|
||||
}
|
||||
|
||||
setSplitState($summary.outerWidth(), summaryOffset, bookBodyOffset);
|
||||
saveSplitState($summary.outerWidth(), summaryOffset, bookBodyOffset);
|
||||
});
|
||||
}, 1);
|
||||
|
||||
$divider.on('mousedown', function (event) {
|
||||
event.stopPropagation();
|
||||
isDraggable = true;
|
||||
grabPointWidth = $summary.outerWidth() - event.pageX;
|
||||
});
|
||||
|
||||
$body.on('mouseup', function (event) {
|
||||
event.stopPropagation();
|
||||
isDraggable = false;
|
||||
saveSplitState(
|
||||
$summary.outerWidth(),
|
||||
$summary.position().left,
|
||||
$bookBody.position().left
|
||||
);
|
||||
});
|
||||
|
||||
$body.on('mousemove', function (event) {
|
||||
if (!isDraggable) {
|
||||
return;
|
||||
}
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
$summary.outerWidth(event.pageX + grabPointWidth);
|
||||
$bookBody.offset({ left: event.pageX + grabPointWidth });
|
||||
});
|
||||
|
||||
function getSplitState() {
|
||||
var splitState = JSON.parse(sessionStorage.getItem(KEY_SPLIT_STATE));
|
||||
splitState || (splitState = {});
|
||||
splitState.summaryWidth || (splitState.summaryWidth = $summary.outerWidth());
|
||||
splitState.summaryOffset || (splitState.summaryOffset = $summary.position().left);
|
||||
splitState.bookBodyOffset || (splitState.bookBodyOffset = $bookBody.position().left);
|
||||
return splitState;
|
||||
}
|
||||
|
||||
function saveSplitState(summaryWidth, summaryWidthOffset, bookBodyOffset) {
|
||||
sessionStorage.setItem(KEY_SPLIT_STATE, JSON.stringify({
|
||||
summaryWidth: summaryWidth,
|
||||
summaryOffset: summaryWidthOffset,
|
||||
bookBodyOffset: bookBodyOffset,
|
||||
}));
|
||||
}
|
||||
|
||||
function setSplitState(summaryWidth, summaryOffset, bookBodyOffset) {
|
||||
$summary.outerWidth(summaryWidth);
|
||||
$summary.offset({ left: summaryOffset });
|
||||
$bookBody.offset({ left: bookBodyOffset });
|
||||
// improved broken layout in windows chrome.
|
||||
// "$(x).offset" automatically add to "position:relative".
|
||||
// but it cause layout broken..
|
||||
$summary.css({ position: 'absolute' });
|
||||
$bookBody.css({ position: 'absolute' });
|
||||
}
|
||||
});
|
||||
});
|
BIN
node_modules/gitbook-plugin-splitter/gitbook-splitter-demo.gif
generated
vendored
Normal file
BIN
node_modules/gitbook-plugin-splitter/gitbook-splitter-demo.gif
generated
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 274 KiB |
11
node_modules/gitbook-plugin-splitter/index.js
generated
vendored
Normal file
11
node_modules/gitbook-plugin-splitter/index.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
module.exports = {
|
||||
website: {
|
||||
assets: './book',
|
||||
js: [
|
||||
'splitter.js'
|
||||
],
|
||||
css: [
|
||||
'splitter.css'
|
||||
]
|
||||
}
|
||||
};
|
86
node_modules/gitbook-plugin-splitter/package.json
generated
vendored
Normal file
86
node_modules/gitbook-plugin-splitter/package.json
generated
vendored
Normal file
@@ -0,0 +1,86 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
{
|
||||
"name": "gitbook-plugin-splitter",
|
||||
"raw": "gitbook-plugin-splitter@0.0.8",
|
||||
"rawSpec": "0.0.8",
|
||||
"scope": null,
|
||||
"spec": "0.0.8",
|
||||
"type": "version"
|
||||
},
|
||||
"F:\\tmp\\gitbook"
|
||||
]
|
||||
],
|
||||
"_from": "gitbook-plugin-splitter@0.0.8",
|
||||
"_id": "gitbook-plugin-splitter@0.0.8",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/gitbook-plugin-splitter",
|
||||
"_nodeVersion": "4.4.6",
|
||||
"_npmOperationalInternal": {
|
||||
"host": "packages-12-west.internal.npmjs.com",
|
||||
"tmp": "tmp/gitbook-plugin-splitter-0.0.8.tgz_1482673186113_0.8095600951928645"
|
||||
},
|
||||
"_npmUser": {
|
||||
"email": "takehiko.yoshida.z@gmail.com",
|
||||
"name": "yoshidax"
|
||||
},
|
||||
"_npmVersion": "2.15.5",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "gitbook-plugin-splitter",
|
||||
"raw": "gitbook-plugin-splitter@0.0.8",
|
||||
"rawSpec": "0.0.8",
|
||||
"scope": null,
|
||||
"spec": "0.0.8",
|
||||
"type": "version"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"#USER"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/gitbook-plugin-splitter/-/gitbook-plugin-splitter-0.0.8.tgz",
|
||||
"_shasum": "f2b0513060fc9266b46b04182e4eca1d4b71fafc",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "gitbook-plugin-splitter@0.0.8",
|
||||
"_where": "F:\\tmp\\gitbook",
|
||||
"author": {
|
||||
"name": "yoshidax"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/yoshidax/gitbook-plugin-splitter/issues"
|
||||
},
|
||||
"dependencies": {},
|
||||
"description": "this plug-in provides a vertical bar that divides the summary and main content.",
|
||||
"devDependencies": {},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "f2b0513060fc9266b46b04182e4eca1d4b71fafc",
|
||||
"tarball": "https://registry.npmjs.org/gitbook-plugin-splitter/-/gitbook-plugin-splitter-0.0.8.tgz"
|
||||
},
|
||||
"engines": {
|
||||
"gitbook": ">1.x.x"
|
||||
},
|
||||
"gitHead": "dada79ec409081427aa43abdd7aff083920f4994",
|
||||
"homepage": "https://github.com/yoshidax/gitbook-plugin-splitter#readme",
|
||||
"keywords": [
|
||||
"gitbook"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"maintainers": [
|
||||
{
|
||||
"email": "takehiko.yoshida.z@gmail.com",
|
||||
"name": "yoshidax"
|
||||
}
|
||||
],
|
||||
"name": "gitbook-plugin-splitter",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/yoshidax/gitbook-plugin-splitter.git"
|
||||
},
|
||||
"scripts": {},
|
||||
"version": "0.0.8"
|
||||
}
|
Reference in New Issue
Block a user