diff --git a/.gitignore b/.gitignore index 6dbebdbd..ad4d0fec 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,20 @@ -/.vs -/packages -/HandyControl/bin -/HandyControl/obj -/HandyControlDemo/bin -/HandyControlDemo/obj -/DockBoxResearch/bin -/DockBoxResearch/obj -/HandyControl.sln.DotSettings.user \ No newline at end of file +DockBoxResearch/bin +DockBoxResearch/obj +src/.vs +src/Core_30/HandyControl_Core_30/bin +src/Core_30/HandyControl_Core_30/obj +src/Core_30/HandyControlDemo_Core_30/bin +src/Core_30/HandyControlDemo_Core_30/obj +src/Net_35/HandyControl_Net_35/bin +src/Net_35/HandyControl_Net_35/obj +src/Net_35/HandyControlDemo_Net_35/bin +src/Net_35/HandyControlDemo_Net_35/obj +src/Net_40/HandyControl_Net_40/bin +src/Net_40/HandyControl_Net_40/obj +src/Net_40/HandyControlDemo_Net_40/bin +src/Net_40/HandyControlDemo_Net_40/obj +src/Net_GE45/HandyControl_Net_GE45/bin +src/Net_GE45/HandyControl_Net_GE45/obj +src/Net_GE45/HandyControlDemo_Net_GE45/bin +src/Net_GE45/HandyControlDemo_Net_GE45/obj +*.user \ No newline at end of file diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..40da9727 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,76 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at 836904362@qq.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq diff --git a/HandyControl.sln b/HandyControl.sln deleted file mode 100644 index 51457f1d..00000000 --- a/HandyControl.sln +++ /dev/null @@ -1,36 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27703.2000 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HandyControl", "HandyControl\HandyControl.csproj", "{DC966E3D-BCFF-4652-98CF-070E5494749A}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HandyControlDemo", "HandyControlDemo\HandyControlDemo.csproj", "{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug-Net45|Any CPU = Debug-Net45|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {DC966E3D-BCFF-4652-98CF-070E5494749A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DC966E3D-BCFF-4652-98CF-070E5494749A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DC966E3D-BCFF-4652-98CF-070E5494749A}.Debug-Net45|Any CPU.ActiveCfg = Debug-Net45|Any CPU - {DC966E3D-BCFF-4652-98CF-070E5494749A}.Debug-Net45|Any CPU.Build.0 = Debug-Net45|Any CPU - {DC966E3D-BCFF-4652-98CF-070E5494749A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DC966E3D-BCFF-4652-98CF-070E5494749A}.Release|Any CPU.Build.0 = Release|Any CPU - {9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug-Net45|Any CPU.ActiveCfg = Debug-Net45|Any CPU - {9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug-Net45|Any CPU.Build.0 = Debug-Net45|Any CPU - {9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {3B28FE22-B7B9-4058-9EF9-936C53C986CA} - EndGlobalSection -EndGlobal diff --git a/HandyControl/Controls/Attach/TitleElement.cs b/HandyControl/Controls/Attach/TitleElement.cs deleted file mode 100644 index 14415c6f..00000000 --- a/HandyControl/Controls/Attach/TitleElement.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Windows; -using System.Windows.Media; - -namespace HandyControl.Controls -{ - public class TitleElement - { - public static readonly DependencyProperty BackgroundProperty = DependencyProperty.RegisterAttached( - "Background", typeof(Brush), typeof(TitleElement), new FrameworkPropertyMetadata(default(Brush), FrameworkPropertyMetadataOptions.Inherits)); - - public static void SetBackground(DependencyObject element, Brush value) - => element.SetValue(BackgroundProperty, value); - - public static Brush GetBackground(DependencyObject element) - => (Brush) element.GetValue(BackgroundProperty); - - public static readonly DependencyProperty ForegroundProperty = DependencyProperty.RegisterAttached( - "Foreground", typeof(Brush), typeof(TitleElement), new FrameworkPropertyMetadata(default(Brush), FrameworkPropertyMetadataOptions.Inherits)); - - public static void SetForeground(DependencyObject element, Brush value) - => element.SetValue(ForegroundProperty, value); - - public static Brush GetForeground(DependencyObject element) - => (Brush) element.GetValue(ForegroundProperty); - - public static readonly DependencyProperty BorderBrushProperty = DependencyProperty.RegisterAttached( - "BorderBrush", typeof(Brush), typeof(TitleElement), new FrameworkPropertyMetadata(default(Brush), FrameworkPropertyMetadataOptions.Inherits)); - - public static void SetBorderBrush(DependencyObject element, Brush value) - => element.SetValue(BorderBrushProperty, value); - - public static Brush GetBorderBrush(DependencyObject element) - => (Brush) element.GetValue(BorderBrushProperty); - } -} \ No newline at end of file diff --git a/HandyControl/Controls/Text/StackText.cs b/HandyControl/Controls/Text/StackText.cs deleted file mode 100644 index 1429bd10..00000000 --- a/HandyControl/Controls/Text/StackText.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System.Windows; - -namespace HandyControl.Controls -{ - public class StackText : FrameworkElement - { - - } -} \ No newline at end of file diff --git a/HandyControl/Themes/Styles/Base/GroupBoxBaseStyle.xaml b/HandyControl/Themes/Styles/Base/GroupBoxBaseStyle.xaml deleted file mode 100644 index 69d1f5fa..00000000 --- a/HandyControl/Themes/Styles/Base/GroupBoxBaseStyle.xaml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - \ No newline at end of file diff --git a/HandyControl/Themes/Styles/GroupBox.xaml b/HandyControl/Themes/Styles/GroupBox.xaml deleted file mode 100644 index eda414ae..00000000 --- a/HandyControl/Themes/Styles/GroupBox.xaml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/HandyControl/Tools/Helper/VisualHelper.cs b/HandyControl/Tools/Helper/VisualHelper.cs deleted file mode 100644 index 972318ec..00000000 --- a/HandyControl/Tools/Helper/VisualHelper.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.Linq; -using System.Windows; -using System.Windows.Media; - -namespace HandyControl.Tools -{ - internal class VisualHelper - { - public static VisualStateGroup TryGetVisualStateGroup(DependencyObject dependencyObject, string groupName) - { - var root = GetImplementationRoot(dependencyObject); - if (root == null) - { - return null; - } - - return VisualStateManager - .GetVisualStateGroups(root)? - .OfType() - .FirstOrDefault(group => string.CompareOrdinal(groupName, group.Name) == 0); - } - - public static FrameworkElement GetImplementationRoot(DependencyObject dependencyObject) - { - return 1 == VisualTreeHelper.GetChildrenCount(dependencyObject) - ? VisualTreeHelper.GetChild(dependencyObject, 0) as FrameworkElement - : null; - } - } -} \ No newline at end of file diff --git a/HandyControlDemo/Resources/Img/icon.ico b/HandyControlDemo/Resources/Img/icon.ico deleted file mode 100644 index 3505fe70..00000000 Binary files a/HandyControlDemo/Resources/Img/icon.ico and /dev/null differ diff --git a/HandyControlDemo/UserControl/Controls/AnimationPathDemoCtl.xaml b/HandyControlDemo/UserControl/Controls/AnimationPathDemoCtl.xaml deleted file mode 100644 index 378c4c43..00000000 --- a/HandyControlDemo/UserControl/Controls/AnimationPathDemoCtl.xaml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - diff --git a/HandyControlDemo/UserControl/Controls/CircleProgressBarDemoCtl.xaml b/HandyControlDemo/UserControl/Controls/CircleProgressBarDemoCtl.xaml deleted file mode 100644 index 1d89bbbc..00000000 --- a/HandyControlDemo/UserControl/Controls/CircleProgressBarDemoCtl.xaml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - diff --git a/HandyControlDemo/UserControl/Controls/GrowlDemoCtl.xaml b/HandyControlDemo/UserControl/Controls/GrowlDemoCtl.xaml deleted file mode 100644 index 7f5b6932..00000000 --- a/HandyControlDemo/UserControl/Controls/GrowlDemoCtl.xaml +++ /dev/null @@ -1,19 +0,0 @@ - - - - + + diff --git a/doc/themes/next/layout/_partials/header/index.swig b/doc/themes/next/layout/_partials/header/index.swig new file mode 100644 index 00000000..42a90de2 --- /dev/null +++ b/doc/themes/next/layout/_partials/header/index.swig @@ -0,0 +1,9 @@ +{{ partial('_partials/header/brand.swig', {}, {cache: theme.cache.enable}) }} +{% include 'menu.swig' %} + +{% if theme.custom_file_path.header %} + {% set custom_header = '../../../../../' + theme.custom_file_path.header %} +{% else %} + {% set custom_header = '../../_custom/header.swig' %} +{% endif %} +{% include custom_header %} diff --git a/doc/themes/next/layout/_partials/header/menu.swig b/doc/themes/next/layout/_partials/header/menu.swig new file mode 100644 index 00000000..2394449f --- /dev/null +++ b/doc/themes/next/layout/_partials/header/menu.swig @@ -0,0 +1,52 @@ +{% import '../../_macro/menu/menu-item.swig' as menu_item %} + + diff --git a/doc/themes/next/layout/_partials/header/sub-menu.swig b/doc/themes/next/layout/_partials/header/sub-menu.swig new file mode 100644 index 00000000..665f1da2 --- /dev/null +++ b/doc/themes/next/layout/_partials/header/sub-menu.swig @@ -0,0 +1,100 @@ +{% if not is_home() && not is_post() %} + {% if theme.menu %} + + {% import '../../_macro/menu/menu-item.swig' as menu_item %} + + {# Submenu & Submenu-2 #} + {% for name, value in theme.menu %} + {% set respath = value %} + {% if value == '[object Object]' %} + + {# If current URL is value of parent submenu 'default' path #} + {% set currentParentUrl = page.path.split('/')[0] | trim %} + {% if currentParentUrl == value.default.split('||')[0] | trim | replace('/', '', 'g') %} + + {# Submenu items #} + + {# End Submenu items #} + + {# Submenu-2 #} + {% for name, value in theme.menu %} + {% set respath = value %} + {% if value == '[object Object]' %} + + {% for subname, subvalue in value %} + {% set itemName = subname.toLowerCase() %} + {% if itemName == 'default' %} + {% set parentValue = subvalue.split('||')[0] | trim %} + {% endif %} + {% if subvalue == '[object Object]' %} + + {# If current URL is value of parent submenu 'default' path #} + {% set paths = page.path.split('/') %} + {% if paths.length > 2 %} + {% if paths[1] == subvalue.default.split('||')[0] | trim | replace('/', '', 'g') %} + + {# Submenu-2 items #} + + {# End Submenu-2 items #} + + {% endif %} + {% endif %} + {# End URL & path comparing #} + + {% endif %} + {% endfor %} + + {% endif %} + {% endfor %} + {# End Submenu-2 #} + + {% endif %} + {# End URL & path comparing #} + + {% endif %} + {% endfor %} + {# End Submenu & Submenu-2 #} + + {% endif %} +{% endif %} diff --git a/doc/themes/next/layout/_partials/page/breadcrumb.swig b/doc/themes/next/layout/_partials/page/breadcrumb.swig new file mode 100644 index 00000000..e550a3a2 --- /dev/null +++ b/doc/themes/next/layout/_partials/page/breadcrumb.swig @@ -0,0 +1,27 @@ +{% set paths = page.path.split('/') %} +{% set count = paths.length %} +{% if count > 2 %} + {% set current = 0 %} + {% set link = '' %} + +{% endif %} diff --git a/doc/themes/next/layout/_partials/page/page-header.swig b/doc/themes/next/layout/_partials/page/page-header.swig new file mode 100644 index 00000000..469d4bfa --- /dev/null +++ b/doc/themes/next/layout/_partials/page/page-header.swig @@ -0,0 +1,15 @@ +
+ +<{% if theme.seo %}h2{% else %}h1{% endif %} class="post-title" itemprop="name headline"> + {{- page.title -}} + {% include '../post-edit.swig' %} + + + + +
diff --git a/doc/themes/next/layout/_partials/pagination.swig b/doc/themes/next/layout/_partials/pagination.swig new file mode 100644 index 00000000..1038580b --- /dev/null +++ b/doc/themes/next/layout/_partials/pagination.swig @@ -0,0 +1,11 @@ +{% if page.prev or page.next %} + +{% endif %} diff --git a/doc/themes/next/layout/_partials/post-edit.swig b/doc/themes/next/layout/_partials/post-edit.swig new file mode 100644 index 00000000..ce8fa6ce --- /dev/null +++ b/doc/themes/next/layout/_partials/post-edit.swig @@ -0,0 +1,4 @@ +{% if theme.post_edit.enable -%} + {% set editIcon = '' -%} + {{ next_url(theme.post_edit.url + page.source, editIcon, {class: 'post-edit-link', title: __('post.edit') }) }} +{%- endif %} diff --git a/doc/themes/next/layout/_partials/post/post-copyright.swig b/doc/themes/next/layout/_partials/post/post-copyright.swig new file mode 100644 index 00000000..968aa707 --- /dev/null +++ b/doc/themes/next/layout/_partials/post/post-copyright.swig @@ -0,0 +1,26 @@ +{% set ccLicense = theme.creative_commons.license | lower %} +{% set ccLanguage = theme.creative_commons.language %} +{% set ccIcon = '' %} +{% set ccText = ccLicense | upper %} +{% if ccLicense === 'zero' %} + {% set ccType = 'publicdomain/zero/1.0/' + ccLanguage %} +{% else %} + {% set ccType = 'licenses/' + ccLicense + '/4.0/' + ccLanguage %} +{% endif %} +{% set ccURL = 'https://creativecommons.org/' + ccType %} + +
    +
  • + {{ __('post.copyright.author') + __('symbol.colon') }} {# + #}{{ post.author || author }}{# +#}
  • +
  • + {{ __('post.copyright.link') + __('symbol.colon') }} + {% set postURL = post.url || post.permalink %} + {{ next_url(postURL, postURL, {title: post.title}) }} +
  • +
  • + {{ __('post.copyright.license_title') + __('symbol.colon') }} {# + #}{{ __('post.copyright.license_content', next_url(ccURL, ccIcon + ccText)) }}{# +#}
  • +
diff --git a/doc/themes/next/layout/_partials/post/post-related.swig b/doc/themes/next/layout/_partials/post/post-related.swig new file mode 100644 index 00000000..de71edbe --- /dev/null +++ b/doc/themes/next/layout/_partials/post/post-related.swig @@ -0,0 +1,20 @@ +{% set popular_posts = popular_posts_json(theme.related_posts.params, post) %} +{% if popular_posts.json and popular_posts.json.length > 0 %} + + +{% endif %} diff --git a/doc/themes/next/layout/_partials/post/reward.swig b/doc/themes/next/layout/_partials/post/reward.swig new file mode 100644 index 00000000..e8f60b69 --- /dev/null +++ b/doc/themes/next/layout/_partials/post/reward.swig @@ -0,0 +1,22 @@ +
+
{{ theme.reward_settings.comment }}
+ + +
diff --git a/doc/themes/next/layout/_partials/post/wechat-subscriber.swig b/doc/themes/next/layout/_partials/post/wechat-subscriber.swig new file mode 100644 index 00000000..e7e03578 --- /dev/null +++ b/doc/themes/next/layout/_partials/post/wechat-subscriber.swig @@ -0,0 +1,4 @@ +
+ {{ author }} wechat +
{{ theme.wechat_subscriber.description }}
+
diff --git a/doc/themes/next/layout/_partials/search/algolia-search.swig b/doc/themes/next/layout/_partials/search/algolia-search.swig new file mode 100644 index 00000000..a733bb17 --- /dev/null +++ b/doc/themes/next/layout/_partials/search/algolia-search.swig @@ -0,0 +1,20 @@ +{% if theme.algolia_search.enable %} + +{% endif %} diff --git a/doc/themes/next/layout/_partials/search/index.swig b/doc/themes/next/layout/_partials/search/index.swig new file mode 100644 index 00000000..b23ac3fd --- /dev/null +++ b/doc/themes/next/layout/_partials/search/index.swig @@ -0,0 +1,7 @@ +{% if theme.algolia_search.enable %} + {% include 'algolia-search.swig' %} +{% elif theme.swiftype_key %} + {% include 'swiftype.swig' %} +{% elif theme.local_search.enable %} + {% include 'localsearch.swig' %} +{% endif %} diff --git a/doc/themes/next/layout/_partials/search/localsearch.swig b/doc/themes/next/layout/_partials/search/localsearch.swig new file mode 100644 index 00000000..f106aa06 --- /dev/null +++ b/doc/themes/next/layout/_partials/search/localsearch.swig @@ -0,0 +1,16 @@ + diff --git a/doc/themes/next/layout/_partials/search/swiftype.swig b/doc/themes/next/layout/_partials/search/swiftype.swig new file mode 100644 index 00000000..6216e62c --- /dev/null +++ b/doc/themes/next/layout/_partials/search/swiftype.swig @@ -0,0 +1,12 @@ +
+ +
+ + diff --git a/doc/themes/next/layout/_partials/share/add-this.swig b/doc/themes/next/layout/_partials/share/add-this.swig new file mode 100644 index 00000000..1c7ad4c3 --- /dev/null +++ b/doc/themes/next/layout/_partials/share/add-this.swig @@ -0,0 +1,3 @@ +
+ +
diff --git a/doc/themes/next/layout/_partials/share/baidushare.swig b/doc/themes/next/layout/_partials/share/baidushare.swig new file mode 100644 index 00000000..d30f6a46 --- /dev/null +++ b/doc/themes/next/layout/_partials/share/baidushare.swig @@ -0,0 +1,57 @@ +{% if theme.baidushare.type === "button" %} +
+ + + + + + + + + + +
+ +{% elif theme.baidushare.type === "slide" %} + +{% endif %} + diff --git a/doc/themes/next/layout/_partials/share/likely.swig b/doc/themes/next/layout/_partials/share/likely.swig new file mode 100644 index 00000000..272fec34 --- /dev/null +++ b/doc/themes/next/layout/_partials/share/likely.swig @@ -0,0 +1,23 @@ +{% set likely_js_url = '//cdn.jsdelivr.net/npm/ilyabirman-likely@2/release/likely.js' %} +{% if theme.vendors.likely_js %} + {% set likely_js_url = theme.vendors.likely_js %} +{% endif %} + + +{% set likely_css_url = '//cdn.jsdelivr.net/npm/ilyabirman-likely@2/release/likely.css' %} +{% if theme.vendors.likely_css %} + {% set likely_css_url = theme.vendors.likely_css %} +{% endif %} + + +{% if theme.likely.look == 'normal' %} + {% set likely_look = 'likely' %} +{% else %} + {% set likely_look = 'likely likely-' + theme.likely.look %} +{% endif %} + +
+ {% for x in theme.likely.networks %} +
{{ x }}
+ {% endfor %} +
diff --git a/doc/themes/next/layout/_scripts/commons.swig b/doc/themes/next/layout/_scripts/commons.swig new file mode 100644 index 00000000..9797caf2 --- /dev/null +++ b/doc/themes/next/layout/_scripts/commons.swig @@ -0,0 +1,10 @@ +{% + set js_commons = [ + 'utils.js', + 'motion.js' + ] +%} + +{% for common in js_commons %} + +{% endfor %} diff --git a/doc/themes/next/layout/_scripts/exturl.swig b/doc/themes/next/layout/_scripts/exturl.swig new file mode 100644 index 00000000..832d4d9a --- /dev/null +++ b/doc/themes/next/layout/_scripts/exturl.swig @@ -0,0 +1,3 @@ +{% if theme.exturl %} + +{% endif %} diff --git a/doc/themes/next/layout/_scripts/next-boot.swig b/doc/themes/next/layout/_scripts/next-boot.swig new file mode 100644 index 00000000..49404bb7 --- /dev/null +++ b/doc/themes/next/layout/_scripts/next-boot.swig @@ -0,0 +1,9 @@ +{% + set boot_scripts = [ + 'next-boot.js' + ] +%} + +{% for bs in boot_scripts %} + +{% endfor %} diff --git a/doc/themes/next/layout/_scripts/noscript.swig b/doc/themes/next/layout/_scripts/noscript.swig new file mode 100644 index 00000000..b4d0941c --- /dev/null +++ b/doc/themes/next/layout/_scripts/noscript.swig @@ -0,0 +1,24 @@ + diff --git a/doc/themes/next/layout/_scripts/pages/post-details.swig b/doc/themes/next/layout/_scripts/pages/post-details.swig new file mode 100644 index 00000000..0ca7c20b --- /dev/null +++ b/doc/themes/next/layout/_scripts/pages/post-details.swig @@ -0,0 +1,2 @@ + + diff --git a/doc/themes/next/layout/_scripts/schemes/gemini.swig b/doc/themes/next/layout/_scripts/schemes/gemini.swig new file mode 100644 index 00000000..14a3f9fe --- /dev/null +++ b/doc/themes/next/layout/_scripts/schemes/gemini.swig @@ -0,0 +1 @@ +{% include 'pisces.swig' %} diff --git a/doc/themes/next/layout/_scripts/schemes/mist.swig b/doc/themes/next/layout/_scripts/schemes/mist.swig new file mode 100644 index 00000000..e18aaff2 --- /dev/null +++ b/doc/themes/next/layout/_scripts/schemes/mist.swig @@ -0,0 +1 @@ +{% include 'muse.swig' %} diff --git a/doc/themes/next/layout/_scripts/schemes/muse.swig b/doc/themes/next/layout/_scripts/schemes/muse.swig new file mode 100644 index 00000000..b19238bf --- /dev/null +++ b/doc/themes/next/layout/_scripts/schemes/muse.swig @@ -0,0 +1,9 @@ +{% + set scripts = [ + 'schemes/muse.js' + ] +%} + +{% for script in scripts %} + +{% endfor %} diff --git a/doc/themes/next/layout/_scripts/schemes/pisces.swig b/doc/themes/next/layout/_scripts/schemes/pisces.swig new file mode 100644 index 00000000..794965d0 --- /dev/null +++ b/doc/themes/next/layout/_scripts/schemes/pisces.swig @@ -0,0 +1,10 @@ +{% + set scripts = [ + 'affix.js', + 'schemes/pisces.js' + ] +%} + +{% for script in scripts %} + +{% endfor %} diff --git a/doc/themes/next/layout/_scripts/scroll-cookie.swig b/doc/themes/next/layout/_scripts/scroll-cookie.swig new file mode 100644 index 00000000..09c158b6 --- /dev/null +++ b/doc/themes/next/layout/_scripts/scroll-cookie.swig @@ -0,0 +1,4 @@ +{% if theme.save_scroll %} + + +{% endif %} diff --git a/doc/themes/next/layout/_scripts/vendors.swig b/doc/themes/next/layout/_scripts/vendors.swig new file mode 100644 index 00000000..5c827649 --- /dev/null +++ b/doc/themes/next/layout/_scripts/vendors.swig @@ -0,0 +1,72 @@ +{# Reset `window.Promise` when it was not a function. #} +{# IE refers the element whose id is `Promise` as `window.Promise`, this causes Velocity throwing an exception #} + + +{% set js_vendors = {} %} +{% set js_vendors.jquery = 'jquery/index.js?v=2.1.3' %} + +{% if theme.fastclick %} + {% set js_vendors.fastclick = 'fastclick/lib/fastclick.min.js?v=1.0.6' %} +{% endif %} + +{% if theme.lazyload %} + {% set js_vendors.lazyload = 'jquery_lazyload/jquery.lazyload.js?v=1.9.7' %} +{% endif %} + +{% set js_vendors.velocity = 'velocity/velocity.min.js?v=1.2.1' %} +{% set js_vendors.velocity_ui = 'velocity/velocity.ui.min.js?v=1.2.1' %} + +{% if theme.fancybox %} + {% set js_vendors.fancybox = 'fancybox/source/jquery.fancybox.pack.js' %} +{% endif %} + +{% if theme.canvas_nest.enable %} + {% if theme.canvas_nest.onmobile %} + {% set canvas_nest_uri = url_for(theme.vendors._internal + '/canvas-nest/canvas-nest.min.js') %} + {% if theme.vendors.canvas_nest %} + {% set canvas_nest_uri = theme.vendors.canvas_nest %} + {% endif %} + {% else %} + {% set canvas_nest_uri = url_for(theme.vendors._internal + '/canvas-nest/canvas-nest-nomobile.min.js') %} + {% if theme.vendors.canvas_nest_nomobile %} + {% set canvas_nest_uri = theme.vendors.canvas_nest_nomobile %} + {% endif %} + {% endif %} + +{% endif %} + +{% if theme.three_waves %} + {% set js_vendors.three = 'three/three.min.js' %} + {% set js_vendors.three_waves = 'three/three-waves.min.js' %} +{% endif %} + +{% if theme.canvas_lines %} + {% set js_vendors.three = 'three/three.min.js' %} + {% set js_vendors.canvas_lines = 'three/canvas_lines.min.js' %} +{% endif %} + +{% if theme.canvas_sphere %} + {% set js_vendors.three = 'three/three.min.js' %} + {% set js_vendors.canvas_sphere = 'three/canvas_sphere.min.js' %} +{% endif %} + +{% if theme.canvas_ribbon.enable %} + {% set canvas_ribbon_uri = url_for(theme.vendors._internal + '/canvas-ribbon/canvas-ribbon.js') %} + {% if theme.vendors.canvas_ribbon %} + {% set canvas_ribbon_uri = theme.vendors.canvas_ribbon %} + {% endif %} + +{% endif %} + +{% if theme.reading_progress.enable %} + {% set js_vendors.reading_progress = 'reading_progress/reading_progress.js' %} +{% endif %} + +{% for name, internal in js_vendors %} + {% set internal_script = url_for(theme.vendors._internal + '/' + internal) %} + +{% endfor %} diff --git a/doc/themes/next/layout/_third-party/analytics/analytics-with-widget.swig b/doc/themes/next/layout/_third-party/analytics/analytics-with-widget.swig new file mode 100644 index 00000000..4ad458d0 --- /dev/null +++ b/doc/themes/next/layout/_third-party/analytics/analytics-with-widget.swig @@ -0,0 +1,4 @@ +{% include 'busuanzi-counter.swig' %} +{% include 'tencent-mta.swig' %} +{% include 'tencent-analytics.swig' %} +{% include 'cnzz-analytics.swig' %} diff --git a/doc/themes/next/layout/_third-party/analytics/application-insights.swig b/doc/themes/next/layout/_third-party/analytics/application-insights.swig new file mode 100644 index 00000000..9844cbf4 --- /dev/null +++ b/doc/themes/next/layout/_third-party/analytics/application-insights.swig @@ -0,0 +1,11 @@ +{% if theme.application_insights %} + +{% endif %} diff --git a/doc/themes/next/layout/_third-party/analytics/baidu-analytics.swig b/doc/themes/next/layout/_third-party/analytics/baidu-analytics.swig new file mode 100644 index 00000000..11d13424 --- /dev/null +++ b/doc/themes/next/layout/_third-party/analytics/baidu-analytics.swig @@ -0,0 +1,11 @@ +{% if theme.baidu_analytics %} + +{% endif %} diff --git a/doc/themes/next/layout/_third-party/analytics/busuanzi-counter.swig b/doc/themes/next/layout/_third-party/analytics/busuanzi-counter.swig new file mode 100644 index 00000000..9015cb64 --- /dev/null +++ b/doc/themes/next/layout/_third-party/analytics/busuanzi-counter.swig @@ -0,0 +1,27 @@ +{% if theme.busuanzi_count.enable %} +
+ + + {% if theme.busuanzi_count.total_visitors %} + + + + + {% endif %} + + {% if theme.busuanzi_count.total_visitors and theme.busuanzi_count.total_views %} + + {% endif %} + + {% if theme.busuanzi_count.total_views %} + + + + + {% endif %} +
+{% endif %} diff --git a/doc/themes/next/layout/_third-party/analytics/cnzz-analytics.swig b/doc/themes/next/layout/_third-party/analytics/cnzz-analytics.swig new file mode 100644 index 00000000..9693cda2 --- /dev/null +++ b/doc/themes/next/layout/_third-party/analytics/cnzz-analytics.swig @@ -0,0 +1,5 @@ +{% if theme.cnzz_siteid %} +
+ +
+{% endif %} diff --git a/doc/themes/next/layout/_third-party/analytics/facebook-sdk.swig b/doc/themes/next/layout/_third-party/analytics/facebook-sdk.swig new file mode 100644 index 00000000..d7cd7ee2 --- /dev/null +++ b/doc/themes/next/layout/_third-party/analytics/facebook-sdk.swig @@ -0,0 +1,18 @@ +{% if theme.facebook_sdk.enable %} + +{% endif %} diff --git a/doc/themes/next/layout/_third-party/analytics/firestore.swig b/doc/themes/next/layout/_third-party/analytics/firestore.swig new file mode 100644 index 00000000..0cfe5467 --- /dev/null +++ b/doc/themes/next/layout/_third-party/analytics/firestore.swig @@ -0,0 +1,99 @@ +{% if theme.firestore.enable %} + + + {% if theme.firestore.bluebird %} + + {% endif %} + +{% endif %} diff --git a/doc/themes/next/layout/_third-party/analytics/google-analytics.swig b/doc/themes/next/layout/_third-party/analytics/google-analytics.swig new file mode 100644 index 00000000..d7b29b6c --- /dev/null +++ b/doc/themes/next/layout/_third-party/analytics/google-analytics.swig @@ -0,0 +1,12 @@ +{% if theme.google_analytics.tracking_id %} + + +{% endif %} diff --git a/doc/themes/next/layout/_third-party/analytics/growingio.swig b/doc/themes/next/layout/_third-party/analytics/growingio.swig new file mode 100644 index 00000000..fdbb00fe --- /dev/null +++ b/doc/themes/next/layout/_third-party/analytics/growingio.swig @@ -0,0 +1,7 @@ +{% if theme.growingio_analytics %} + +{% endif %} diff --git a/doc/themes/next/layout/_third-party/analytics/index.swig b/doc/themes/next/layout/_third-party/analytics/index.swig new file mode 100644 index 00000000..15eae678 --- /dev/null +++ b/doc/themes/next/layout/_third-party/analytics/index.swig @@ -0,0 +1,6 @@ +{% include 'facebook-sdk.swig' %} +{% include 'vkontakte-api.swig' %} +{% include 'google-analytics.swig' %} +{% include 'baidu-analytics.swig' %} +{% include 'application-insights.swig' %} +{% include 'growingio.swig' %} diff --git a/doc/themes/next/layout/_third-party/analytics/lean-analytics.swig b/doc/themes/next/layout/_third-party/analytics/lean-analytics.swig new file mode 100644 index 00000000..eb6bef3b --- /dev/null +++ b/doc/themes/next/layout/_third-party/analytics/lean-analytics.swig @@ -0,0 +1,116 @@ +{% if theme.leancloud_visitors.enable and !theme.valine.visitor %} + {# custom analytics part create by xiamo; edited by LEAFERx #} + + +{% endif %} diff --git a/doc/themes/next/layout/_third-party/analytics/tencent-analytics.swig b/doc/themes/next/layout/_third-party/analytics/tencent-analytics.swig new file mode 100644 index 00000000..adc1fc3f --- /dev/null +++ b/doc/themes/next/layout/_third-party/analytics/tencent-analytics.swig @@ -0,0 +1,10 @@ +{% if theme.tencent_analytics %} + +{% endif %} diff --git a/doc/themes/next/layout/_third-party/analytics/tencent-mta.swig b/doc/themes/next/layout/_third-party/analytics/tencent-mta.swig new file mode 100644 index 00000000..d9cae35f --- /dev/null +++ b/doc/themes/next/layout/_third-party/analytics/tencent-mta.swig @@ -0,0 +1,13 @@ +{% if theme.tencent_mta %} + +{% endif %} diff --git a/doc/themes/next/layout/_third-party/analytics/vkontakte-api.swig b/doc/themes/next/layout/_third-party/analytics/vkontakte-api.swig new file mode 100644 index 00000000..4ed0c624 --- /dev/null +++ b/doc/themes/next/layout/_third-party/analytics/vkontakte-api.swig @@ -0,0 +1,25 @@ +{% if theme.vkontakte_api.enable %} +
+ +{% endif %} diff --git a/doc/themes/next/layout/_third-party/baidu-push.swig b/doc/themes/next/layout/_third-party/baidu-push.swig new file mode 100644 index 00000000..758c4392 --- /dev/null +++ b/doc/themes/next/layout/_third-party/baidu-push.swig @@ -0,0 +1,11 @@ +{% if theme.baidu_push %} + +{% endif %} diff --git a/doc/themes/next/layout/_third-party/bookmark.swig b/doc/themes/next/layout/_third-party/bookmark.swig new file mode 100644 index 00000000..6933ab3c --- /dev/null +++ b/doc/themes/next/layout/_third-party/bookmark.swig @@ -0,0 +1,14 @@ +{% if theme.bookmark and theme.bookmark.enable %} + {% set bookmark_uri = url_for(theme.vendors._internal + '/bookmark/bookmark.min.js?v=1.0') %} + {% if theme.vendors.bookmark %} + {% set bookmark_uri = theme.vendors.bookmark %} + {% endif %} + + +{% endif %} diff --git a/doc/themes/next/layout/_third-party/chatra.swig b/doc/themes/next/layout/_third-party/chatra.swig new file mode 100644 index 00000000..fcc1ced1 --- /dev/null +++ b/doc/themes/next/layout/_third-party/chatra.swig @@ -0,0 +1,22 @@ +{% if theme.chatra.enable %} + {% if theme.chatra.embed %} + + {% endif %} + +{% endif %} diff --git a/doc/themes/next/layout/_third-party/comments/changyan.swig b/doc/themes/next/layout/_third-party/comments/changyan.swig new file mode 100644 index 00000000..cf8fd2c2 --- /dev/null +++ b/doc/themes/next/layout/_third-party/comments/changyan.swig @@ -0,0 +1,18 @@ +{% if is_home() %} + +{% elif page.comments %} + + +{% endif %} diff --git a/doc/themes/next/layout/_third-party/comments/disqus.swig b/doc/themes/next/layout/_third-party/comments/disqus.swig new file mode 100644 index 00000000..8491d686 --- /dev/null +++ b/doc/themes/next/layout/_third-party/comments/disqus.swig @@ -0,0 +1,44 @@ +{% if theme.disqus.count %} + +{% endif %} +{% if page.comments %} + +{% endif %} diff --git a/doc/themes/next/layout/_third-party/comments/disqusjs.swig b/doc/themes/next/layout/_third-party/comments/disqusjs.swig new file mode 100644 index 00000000..bae5b277 --- /dev/null +++ b/doc/themes/next/layout/_third-party/comments/disqusjs.swig @@ -0,0 +1,19 @@ +{% set disqusjs_css_url = '//cdn.jsdelivr.net/npm/disqusjs@1/dist/disqusjs.css' %} +{% if theme.vendors.disqusjs_css %} + {% set disqusjs_css_url = theme.vendors.disqusjs_css %} +{% endif %} + + +{% set disqusjs_js_url = '//cdn.jsdelivr.net/npm/disqusjs@1/dist/disqus.js' %} +{% if theme.vendors.disqusjs_js %} + {% set disqusjs_js_url = theme.vendors.disqusjs_js %} +{% endif %} + + + diff --git a/doc/themes/next/layout/_third-party/comments/gitalk.swig b/doc/themes/next/layout/_third-party/comments/gitalk.swig new file mode 100644 index 00000000..749ec59e --- /dev/null +++ b/doc/themes/next/layout/_third-party/comments/gitalk.swig @@ -0,0 +1,35 @@ +{% set gitalk_js_url = '//cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.js' %} +{% if theme.vendors.gitalk_js %} + {% set gitalk_js_url = theme.vendors.gitalk_js %} +{% endif %} + + +{% set gitalk_css_url = '//cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.css' %} +{% if theme.vendors.gitalk_css %} + {% set gitalk_css_url = theme.vendors.gitalk_css %} +{% endif %} + + +{% set md5_url = '//cdn.jsdelivr.net/npm/js-md5@0.7.3/src/md5.min.js' %} +{% if theme.vendors.md5 %} + {% set md5_url = theme.vendors.md5 %} +{% endif %} + + + diff --git a/doc/themes/next/layout/_third-party/comments/gitment.swig b/doc/themes/next/layout/_third-party/comments/gitment.swig new file mode 100644 index 00000000..d4f5ae06 --- /dev/null +++ b/doc/themes/next/layout/_third-party/comments/gitment.swig @@ -0,0 +1,45 @@ + +{% if theme.gitment.mint %} + {% set CommentsClass = 'Gitmint' %} + +{% else %} + {% set CommentsClass = 'Gitment' %} + +{% endif %} + + + + diff --git a/doc/themes/next/layout/_third-party/comments/index.swig b/doc/themes/next/layout/_third-party/comments/index.swig new file mode 100644 index 00000000..51fd0e08 --- /dev/null +++ b/doc/themes/next/layout/_third-party/comments/index.swig @@ -0,0 +1,19 @@ +{% if theme.disqus.enable %} + {% include 'disqus.swig' %} +{% elif theme.changyan.enable and theme.changyan.appid and theme.changyan.appkey %} + {% include 'changyan.swig' %} +{% elif theme.valine.enable and theme.valine.appid and theme.valine.appkey %} + {% include 'valine.swig' %} +{% endif %} + +{% if page.comments %} + {% if theme.livere_uid %} + {% include 'livere.swig' %} + {% elif theme.gitment.enable and theme.gitment.client_id %} + {% include 'gitment.swig' %} + {% elif theme.gitalk.enable %} + {% include 'gitalk.swig' %} + {% elif theme.disqusjs.enable and theme.disqusjs.apikey and theme.disqusjs.shortname %} + {% include 'disqusjs.swig' %} + {% endif %} +{% endif %} diff --git a/doc/themes/next/layout/_third-party/comments/livere.swig b/doc/themes/next/layout/_third-party/comments/livere.swig new file mode 100644 index 00000000..b14f5ed8 --- /dev/null +++ b/doc/themes/next/layout/_third-party/comments/livere.swig @@ -0,0 +1,13 @@ + diff --git a/doc/themes/next/layout/_third-party/comments/valine.swig b/doc/themes/next/layout/_third-party/comments/valine.swig new file mode 100644 index 00000000..7bfd1051 --- /dev/null +++ b/doc/themes/next/layout/_third-party/comments/valine.swig @@ -0,0 +1,32 @@ +{% set leancloud_uri = '//cdn1.lncld.net/static/js/3.11.1/av-min.js' %} +{% if theme.vendors.leancloud %} + {% set leancloud_uri = theme.vendors.leancloud %} +{% endif %} + + +{% set valine_uri = '//unpkg.com/valine/dist/Valine.min.js' %} +{% if theme.vendors.valine %} + {% set valine_uri = theme.vendors.valine %} +{% endif %} + + + diff --git a/doc/themes/next/layout/_third-party/copy-code.swig b/doc/themes/next/layout/_third-party/copy-code.swig new file mode 100644 index 00000000..8abb8f53 --- /dev/null +++ b/doc/themes/next/layout/_third-party/copy-code.swig @@ -0,0 +1,36 @@ +{% if theme.codeblock.copy_button.enable %} + +{% endif %} diff --git a/doc/themes/next/layout/_third-party/math/index.swig b/doc/themes/next/layout/_third-party/math/index.swig new file mode 100644 index 00000000..12eab894 --- /dev/null +++ b/doc/themes/next/layout/_third-party/math/index.swig @@ -0,0 +1,20 @@ +{% if theme.math.enable %} + {% set is_index_has_math = false %} + + {# At home, check if there has `mathjax: true` post #} + {% if is_home() %} + {% for post in page.posts %} + {% if post.mathjax and not is_index_has_math %} + {% set is_index_has_math = true %} + {% endif %} + {% endfor %} + {% endif %} + + {% if not theme.math.per_page or (is_index_has_math or page.mathjax) %} + {% if theme.math.engine == 'mathjax' %} + {% include 'mathjax.swig' %} + {% elif theme.math.engine == 'katex' %} + {% include 'katex.swig' %} + {% endif %} + {% endif %} +{% endif %} diff --git a/doc/themes/next/layout/_third-party/math/katex.swig b/doc/themes/next/layout/_third-party/math/katex.swig new file mode 100644 index 00000000..ea7ad162 --- /dev/null +++ b/doc/themes/next/layout/_third-party/math/katex.swig @@ -0,0 +1,9 @@ + +{% if theme.math.katex.copy_tex.enable %} + {% if theme.math.katex.copy_tex.copy_tex_js %} + + {% endif %} + {% if theme.math.katex.copy_tex.copy_tex_css %} + + {% endif %} +{% endif %} diff --git a/doc/themes/next/layout/_third-party/math/mathjax.swig b/doc/themes/next/layout/_third-party/math/mathjax.swig new file mode 100644 index 00000000..f695c1a5 --- /dev/null +++ b/doc/themes/next/layout/_third-party/math/mathjax.swig @@ -0,0 +1,40 @@ + + + + diff --git a/doc/themes/next/layout/_third-party/mermaid.swig b/doc/themes/next/layout/_third-party/mermaid.swig new file mode 100644 index 00000000..a7859a6d --- /dev/null +++ b/doc/themes/next/layout/_third-party/mermaid.swig @@ -0,0 +1,21 @@ +{% if theme.mermaid.enable %} + +{% endif %} diff --git a/doc/themes/next/layout/_third-party/needsharebutton.swig b/doc/themes/next/layout/_third-party/needsharebutton.swig new file mode 100644 index 00000000..8155e1df --- /dev/null +++ b/doc/themes/next/layout/_third-party/needsharebutton.swig @@ -0,0 +1,23 @@ +{% if theme.needmoreshare2.enable %} + {% set needmoreshare2_js = url_for(theme.vendors._internal + '/needsharebutton/needsharebutton.js') %} + {% if theme.vendors.needmoreshare2_js %} + {% set needmoreshare2_js = theme.vendors.needmoreshare2_js %} + {% endif %} + + +{% endif %} diff --git a/doc/themes/next/layout/_third-party/pangu.swig b/doc/themes/next/layout/_third-party/pangu.swig new file mode 100644 index 00000000..c82d5068 --- /dev/null +++ b/doc/themes/next/layout/_third-party/pangu.swig @@ -0,0 +1,8 @@ +{% if theme.pangu %} + {% set pangu_uri = url_for(theme.vendors._internal + '/pangu/dist/pangu.min.js?v=3.3') %} + {% if theme.vendors.pangu %} + {% set pangu_uri = theme.vendors.pangu %} + {% endif %} + + +{% endif %} diff --git a/doc/themes/next/layout/_third-party/pdf.swig b/doc/themes/next/layout/_third-party/pdf.swig new file mode 100644 index 00000000..4b65f3e0 --- /dev/null +++ b/doc/themes/next/layout/_third-party/pdf.swig @@ -0,0 +1,27 @@ +{% if theme.pdf.enable %} + +{% endif %} diff --git a/doc/themes/next/layout/_third-party/quicklink.swig b/doc/themes/next/layout/_third-party/quicklink.swig new file mode 100644 index 00000000..d2570faa --- /dev/null +++ b/doc/themes/next/layout/_third-party/quicklink.swig @@ -0,0 +1,35 @@ +{% if theme.quicklink.enable %} + {% set quicklink_uri = url_for(theme.vendors._internal + '/quicklink/dist/quicklink.umd.js') %} + {% if theme.vendors.quicklink %} + {% set quicklink_uri = theme.vendors.quicklink %} + {% endif %} + + {% if is_home() %} + {% if theme.quicklink.home %} + {% set loadQL = true %} + {% endif %} + {% endif %} + + {% if is_archive() %} + {% if theme.quicklink.archive %} + {% set loadQL = true %} + {% endif %} + {% endif %} + + {% if loadQL or (page.quicklink or post.quicklink) %} + + + {% endif %} +{% endif %} diff --git a/doc/themes/next/layout/_third-party/rating.swig b/doc/themes/next/layout/_third-party/rating.swig new file mode 100644 index 00000000..e51e0945 --- /dev/null +++ b/doc/themes/next/layout/_third-party/rating.swig @@ -0,0 +1,20 @@ +{% if theme.rating.enable and (not is_home() and is_post()) %} + +{% endif %} diff --git a/doc/themes/next/layout/_third-party/schedule.swig b/doc/themes/next/layout/_third-party/schedule.swig new file mode 100644 index 00000000..2c1577be --- /dev/null +++ b/doc/themes/next/layout/_third-party/schedule.swig @@ -0,0 +1,171 @@ +{% if theme.calendar.enable && page.type === 'schedule' %} + + + +{% endif %} diff --git a/doc/themes/next/layout/_third-party/search/algolia-search.swig b/doc/themes/next/layout/_third-party/search/algolia-search.swig new file mode 100644 index 00000000..30a73e71 --- /dev/null +++ b/doc/themes/next/layout/_third-party/search/algolia-search.swig @@ -0,0 +1,18 @@ +{% if theme.algolia_search.enable %} + + {# S: Include Algolia instantsearch.js library #} + {% set algolia_instant_css = url_for(theme.vendors._internal + '/algolia-instant-search/instantsearch.min.css') %} + {% if theme.vendors.algolia_instant_css %} + {% set algolia_instant_css = theme.vendors.algolia_instant_css %} + {% endif %} + + + {% set algolia_instant_js = url_for(theme.vendors._internal + '/algolia-instant-search/instantsearch.min.js') %} + {% if theme.vendors.algolia_instant_js %} + {% set algolia_instant_js = theme.vendors.algolia_instant_js %} + {% endif %} + + {# E: Include Algolia instantsearch.js library #} + + +{% endif %} diff --git a/doc/themes/next/layout/_third-party/search/index.swig b/doc/themes/next/layout/_third-party/search/index.swig new file mode 100644 index 00000000..b6c49456 --- /dev/null +++ b/doc/themes/next/layout/_third-party/search/index.swig @@ -0,0 +1,2 @@ +{% include 'localsearch.swig' %} +{% include 'algolia-search.swig' %} diff --git a/doc/themes/next/layout/_third-party/search/localsearch.swig b/doc/themes/next/layout/_third-party/search/localsearch.swig new file mode 100644 index 00000000..37dc85f2 --- /dev/null +++ b/doc/themes/next/layout/_third-party/search/localsearch.swig @@ -0,0 +1,336 @@ +{% if theme.local_search.enable %} + +{% endif %} diff --git a/doc/themes/next/layout/_third-party/tidio.swig b/doc/themes/next/layout/_third-party/tidio.swig new file mode 100644 index 00000000..d380d210 --- /dev/null +++ b/doc/themes/next/layout/_third-party/tidio.swig @@ -0,0 +1,3 @@ +{% if theme.tidio.enable %} + +{% endif %} diff --git a/doc/themes/next/layout/archive.swig b/doc/themes/next/layout/archive.swig new file mode 100644 index 00000000..e4c2a68f --- /dev/null +++ b/doc/themes/next/layout/archive.swig @@ -0,0 +1,64 @@ +{% extends '_layout.swig' %} +{% import '_macro/post-collapse.swig' as post_template %} +{% import '_macro/sidebar.swig' as sidebar_template %} + +{% block title %}{{ __('title.archive') }} | {{ title }}{% endblock %} + +{% block page_class %}page-archive{% endblock %} + +{% block content %} + + {#####################} + {### ARCHIVE BLOCK ###} + {#####################} +
+
+ + + {% if theme.cheers %} + + {% set cheers %} + {% set posts_length = site.posts.length %} + {% if posts_length > 210 %} {% set cheers = 'excellent' %} + {% elif posts_length > 130 %} {% set cheers = 'great' %} + {% elif posts_length > 80 %} {% set cheers = 'good' %} + {% elif posts_length > 50 %} {% set cheers = 'nice' %} + {% elif posts_length > 30 %} {% set cheers = 'ok' %} + {% else %} + {% set cheers = 'um' %} + {% endif %} + {{ __('cheers.' + cheers) }}! {{ _p("counter.archive_posts", site.posts.length) }} {{ __('keep_on') }} + + {% endif %} + + {% for post in page.posts %} + + {# Show year #} + {% set year %} + {% set post.year = date(post.date, 'YYYY') %} + + {% if post.year !== year %} + {% set year = post.year %} +
+ <{% if theme.seo %}h2{% else %}h1{% endif %} class="archive-year" id="archive-year-{{ year }}">{{ year }} +
+ {% endif %} + {# endshow #} + + {{ post_template.render(post) }} + + {% endfor %} + +
+
+ {#########################} + {### END ARCHIVE BLOCK ###} + {#########################} + + {% include '_partials/pagination.swig' %} + +{% endblock %} + +{% block sidebar %} + {{ sidebar_template.render(false) }} +{% endblock %} diff --git a/doc/themes/next/layout/category.swig b/doc/themes/next/layout/category.swig new file mode 100644 index 00000000..f85dbf50 --- /dev/null +++ b/doc/themes/next/layout/category.swig @@ -0,0 +1,38 @@ +{% extends '_layout.swig' %} +{% import '_macro/post-collapse.swig' as post_template %} +{% import '_macro/sidebar.swig' as sidebar_template %} + +{% block title %}{{ __('title.category') }}: {{ page.category }} | {{ title }}{% endblock %} + +{% block content %} + + {######################} + {### CATEGORY BLOCK ###} + {######################} +
+ +
+
+ <{% if theme.seo %}h2{% else %}h1{% endif %}>{# + #}{{ page.category }}{# + #}{{ __('title.category') }} + +
+ + {% for post in page.posts %} + {{ post_template.render(post) }} + {% endfor %} +
+ +
+ {##########################} + {### END CATEGORY BLOCK ###} + {##########################} + + {% include '_partials/pagination.swig' %} + +{% endblock %} + +{% block sidebar %} + {{ sidebar_template.render(false) }} +{% endblock %} diff --git a/doc/themes/next/layout/index.swig b/doc/themes/next/layout/index.swig new file mode 100644 index 00000000..9fd359f0 --- /dev/null +++ b/doc/themes/next/layout/index.swig @@ -0,0 +1,23 @@ +{% extends '_layout.swig' %} +{% import '_macro/post.swig' as post_template %} +{% import '_macro/sidebar.swig' as sidebar_template %} + +{% block title %}{{ title }}{% if theme.index_with_subtitle and subtitle %} – {{ subtitle }}{% endif %}{% endblock %} + +{% block page_class %} + {% if is_home() %}page-home{% endif -%} +{% endblock %} + +{% block content %} +
+ {% for post in page.posts %} + {{ post_template.render(post, true) }} + {% endfor %} +
+ + {% include '_partials/pagination.swig' %} +{% endblock %} + +{% block sidebar %} + {{ sidebar_template.render(false) }} +{% endblock %} diff --git a/doc/themes/next/layout/page.swig b/doc/themes/next/layout/page.swig new file mode 100644 index 00000000..c64f73c1 --- /dev/null +++ b/doc/themes/next/layout/page.swig @@ -0,0 +1,91 @@ +{% extends '_layout.swig' %} +{% import '_macro/sidebar.swig' as sidebar_template %} + + {% block title %}{# + #}{% set page_title_suffix = ' | ' + title %}{# + + #}{% if page.type === 'categories' and not page.title %}{# + #}{{ __('title.category') + page_title_suffix }}{# + #}{% elif page.type === 'tags' and not page.title %}{# + #}{{ __('title.tag') + page_title_suffix }}{# + #}{% elif page.type === 'schedule' and not page.title %}{# + #}{{ __('title.schedule') + page_title_suffix }}{# + #}{% else %}{# + #}{{ page.title + page_title_suffix }}{# + #}{% endif %}{# +#}{% endblock %} + +{% block page_class %}page-post-detail{% endblock %} + +{% block content %} + +
+ {##################} + {### PAGE BLOCK ###} + {##################} +
+ {% include '_partials/page/page-header.swig' %} + {#################} + {### PAGE BODY ###} + {#################} +
+ {# tagcloud page support #} + {% if page.type === 'tags' %} +
+
+ {% set visibleTags = 0 %} + {% for tag in site.tags %} + {% if tag.length %} + {% set visibleTags += 1 %} + {% endif %} + {% endfor %} + {{ _p('counter.tag_cloud', visibleTags) }} +
+
+ {% if not theme.tagcloud %} + {{ tagcloud({min_font: 12, max_font: 30, amount: 200, color: true, start_color: '#ccc', end_color: '#111'}) }} + {% else %} + {{ tagcloud({min_font: theme.tagcloud.min, max_font: theme.tagcloud.max, amount: theme.tagcloud.amount, color: true, start_color: theme.tagcloud.start, end_color: theme.tagcloud.end}) }} + {% endif %} +
+
+ {% elif page.type === 'categories' %} +
+
+ {% set visibleCategories = 0 %} + {% for cat in site.categories %} + {% if cat.length %} + {% set visibleCategories += 1 %} + {% endif %} + {% endfor %} + {{ _p('counter.categories', visibleCategories) }} +
+
+ {{ list_categories() }} +
+
+ {% elif page.type === 'schedule' %} + {% include 'schedule.swig' %} + {% else %} + {{ page.content }} + {% endif %} +
+ {#####################} + {### END PAGE BODY ###} + {#####################} +
+ {% include '_partials/page/breadcrumb.swig' %} + {######################} + {### END PAGE BLOCK ###} + {######################} +
+ +{% endblock %} + +{% block sidebar %} + {{ sidebar_template.render(false) }} +{% endblock %} + +{% block script_extra %} + {% include '_scripts/pages/post-details.swig' %} +{% endblock %} diff --git a/doc/themes/next/layout/post.swig b/doc/themes/next/layout/post.swig new file mode 100644 index 00000000..a4b825f7 --- /dev/null +++ b/doc/themes/next/layout/post.swig @@ -0,0 +1,23 @@ +{% extends '_layout.swig' %} +{% import '_macro/post.swig' as post_template %} +{% import '_macro/sidebar.swig' as sidebar_template %} + +{% block title %}{{ page.title }} | {{ title }}{% endblock %} + +{% block page_class %}page-post-detail{% endblock %} + +{% block content %} + +
+ {{ post_template.render(page) }} +
+ +{% endblock %} + +{% block sidebar %} + {{ sidebar_template.render(true) }} +{% endblock %} + +{% block script_extra %} + {% include '_scripts/pages/post-details.swig' %} +{% endblock %} diff --git a/doc/themes/next/layout/schedule.swig b/doc/themes/next/layout/schedule.swig new file mode 100644 index 00000000..9e7b7474 --- /dev/null +++ b/doc/themes/next/layout/schedule.swig @@ -0,0 +1,14 @@ +{% block content %} + {######################} + {### SCHEDULE BLOCK ###} + {######################} +
+
+
    +
+
+
+ {##########################} + {### END SCHEDULE BLOCK ###} + {##########################} +{% endblock %} diff --git a/doc/themes/next/layout/tag.swig b/doc/themes/next/layout/tag.swig new file mode 100644 index 00000000..8a7e75b5 --- /dev/null +++ b/doc/themes/next/layout/tag.swig @@ -0,0 +1,38 @@ +{% extends '_layout.swig' %} +{% import '_macro/post-collapse.swig' as post_template %} +{% import '_macro/sidebar.swig' as sidebar_template %} + +{% block title %}{{ __('title.tag') }}: {{ page.tag }} | {{ title }}{% endblock %} + +{% block content %} + + {#################} + {### TAG BLOCK ###} + {#################} +
+ +
+
+ <{% if theme.seo %}h2{% else %}h1{% endif %}>{# + #}{{ page.tag }}{# + #}{{ __('title.tag') }} + +
+ + {% for post in page.posts %} + {{ post_template.render(post) }} + {% endfor %} +
+ +
+ {#####################} + {### END TAG BLOCK ###} + {#####################} + + {% include '_partials/pagination.swig' %} + +{% endblock %} + +{% block sidebar %} + {{ sidebar_template.render(false) }} +{% endblock %} diff --git a/doc/themes/next/package.json b/doc/themes/next/package.json new file mode 100644 index 00000000..bb67aa00 --- /dev/null +++ b/doc/themes/next/package.json @@ -0,0 +1,39 @@ +{ + "name": "hexo-theme-next", + "version": "7.1.0", + "description": "Elegant and powerful theme for Hexo", + "main": "index.js", + "directories": { + "test": "test" + }, + "scripts": { + "test": "gulp", + "contributors:add": "all-contributors add", + "contributors:generate": "all-contributors generate" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/theme-next/hexo-theme-next.git" + }, + "keywords": [ + "hexo", + "theme", + "next" + ], + "author": "NexT (https://theme-next.org)", + "license": "AGPL", + "bugs": { + "url": "https://github.com/theme-next/hexo-theme-next/issues" + }, + "homepage": "https://theme-next.org", + "devDependencies": { + "all-contributors-cli": "^5.4.0", + "coffee-script": "^1.10.0", + "gulp": "^3.9.0", + "gulp-jshint": "^1.12.0", + "gulp-shell": "^0.6.1", + "js-yaml": "^3.8.1", + "jshint-stylish": "^2.1.0", + "stylint": "^1.5.9" + } +} diff --git a/doc/themes/next/scripts/filters/exturl.js b/doc/themes/next/scripts/filters/exturl.js new file mode 100644 index 00000000..c9eaae97 --- /dev/null +++ b/doc/themes/next/scripts/filters/exturl.js @@ -0,0 +1,45 @@ +/* global hexo */ + +'use strict'; + +hexo.extend.filter.register('after_post_render', function(data) { + var theme = hexo.theme.config; + // Exit if `exturl` option disable in NexT. + if (!theme.exturl) return; + + var url = require('url'); + var cheerio; + + var config = this.config; + + if (!cheerio) cheerio = require('cheerio'); + + var $ = cheerio.load(data.content, {decodeEntities: false}); + var siteHost = url.parse(config.url).hostname || config.url; + + $('a').each(function() { + var href = $(this).attr('href'); + // Exit if the href attribute doesn't exists. + if (!href) return; + + var data = url.parse(href); + + // Exit if the link doesn't have protocol, which means it's an internal link. + if (!data.protocol) return; + + // Exit if the url has same host with `config.url`. + if (data.hostname === siteHost) return; + + // If title atribute filled, set it as title; if not, set url as title. + var title = $(this).attr('title') || href; + + var encoded = Buffer.from(href).toString('base64'); + + $(this).replaceWith(function() { + return $(`${$(this).html()}`); + }); + + }); + + data.content = $.html(); +}, 0); diff --git a/doc/themes/next/scripts/helpers/engine.js b/doc/themes/next/scripts/helpers/engine.js new file mode 100644 index 00000000..c61dae86 --- /dev/null +++ b/doc/themes/next/scripts/helpers/engine.js @@ -0,0 +1,26 @@ +/* global hexo */ + +'use strict'; + +hexo.extend.helper.register('hexo_env', function(type) { + return this.env[type]; +}); + +hexo.extend.helper.register('next_env', function(type) { + var path = require('path'); + var env = require(path.normalize('../../package.json')); + return env[type]; +}); + +hexo.extend.helper.register('item_active', function(path, className) { + var canonical = this.page.canonical_path; + var current = this.url_for(canonical).replace('index.html', '', 'g'); + var result = ''; + + if (current.indexOf(path) !== -1) { + if (path !== '/' || path === current) { + result = ' ' + className; + } + } + return result; +}); diff --git a/doc/themes/next/scripts/helpers/next-url.js b/doc/themes/next/scripts/helpers/next-url.js new file mode 100644 index 00000000..700732e0 --- /dev/null +++ b/doc/themes/next/scripts/helpers/next-url.js @@ -0,0 +1,70 @@ +/** + * next-url.js | https://theme-next.org/api/helpers/next-url/ + */ + +/* global hexo */ + +'use strict'; + +hexo.extend.helper.register('next_url', function(path, text, options) { + var htmlTag = require('hexo-util').htmlTag; + var config = this.config; + var url = require('url'); + var data = url.parse(path); + var siteHost = url.parse(config.url).hostname || config.url; + + var theme = hexo.theme.config; + var exturl = ''; + var tag = 'a'; + var attrs = { href: this.url_for(path) }; + + // If `exturl` enabled, set spanned links only on external links. + if (theme.exturl && data.protocol && data.hostname !== siteHost) { + tag = 'span'; + exturl = 'exturl'; + var encoded = Buffer.from(path).toString('base64'); + attrs = { + class : exturl, + 'data-url': encoded + }; + } + + options = options || {}; + + var keys = Object.keys(options); + var key = ''; + + for (var i = 0, len = keys.length; i < len; i++) { + key = keys[i]; + + /** + * If option have `class` attribute, add it to + * 'exturl' class if `exturl` option enabled. + */ + if (exturl !== '' && key === 'class') { + attrs[key] += ' ' + options[key]; + } else { + attrs[key] = options[key]; + } + } + + if (attrs.class && Array.isArray(attrs.class)) { + attrs.class = attrs.class.join(' '); + } + + // If it's external link, rewrite attributes. + if (data.protocol && data.hostname !== siteHost) { + attrs.external = null; + + if (!theme.exturl) { + // Only for simple link need to rewrite/add attributes. + attrs.rel = 'noopener'; + attrs.target = '_blank'; + } else { + // Remove rel attributes for `exturl` in main menu. + attrs.rel = null; + } + } + + return htmlTag(tag, attrs, text); +}); diff --git a/doc/themes/next/scripts/merge-configs.js b/doc/themes/next/scripts/merge-configs.js new file mode 100644 index 00000000..2c36f24c --- /dev/null +++ b/doc/themes/next/scripts/merge-configs.js @@ -0,0 +1,45 @@ +/* global hexo */ + +'use strict'; + +var merge = require('./merge'); + +hexo.on('generateBefore', function() { + if (hexo.locals.get) { + var data = hexo.locals.get('data'); + + /** + * Merge configs from _data/next.yml into hexo.theme.config. + * If `override`, configs in next.yml will rewrite configs in hexo.theme.config. + * If next.yml not exists, merge all `theme_config.*` into hexo.theme.config. + */ + if (data && data.next) { + if (data.next.override) { + hexo.theme.config = data.next; + } else { + merge(hexo.config, data.next); + merge(hexo.theme.config, data.next); + } + } else { + merge(hexo.theme.config, hexo.config.theme_config); + } + + // Custom languages support. Introduced in NexT v6.3.0. + if (data && data.languages) { + var lang = this.config.language; + var i18n = this.theme.i18n; + + var mergeLang = function(lang) { + i18n.set(lang, merge(i18n.get([lang]), data.languages[lang])); + }; + + if (Array.isArray(lang)) { + for (var i = 0; i < lang.length; i++) { + mergeLang(lang[i]); + } + } else { + mergeLang(lang); + } + } + } +}); diff --git a/doc/themes/next/scripts/merge.js b/doc/themes/next/scripts/merge.js new file mode 100644 index 00000000..f964663d --- /dev/null +++ b/doc/themes/next/scripts/merge.js @@ -0,0 +1,2225 @@ +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + weakMapTag = '[object WeakMap]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + +/** Used to match `RegExp` flags from their coerced string values. */ +var reFlags = /\w*$/; + +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; + +/** Used to identify `toStringTag` values of typed arrays. */ +var typedArrayTags = {}; +typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = + typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = + typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = + typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = + typedArrayTags[uint32Tag] = true; +typedArrayTags[argsTag] = typedArrayTags[arrayTag] = + typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = + typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = + typedArrayTags[errorTag] = typedArrayTags[funcTag] = + typedArrayTags[mapTag] = typedArrayTags[numberTag] = + typedArrayTags[objectTag] = typedArrayTags[regexpTag] = + typedArrayTags[setTag] = typedArrayTags[stringTag] = + typedArrayTags[weakMapTag] = false; + +/** Used to identify `toStringTag` values supported by `_.clone`. */ +var cloneableTags = {}; +cloneableTags[argsTag] = cloneableTags[arrayTag] = + cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = + cloneableTags[boolTag] = cloneableTags[dateTag] = + cloneableTags[float32Tag] = cloneableTags[float64Tag] = + cloneableTags[int8Tag] = cloneableTags[int16Tag] = + cloneableTags[int32Tag] = cloneableTags[mapTag] = + cloneableTags[numberTag] = cloneableTags[objectTag] = + cloneableTags[regexpTag] = cloneableTags[setTag] = + cloneableTags[stringTag] = cloneableTags[symbolTag] = + cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = + cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; +cloneableTags[errorTag] = cloneableTags[funcTag] = + cloneableTags[weakMapTag] = false; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +/** Detect free variable `exports`. */ +var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** Detect free variable `process` from Node.js. */ +var freeProcess = moduleExports && freeGlobal.process; + +/** Used to access faster Node.js helpers. */ +var nodeUtil = (function () { + try { + return freeProcess && freeProcess.binding('util'); + } catch (e) { + } +}()); + +/* Node.js helper references. */ +var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + +/** + * Adds the key-value `pair` to `map`. + * + * @private + * @param {Object} map The map to modify. + * @param {Array} pair The key-value pair to add. + * @returns {Object} Returns `map`. + */ +function addMapEntry(map, pair) { + // Don't return `map.set` because it's not chainable in IE 11. + map.set(pair[0], pair[1]); + return map; +} + +/** + * Adds `value` to `set`. + * + * @private + * @param {Object} set The set to modify. + * @param {*} value The value to add. + * @returns {Object} Returns `set`. + */ +function addSetEntry(set, value) { + // Don't return `set.add` because it's not chainable in IE 11. + set.add(value); + return set; +} + +/** + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. + * + * @private + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. + */ +function apply(func, thisArg, args) { + switch (args.length) { + case 0: + return func.call(thisArg); + case 1: + return func.call(thisArg, args[0]); + case 2: + return func.call(thisArg, args[0], args[1]); + case 3: + return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); +} + +/** + * A specialized version of `_.forEach` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ +function arrayEach(array, iteratee) { + var index = -1, + length = array ? array.length : 0; + + while (++index < length) { + if (iteratee(array[index], index, array) === false) { + break; + } + } + return array; +} + +/** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ +function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; +} + +/** + * A specialized version of `_.reduce` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the first element of `array` as + * the initial value. + * @returns {*} Returns the accumulated value. + */ +function arrayReduce(array, iteratee, accumulator, initAccum) { + var index = -1, + length = array ? array.length : 0; + + if (initAccum && length) { + accumulator = array[++index]; + } + while (++index < length) { + accumulator = iteratee(accumulator, array[index], index, array); + } + return accumulator; +} + +/** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ +function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; +} + +/** + * The base implementation of `_.unary` without support for storing metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + */ +function baseUnary(func) { + return function (value) { + return func(value); + }; +} + +/** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function getValue(object, key) { + return object == null ? undefined : object[key]; +} + +/** + * Checks if `value` is a host object in IE < 9. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a host object, else `false`. + */ +function isHostObject(value) { + // Many host objects are `Object` objects that can coerce to strings + // despite having improperly defined `toString` methods. + var result = false; + if (value != null && typeof value.toString != 'function') { + try { + result = !!(value + ''); + } catch (e) { + } + } + return result; +} + +/** + * Converts `map` to its key-value pairs. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. + */ +function mapToArray(map) { + var index = -1, + result = Array(map.size); + + map.forEach(function (value, key) { + result[++index] = [key, value]; + }); + return result; +} + +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function (arg) { + return func(transform(arg)); + }; +} + +/** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ +function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function (value) { + result[++index] = value; + }); + return result; +} + +/** Used for built-in method references. */ +var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; + +/** Used to detect methods masquerading as native. */ +var maskSrcKey = (function () { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; +}()); + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Used to infer the `Object` constructor. */ +var objectCtorString = funcToString.call(Object); + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** Built-in value references. */ +var Buffer = moduleExports ? root.Buffer : undefined, + Symbol = root.Symbol, + Uint8Array = root.Uint8Array, + getPrototype = overArg(Object.getPrototypeOf, Object), + objectCreate = Object.create, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + splice = arrayProto.splice; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeGetSymbols = Object.getOwnPropertySymbols, + nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, + nativeKeys = overArg(Object.keys, Object), + nativeMax = Math.max; + +/* Built-in method references that are verified to be native. */ +var DataView = getNative(root, 'DataView'), + Map = getNative(root, 'Map'), + Promise = getNative(root, 'Promise'), + Set = getNative(root, 'Set'), + WeakMap = getNative(root, 'WeakMap'), + nativeCreate = getNative(Object, 'create'); + +/** Used to detect maps, sets, and weakmaps. */ +var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; + +/** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Hash(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ +function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; +} + +/** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function hashDelete(key) { + return this.has(key) && delete this.__data__[key]; +} + +/** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; +} + +/** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function hashHas(key) { + var data = this.__data__; + return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); +} + +/** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ +function hashSet(key, value) { + var data = this.__data__; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; +} + +// Add methods to `Hash`. +Hash.prototype.clear = hashClear; +Hash.prototype['delete'] = hashDelete; +Hash.prototype.get = hashGet; +Hash.prototype.has = hashHas; +Hash.prototype.set = hashSet; + +/** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function ListCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ +function listCacheClear() { + this.__data__ = []; +} + +/** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + return true; +} + +/** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; +} + +/** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; +} + +/** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ +function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; +} + +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; + +/** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function MapCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ +function mapCacheClear() { + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; +} + +/** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function mapCacheDelete(key) { + return getMapData(this, key)['delete'](key); +} + +/** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function mapCacheGet(key) { + return getMapData(this, key).get(key); +} + +/** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function mapCacheHas(key) { + return getMapData(this, key).has(key); +} + +/** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ +function mapCacheSet(key, value) { + getMapData(this, key).set(key, value); + return this; +} + +// Add methods to `MapCache`. +MapCache.prototype.clear = mapCacheClear; +MapCache.prototype['delete'] = mapCacheDelete; +MapCache.prototype.get = mapCacheGet; +MapCache.prototype.has = mapCacheHas; +MapCache.prototype.set = mapCacheSet; + +/** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Stack(entries) { + this.__data__ = new ListCache(entries); +} + +/** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ +function stackClear() { + this.__data__ = new ListCache; +} + +/** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function stackDelete(key) { + return this.__data__['delete'](key); +} + +/** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function stackGet(key) { + return this.__data__.get(key); +} + +/** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function stackHas(key) { + return this.__data__.has(key); +} + +/** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */ +function stackSet(key, value) { + var cache = this.__data__; + if (cache instanceof ListCache) { + var pairs = cache.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + return this; + } + cache = this.__data__ = new MapCache(pairs); + } + cache.set(key, value); + return this; +} + +// Add methods to `Stack`. +Stack.prototype.clear = stackClear; +Stack.prototype['delete'] = stackDelete; +Stack.prototype.get = stackGet; +Stack.prototype.has = stackHas; +Stack.prototype.set = stackSet; + +/** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ +function arrayLikeKeys(value, inherited) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + // Safari 9 makes `arguments.length` enumerable in strict mode. + var result = (isArray(value) || isArguments(value)) + ? baseTimes(value.length, String) + : []; + + var length = result.length, + skipIndexes = !!length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == 'length' || isIndex(key, length)))) { + result.push(key); + } + } + return result; +} + +/** + * This function is like `assignValue` except that it doesn't assign + * `undefined` values. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ +function assignMergeValue(object, key, value) { + if ((value !== undefined && !eq(object[key], value)) || + (typeof key == 'number' && value === undefined && !(key in object))) { + object[key] = value; + } +} + +/** + * Assigns `value` to `key` of `object` if the existing value is not equivalent + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ +function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object))) { + object[key] = value; + } +} + +/** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; +} + +/** + * The base implementation of `_.assign` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ +function baseAssign(object, source) { + return object && copyObject(source, keys(source), object); +} + +/** + * The base implementation of `_.clone` and `_.cloneDeep` which tracks + * traversed objects. + * + * @private + * @param {*} value The value to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @param {boolean} [isFull] Specify a clone including symbols. + * @param {Function} [customizer] The function to customize cloning. + * @param {string} [key] The key of `value`. + * @param {Object} [object] The parent object of `value`. + * @param {Object} [stack] Tracks traversed objects and their clone counterparts. + * @returns {*} Returns the cloned value. + */ +function baseClone(value, isDeep, isFull, customizer, key, object, stack) { + var result; + if (customizer) { + result = object ? customizer(value, key, object, stack) : customizer(value); + } + if (result !== undefined) { + return result; + } + if (!isObject(value)) { + return value; + } + var isArr = isArray(value); + if (isArr) { + result = initCloneArray(value); + if (!isDeep) { + return copyArray(value, result); + } + } else { + var tag = getTag(value), + isFunc = tag == funcTag || tag == genTag; + + if (isBuffer(value)) { + return cloneBuffer(value, isDeep); + } + if (tag == objectTag || tag == argsTag || (isFunc && !object)) { + if (isHostObject(value)) { + return object ? value : {}; + } + result = initCloneObject(isFunc ? {} : value); + if (!isDeep) { + return copySymbols(value, baseAssign(result, value)); + } + } else { + if (!cloneableTags[tag]) { + return object ? value : {}; + } + result = initCloneByTag(value, tag, baseClone, isDeep); + } + } + // Check for circular references and return its corresponding clone. + stack || (stack = new Stack); + var stacked = stack.get(value); + if (stacked) { + return stacked; + } + stack.set(value, result); + + if (!isArr) { + var props = isFull ? getAllKeys(value) : keys(value); + } + arrayEach(props || value, function (subValue, key) { + if (props) { + key = subValue; + subValue = value[key]; + } + // Recursively populate clone (susceptible to call stack limits). + assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack)); + }); + return result; +} + +/** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} prototype The object to inherit from. + * @returns {Object} Returns the new object. + */ +function baseCreate(proto) { + return isObject(proto) ? objectCreate(proto) : {}; +} + +/** + * The base implementation of `getAllKeys` and `getAllKeysIn` which uses + * `keysFunc` and `symbolsFunc` to get the enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Function} keysFunc The function to get the keys of `object`. + * @param {Function} symbolsFunc The function to get the symbols of `object`. + * @returns {Array} Returns the array of property names and symbols. + */ +function baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); +} + +/** + * The base implementation of `getTag`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function baseGetTag(value) { + return objectToString.call(value); +} + +/** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ +function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); +} + +/** + * The base implementation of `_.isTypedArray` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + */ +function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[objectToString.call(value)]; +} + +/** + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; +} + +/** + * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function baseKeysIn(object) { + if (!isObject(object)) { + return nativeKeysIn(object); + } + var isProto = isPrototype(object), + result = []; + + for (var key in object) { + if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); + } + } + return result; +} + +/** + * The base implementation of `_.merge` without support for multiple sources. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {number} srcIndex The index of `source`. + * @param {Function} [customizer] The function to customize merged values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ +function baseMerge(object, source, srcIndex, customizer, stack) { + if (object === source) { + return; + } + if (!(isArray(source) || isTypedArray(source))) { + var props = baseKeysIn(source); + } + arrayEach(props || source, function (srcValue, key) { + if (props) { + key = srcValue; + srcValue = source[key]; + } + if (isObject(srcValue)) { + stack || (stack = new Stack); + baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); + } + else { + var newValue = customizer + ? customizer(object[key], srcValue, (key + ''), object, source, stack) + : undefined; + + if (newValue === undefined) { + newValue = srcValue; + } + assignMergeValue(object, key, newValue); + } + }); +} + +/** + * A specialized version of `baseMerge` for arrays and objects which performs + * deep merges and tracks traversed objects enabling objects with circular + * references to be merged. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {string} key The key of the value to merge. + * @param {number} srcIndex The index of `source`. + * @param {Function} mergeFunc The function to merge values. + * @param {Function} [customizer] The function to customize assigned values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ +function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { + var objValue = object[key], + srcValue = source[key], + stacked = stack.get(srcValue); + + if (stacked) { + assignMergeValue(object, key, stacked); + return; + } + var newValue = customizer + ? customizer(objValue, srcValue, (key + ''), object, source, stack) + : undefined; + + var isCommon = newValue === undefined; + + if (isCommon) { + newValue = srcValue; + if (isArray(srcValue) || isTypedArray(srcValue)) { + if (isArray(objValue)) { + newValue = objValue; + } + else if (isArrayLikeObject(objValue)) { + newValue = copyArray(objValue); + } + else { + isCommon = false; + newValue = baseClone(srcValue, true); + } + } + else if (isPlainObject(srcValue) || isArguments(srcValue)) { + if (isArguments(objValue)) { + newValue = toPlainObject(objValue); + } + else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) { + isCommon = false; + newValue = baseClone(srcValue, true); + } + else { + newValue = objValue; + } + } + else { + isCommon = false; + } + } + if (isCommon) { + // Recursively merge objects and arrays (susceptible to call stack limits). + stack.set(srcValue, newValue); + mergeFunc(newValue, srcValue, srcIndex, customizer, stack); + stack['delete'](srcValue); + } + assignMergeValue(object, key, newValue); +} + +/** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + */ +function baseRest(func, start) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function () { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = array; + return apply(func, this, otherArgs); + }; +} + +/** + * Creates a clone of `buffer`. + * + * @private + * @param {Buffer} buffer The buffer to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Buffer} Returns the cloned buffer. + */ +function cloneBuffer(buffer, isDeep) { + if (isDeep) { + return buffer.slice(); + } + var result = new buffer.constructor(buffer.length); + buffer.copy(result); + return result; +} + +/** + * Creates a clone of `arrayBuffer`. + * + * @private + * @param {ArrayBuffer} arrayBuffer The array buffer to clone. + * @returns {ArrayBuffer} Returns the cloned array buffer. + */ +function cloneArrayBuffer(arrayBuffer) { + var result = new arrayBuffer.constructor(arrayBuffer.byteLength); + new Uint8Array(result).set(new Uint8Array(arrayBuffer)); + return result; +} + +/** + * Creates a clone of `dataView`. + * + * @private + * @param {Object} dataView The data view to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned data view. + */ +function cloneDataView(dataView, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; + return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); +} + +/** + * Creates a clone of `map`. + * + * @private + * @param {Object} map The map to clone. + * @param {Function} cloneFunc The function to clone values. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned map. + */ +function cloneMap(map, isDeep, cloneFunc) { + var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map); + return arrayReduce(array, addMapEntry, new map.constructor); +} + +/** + * Creates a clone of `regexp`. + * + * @private + * @param {Object} regexp The regexp to clone. + * @returns {Object} Returns the cloned regexp. + */ +function cloneRegExp(regexp) { + var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); + result.lastIndex = regexp.lastIndex; + return result; +} + +/** + * Creates a clone of `set`. + * + * @private + * @param {Object} set The set to clone. + * @param {Function} cloneFunc The function to clone values. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned set. + */ +function cloneSet(set, isDeep, cloneFunc) { + var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set); + return arrayReduce(array, addSetEntry, new set.constructor); +} + +/** + * Creates a clone of the `symbol` object. + * + * @private + * @param {Object} symbol The symbol object to clone. + * @returns {Object} Returns the cloned symbol object. + */ +function cloneSymbol(symbol) { + return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; +} + +/** + * Creates a clone of `typedArray`. + * + * @private + * @param {Object} typedArray The typed array to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned typed array. + */ +function cloneTypedArray(typedArray, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; + return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); +} + +/** + * Copies the values of `source` to `array`. + * + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. + */ +function copyArray(source, array) { + var index = -1, + length = source.length; + + array || (array = Array(length)); + while (++index < length) { + array[index] = source[index]; + } + return array; +} + +/** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. + */ +function copyObject(source, props, object, customizer) { + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : undefined; + + assignValue(object, key, newValue === undefined ? source[key] : newValue); + } + return object; +} + +/** + * Copies own symbol properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ +function copySymbols(source, object) { + return copyObject(source, getSymbols(source), object); +} + +/** + * Creates a function like `_.assign`. + * + * @private + * @param {Function} assigner The function to assign values. + * @returns {Function} Returns the new assigner function. + */ +function createAssigner(assigner) { + return baseRest(function (object, sources) { + var index = -1, + length = sources.length, + customizer = length > 1 ? sources[length - 1] : undefined, + guard = length > 2 ? sources[2] : undefined; + + customizer = (assigner.length > 3 && typeof customizer == 'function') + ? (length--, customizer) + : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + customizer = length < 3 ? undefined : customizer; + length = 1; + } + object = Object(object); + while (++index < length) { + var source = sources[index]; + if (source) { + assigner(object, source, index, customizer); + } + } + return object; + }); +} + +/** + * Creates an array of own enumerable property names and symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ +function getAllKeys(object) { + return baseGetAllKeys(object, keys, getSymbols); +} + +/** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ +function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; +} + +/** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ +function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; +} + +/** + * Creates an array of the own enumerable symbol properties of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ +var getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray; + +/** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +var getTag = baseGetTag; + +// Fallback for data views, maps, sets, and weak maps in IE 11, +// for data views in Edge < 14, and promises in Node.js. +if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || + (Map && getTag(new Map) != mapTag) || + (Promise && getTag(Promise.resolve()) != promiseTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { + getTag = function (value) { + var result = objectToString.call(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : undefined; + + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: + return dataViewTag; + case mapCtorString: + return mapTag; + case promiseCtorString: + return promiseTag; + case setCtorString: + return setTag; + case weakMapCtorString: + return weakMapTag; + } + } + return result; + }; +} + +/** + * Initializes an array clone. + * + * @private + * @param {Array} array The array to clone. + * @returns {Array} Returns the initialized clone. + */ +function initCloneArray(array) { + var length = array.length, + result = array.constructor(length); + + // Add properties assigned by `RegExp#exec`. + if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { + result.index = array.index; + result.input = array.input; + } + return result; +} + +/** + * Initializes an object clone. + * + * @private + * @param {Object} object The object to clone. + * @returns {Object} Returns the initialized clone. + */ +function initCloneObject(object) { + return (typeof object.constructor == 'function' && !isPrototype(object)) + ? baseCreate(getPrototype(object)) + : {}; +} + +/** + * Initializes an object clone based on its `toStringTag`. + * + * **Note:** This function only supports cloning values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to clone. + * @param {string} tag The `toStringTag` of the object to clone. + * @param {Function} cloneFunc The function to clone values. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the initialized clone. + */ +function initCloneByTag(object, tag, cloneFunc, isDeep) { + var Ctor = object.constructor; + switch (tag) { + case arrayBufferTag: + return cloneArrayBuffer(object); + + case boolTag: + case dateTag: + return new Ctor(+object); + + case dataViewTag: + return cloneDataView(object, isDeep); + + case float32Tag: + case float64Tag: + case int8Tag: + case int16Tag: + case int32Tag: + case uint8Tag: + case uint8ClampedTag: + case uint16Tag: + case uint32Tag: + return cloneTypedArray(object, isDeep); + + case mapTag: + return cloneMap(object, isDeep, cloneFunc); + + case numberTag: + case stringTag: + return new Ctor(object); + + case regexpTag: + return cloneRegExp(object); + + case setTag: + return cloneSet(object, isDeep, cloneFunc); + + case symbolTag: + return cloneSymbol(object); + } +} + +/** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ +function isIndex(value, length) { + length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && + (typeof value == 'number' || reIsUint.test(value)) && + (value > -1 && value % 1 == 0 && value < length); +} + +/** + * Checks if the given arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. + */ +function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { + return eq(object[index], value); + } + return false; +} + +/** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ +function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); +} + +/** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); +} + +/** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ +function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; +} + +/** + * This function is like + * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * except that it includes inherited enumerable properties. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function nativeKeysIn(object) { + var result = []; + if (object != null) { + for (var key in Object(object)) { + result.push(key); + } + } + return result; +} + +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to process. + * @returns {string} Returns the source code. + */ +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) { + } + try { + return (func + ''); + } catch (e) { + } + } + return ''; +} + +/** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + +/** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ +function isArguments(value) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && + (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); +} + +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray = Array.isArray; + +/** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ +function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); +} + +/** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ +function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); +} + +/** + * Checks if `value` is a buffer. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false + */ +var isBuffer = nativeIsBuffer || stubFalse; + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8-9 which returns 'object' for typed array and other constructors. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; +} + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ +function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is a plain object, that is, an object created by the + * `Object` constructor or one with a `[[Prototype]]` of `null`. + * + * @static + * @memberOf _ + * @since 0.8.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * _.isPlainObject(new Foo); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true + * + * _.isPlainObject(Object.create(null)); + * // => true + */ +function isPlainObject(value) { + if (!isObjectLike(value) || + objectToString.call(value) != objectTag || isHostObject(value)) { + return false; + } + var proto = getPrototype(value); + if (proto === null) { + return true; + } + var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; + return (typeof Ctor == 'function' && + Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString); +} + +/** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ +var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + +/** + * Converts `value` to a plain object flattening inherited enumerable string + * keyed properties of `value` to own properties of the plain object. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {Object} Returns the converted plain object. + * @example + * + * function Foo() { + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.assign({ 'a': 1 }, new Foo); + * // => { 'a': 1, 'b': 2 } + * + * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); + * // => { 'a': 1, 'b': 2, 'c': 3 } + */ +function toPlainObject(value) { + return copyObject(value, keysIn(value)); +} + +/** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ +function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); +} + +/** + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + */ +function keysIn(object) { + return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); +} + +/** + * This method is like `_.assign` except that it recursively merges own and + * inherited enumerable string keyed properties of source objects into the + * destination object. Source properties that resolve to `undefined` are + * skipped if a destination value exists. Array and plain object properties + * are merged recursively. Other objects and value types are overridden by + * assignment. Source objects are applied from left to right. Subsequent + * sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @example + * + * var object = { + * 'a': [{ 'b': 2 }, { 'd': 4 }] + * }; + * + * var other = { + * 'a': [{ 'c': 3 }, { 'e': 5 }] + * }; + * + * _.merge(object, other); + * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } + */ +var merge = createAssigner(function (object, source, srcIndex) { + baseMerge(object, source, srcIndex); +}); + +/** + * This method returns a new empty array. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {Array} Returns the new empty array. + * @example + * + * var arrays = _.times(2, _.stubArray); + * + * console.log(arrays); + * // => [[], []] + * + * console.log(arrays[0] === arrays[1]); + * // => false + */ +function stubArray() { + return []; +} + +/** + * This method returns `false`. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {boolean} Returns `false`. + * @example + * + * _.times(2, _.stubFalse); + * // => [false, false] + */ +function stubFalse() { + return false; +} + +module.exports = merge; diff --git a/doc/themes/next/scripts/tags/button.js b/doc/themes/next/scripts/tags/button.js new file mode 100644 index 00000000..ea530e24 --- /dev/null +++ b/doc/themes/next/scripts/tags/button.js @@ -0,0 +1,35 @@ +/** + * button.js | https://theme-next.org/docs/tag-plugins/button + */ + +/* global hexo */ + +'use strict'; + +function postButton(args) { + args = args.join(' ').split(','); + var url = args[0]; + var text = args[1] || ''; + var icon = args[2] || ''; + var title = args[3] || ''; + + if (!url) { + hexo.log.warn('URL can NOT be empty'); + } + + text = text.trim(); + icon = icon.trim(); + title = title.trim(); + + var result = [` 0 && result.push(` title="${title}"`); + result.push('>'); + icon.length > 0 && result.push(``); + text.length > 0 && result.push(text); + result.push(''); + + return result.join(''); +} + +hexo.extend.tag.register('button', postButton, {ends: false}); +hexo.extend.tag.register('btn', postButton, {ends: false}); diff --git a/doc/themes/next/scripts/tags/center-quote.js b/doc/themes/next/scripts/tags/center-quote.js new file mode 100644 index 00000000..679f14f3 --- /dev/null +++ b/doc/themes/next/scripts/tags/center-quote.js @@ -0,0 +1,16 @@ +/** + * center-quote.js | https://theme-next.org/docs/tag-plugins/ + */ + +/* global hexo */ + +'use strict'; + +function centerQuote(args, content) { + return '
' + + hexo.render.renderSync({text: content, engine: 'markdown'}) + + '
'; +} + +hexo.extend.tag.register('centerquote', centerQuote, {ends: true}); +hexo.extend.tag.register('cq', centerQuote, {ends: true}); diff --git a/doc/themes/next/scripts/tags/exturl.js b/doc/themes/next/scripts/tags/exturl.js new file mode 100644 index 00000000..16634091 --- /dev/null +++ b/doc/themes/next/scripts/tags/exturl.js @@ -0,0 +1,62 @@ +/** + * exturl.js | https://theme-next.org/docs/tag-plugins/exturl + * Note: need to remove in NexT v7.0.0 + */ + +/* global hexo */ + +'use strict'; + +var util = require('hexo-util'); +var htmlTag = util.htmlTag; + +/* eslint-disable */ +var rUrl = /((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=+$,\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=+$,\w]+@)[A-Za-z0-9.-]+)((?:\/[+~%/.\w-_]*)?\??(?:[-+=&;%@.\w_]*)#?(?:[.!/\\w]*))?)/; + +// Create Base64 Object +var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(e){var t="";var n,r,i,s,o,u,a;var f=0;e=Base64._utf8_encode(e);while(f>2;o=(n&3)<<4|r>>4;u=(r&15)<<2|i>>6;a=i&63;if(isNaN(r)){u=a=64}else if(isNaN(i)){a=64}t=t+this._keyStr.charAt(s)+this._keyStr.charAt(o)+this._keyStr.charAt(u)+this._keyStr.charAt(a)}return t},decode:function(e){var t="";var n,r,i;var s,o,u,a;var f=0;e=e.replace(/[^A-Za-z0-9+/=]/g,"");while(f>4;r=(o&15)<<4|u>>2;i=(u&3)<<6|a;t=t+String.fromCharCode(n);if(u!=64){t=t+String.fromCharCode(r)}if(a!=64){t=t+String.fromCharCode(i)}}t=Base64._utf8_decode(t);return t},_utf8_encode:function(e){e=e.replace(/rn/g,"n");var t="";for(var n=0;n127&&r<2048){t+=String.fromCharCode(r>>6|192);t+=String.fromCharCode(r&63|128)}else{t+=String.fromCharCode(r>>12|224);t+=String.fromCharCode(r>>6&63|128);t+=String.fromCharCode(r&63|128)}}return t},_utf8_decode:function(e){var t="";var n=0;var r=c1=c2=0;while(n191&&r<224){c2=e.charCodeAt(n+1);t+=String.fromCharCode((r&31)<<6|c2&63);n+=2}else{c2=e.charCodeAt(n+1);c3=e.charCodeAt(n+2);t+=String.fromCharCode((r&15)<<12|(c2&63)<<6|c3&63);n+=3}}return t}}; +/* eslint-enable */ + +function extURL(args) { + var exturl = 'exturl'; + var url = ''; + var text = []; + var title = ''; + var item = ''; + var i = 0; + var len = args.length; + + // Find link URL and text + for (; i < len; i++) { + item = args[i]; + + if (rUrl.test(item)) { + url = Base64.encode(item); + break; + } else { + text.push(item); + } + } + + // Delete link URL and text from arguments + args = args.slice(i + 1); + + // If any arguments exists, collect the last text as the link title, + // if not, set title as url. + if (args.length) { + title = args.join(' '); + } else { + title = item; + } + + var attrs = { + class : exturl, + 'data-url': url, + title : title + }; + hexo.log.warn('WARNING: `exturl` and `extlink` tag will not longer be supported. More info here: https://theme-next.org/docs/theme-settings/seo#ExtURL'); + return htmlTag('span', attrs, text.join(' ') + ''); +} + +hexo.extend.tag.register('exturl', extURL, {ends: false}); +hexo.extend.tag.register('extlink', extURL, {ends: false}); diff --git a/doc/themes/next/scripts/tags/full-image.js b/doc/themes/next/scripts/tags/full-image.js new file mode 100644 index 00000000..84b70f5d --- /dev/null +++ b/doc/themes/next/scripts/tags/full-image.js @@ -0,0 +1,32 @@ +/** + * full-image.js | https://theme-next.org/docs/tag-plugins/full-image + */ + +/* global hexo */ + +'use strict'; + +function fullImage(args) { + args = args.join(' ').split(','); + var mixed = args[0].split('@'); + var img = mixed[0]; + var src = mixed[1] === 'lazy' ? '/images/loading.gif" data-original="' + img : img; + var alt = args[1] || ''; + var title = args[2] || ''; + var width = args[3] || ''; + + if (!img) { + hexo.log.warn('Image src can NOT be empty'); + } + + var image = [` 0 && image.push(`alt="${alt.trim()}"`); + title.length > 0 && image.push(`title="${title.trim()}"`); + width.length > 0 && image.push(`style="max-width: none; width:${width};"`); + image.push('/>'); + + return image.join(' '); +} + +hexo.extend.tag.register('fullimage', fullImage, {ends: false}); +hexo.extend.tag.register('fi', fullImage, {ends: false}); diff --git a/doc/themes/next/scripts/tags/group-pictures.js b/doc/themes/next/scripts/tags/group-pictures.js new file mode 100644 index 00000000..0836d493 --- /dev/null +++ b/doc/themes/next/scripts/tags/group-pictures.js @@ -0,0 +1,150 @@ +/** + * group-pictures.js | https://theme-next.org/docs/tag-plugins/group-pictures + */ + +/* global hexo */ + +'use strict'; + +var LAYOUTS = { + 2: { + 1: [1, 1], + 2: [2] + }, + 3: { + 1: [3], + 2: [1, 2], + 3: [2, 1] + }, + 4: { + 1: [1, 2, 1], + 2: [1, 3], + 3: [2, 2], + 4: [3, 1] + }, + 5: { + 1: [1, 2, 2], + 2: [2, 1, 2], + 3: [2, 3], + 4: [3, 2] + }, + 6: { + 1: [1, 2, 3], + 2: [1, 3, 2], + 3: [2, 1, 3], + 4: [2, 2, 2], + 5: [3, 3] + }, + 7: { + 1: [1, 2, 2, 2], + 2: [1, 3, 3], + 3: [2, 2, 3], + 4: [2, 3, 2], + 5: [3, 2, 2] + }, + 8: { + 1: [1, 2, 2, 3], + 2: [1, 2, 3, 2], + 3: [1, 3, 2, 2], + 4: [2, 2, 2, 2], + 5: [2, 3, 3], + 6: [3, 2, 3], + 7: [3, 3, 2] + }, + 9: { + 1: [1, 2, 3, 3], + 2: [1, 3, 2, 3], + 3: [2, 2, 2, 3], + 4: [2, 2, 3, 2], + 5: [2, 3, 2, 2], + 6: [3, 2, 2, 2], + 7: [3, 3, 3] + }, + 10: { + 1: [1, 3, 3, 3], + 2: [2, 2, 3, 3], + 3: [2, 3, 2, 3], + 4: [2, 3, 3, 2], + 5: [3, 2, 2, 3], + 6: [3, 2, 3, 2], + 7: [3, 3, 2, 2] + } +}; + +function groupBy(group, data) { + var r = []; + for (var i = 0; i < group.length; i++) { + r.push(data.slice(0, group[i])); + data = data.slice(group[i]); + } + return r; +} + +var templates = { + + dispatch: function(pictures, group, layout) { + var rule = LAYOUTS[group] ? LAYOUTS[group][layout] : null; + return rule ? this.getHTML(groupBy(rule, pictures)) : templates.defaults(pictures); + }, + + /** + * Defaults Layout + * + * □ □ □ + * □ □ □ + * ... + * + * @param pictures + */ + defaults: function(pictures) { + var ROW_SIZE = 3; + var rows = pictures.length / (ROW_SIZE + 1); + var pictureArr = []; + + for (var i = 0; i < rows; i++) { + pictureArr.push(pictures.slice(i * ROW_SIZE, (i + 1) * ROW_SIZE)); + } + + return this.getHTML(pictureArr); + }, + + getHTML: function(rows) { + var rowHTML = ''; + + for (var i = 0; i < rows.length; i++) { + rowHTML += this.getRowHTML(rows[i]); + } + + return `
${rowHTML}
`; + }, + + getRowHTML: function(pictures) { + return `
${this.getColumnHTML(pictures)}
`; + }, + + getColumnHTML: function(pictures) { + var columns = []; + var columnWidth = 100 / pictures.length; + var columnStyle = `style="width: ${columnWidth}%;"`; + + for (var i = 0; i < pictures.length; i++) { + columns.push(`
${pictures[i]}
`); + } + return columns.join(''); + } +}; + +function groupPicture(args, content) { + args = args[0].split('-'); + var group = parseInt(args[0], 10); + var layout = parseInt(args[1], 10); + + content = hexo.render.renderSync({text: content, engine: 'markdown'}); + + var pictures = content.match(//g); + + return `
${templates.dispatch(pictures, group, layout)}
`; +} + +hexo.extend.tag.register('grouppicture', groupPicture, {ends: true}); +hexo.extend.tag.register('gp', groupPicture, {ends: true}); diff --git a/doc/themes/next/scripts/tags/include-raw.js b/doc/themes/next/scripts/tags/include-raw.js new file mode 100644 index 00000000..016da7b7 --- /dev/null +++ b/doc/themes/next/scripts/tags/include-raw.js @@ -0,0 +1,30 @@ +/** + * include-raw.js | https://theme-next.org/docs/tag-plugins/ + */ + +/* global hexo */ + +'use strict'; + +var pathFn = require('path'); +var fs = require('hexo-fs'); + +function includeRaw(args) { + var path = pathFn.join(hexo.source_dir, args[0]); + + return fs.exists(path).then(function(exist) { + if (!exist) { + hexo.log.error('Include file not found!'); + return; + } + return fs.readFile(path).then(function(contents) { + if (!contents) { + hexo.log.warn('Include file empty.'); + return; + } + return contents; + }); + }); +} + +hexo.extend.tag.register('include_raw', includeRaw, {ends: false, async: true}); diff --git a/doc/themes/next/scripts/tags/label.js b/doc/themes/next/scripts/tags/label.js new file mode 100644 index 00000000..94fb38a0 --- /dev/null +++ b/doc/themes/next/scripts/tags/label.js @@ -0,0 +1,19 @@ +/** + * label.js | https://theme-next.org/docs/tag-plugins/label + */ + +/* global hexo */ + +'use strict'; + +function postLabel(args) { + args = args.join(' ').split('@'); + var classes = args[0] || 'default'; + var text = args[1] || ''; + + !text && hexo.log.warn('Label text must be defined!'); + + return `${text}`; +} + +hexo.extend.tag.register('label', postLabel, {ends: false}); diff --git a/doc/themes/next/scripts/tags/mermaid.js b/doc/themes/next/scripts/tags/mermaid.js new file mode 100644 index 00000000..aa8e3bea --- /dev/null +++ b/doc/themes/next/scripts/tags/mermaid.js @@ -0,0 +1,16 @@ +/** + * mermaid.js | https://theme-next.org/docs/tag-plugins/mermaid + */ + +/* global hexo */ + +'use strict'; + +function mermaid(args, content) { + return `
+            ${args.join(' ')}
+            ${content}
+          
`; +} + +hexo.extend.tag.register('mermaid', mermaid, {ends: true}); diff --git a/doc/themes/next/scripts/tags/note.js b/doc/themes/next/scripts/tags/note.js new file mode 100644 index 00000000..578e2b36 --- /dev/null +++ b/doc/themes/next/scripts/tags/note.js @@ -0,0 +1,16 @@ +/** + * note.js | https://theme-next.org/docs/tag-plugins/note + */ + +/* global hexo */ + +'use strict'; + +function postNote(args, content) { + return `
+ ${hexo.render.renderSync({text: content, engine: 'markdown'}).split('\n').join('')} +
`; +} + +hexo.extend.tag.register('note', postNote, {ends: true}); +hexo.extend.tag.register('subnote', postNote, {ends: true}); diff --git a/doc/themes/next/scripts/tags/pdf.js b/doc/themes/next/scripts/tags/pdf.js new file mode 100644 index 00000000..349e5fcf --- /dev/null +++ b/doc/themes/next/scripts/tags/pdf.js @@ -0,0 +1,13 @@ +/** + * pdf.js | https://theme-next.org/docs/tag-plugins/pdf + */ + +/* global hexo */ + +'use strict'; + +function pdf(args) { + return `
`; +} + +hexo.extend.tag.register('pdf', pdf, {ends: false}); diff --git a/doc/themes/next/scripts/tags/tabs.js b/doc/themes/next/scripts/tags/tabs.js new file mode 100644 index 00000000..4b39576f --- /dev/null +++ b/doc/themes/next/scripts/tags/tabs.js @@ -0,0 +1,59 @@ +/** + * tabs.js | https://theme-next.org/docs/tag-plugins/tabs + */ + +/* global hexo */ + +'use strict'; + +function postTabs(args, content) { + var tabBlock = /\n([\w\W\s\S]*?)/g; + + args = args.join(' ').split(','); + var tabName = args[0]; + var tabActive = Number(args[1]) || 0; + + var matches = []; + var match; + var tabId = 0; + var tabNav = ''; + var tabContent = ''; + + !tabName && hexo.log.warn('Tabs block must have unique name!'); + + while ((match = tabBlock.exec(content)) !== null) { + matches.push(match[1]); + matches.push(match[2]); + } + + for (var i = 0; i < matches.length; i += 2) { + var tabParameters = matches[i].split('@'); + var postContent = matches[i + 1]; + var tabCaption = tabParameters[0] || ''; + var tabIcon = tabParameters[1] || ''; + var tabHref = ''; + + postContent = hexo.render.renderSync({text: postContent, engine: 'markdown'}).trim(); + + tabId += 1; + tabHref = (tabName + ' ' + tabId).toLowerCase().split(' ').join('-'); + + ((tabCaption.length === 0) && (tabIcon.length === 0)) && (tabCaption = tabName + ' ' + tabId); + + var isOnlyicon = tabIcon.length > 0 && tabCaption.length === 0 ? ' style="text-align: center;"' : ''; + tabIcon.length > 0 && (tabIcon = ``); + + var isActive = (tabActive > 0 && tabActive === tabId) || (tabActive === 0 && tabId === 1) ? ' active' : ''; + tabNav += `
  • ${tabIcon + tabCaption.trim()}
  • `; + tabContent += `
    ${postContent}
    `; + } + + tabNav = ``; + tabContent = `
    ${tabContent}
    `; + + return `
    ${tabNav + tabContent}
    `; +} + +hexo.extend.tag.register('tabs', postTabs, {ends: true}); +hexo.extend.tag.register('subtabs', postTabs, {ends: true}); +hexo.extend.tag.register('subsubtabs', postTabs, {ends: true}); diff --git a/doc/themes/next/scripts/tags/video.js b/doc/themes/next/scripts/tags/video.js new file mode 100644 index 00000000..1688b824 --- /dev/null +++ b/doc/themes/next/scripts/tags/video.js @@ -0,0 +1,13 @@ +/** + * video.js | https://theme-next.org/docs/tag-plugins/video + */ + +/* global hexo */ + +'use strict'; + +function postVideo(args) { + return ``; +} + +hexo.extend.tag.register('video', postVideo, {ends: false}); diff --git a/doc/themes/next/source/css/_common/components/back-to-top-sidebar.styl b/doc/themes/next/source/css/_common/components/back-to-top-sidebar.styl new file mode 100644 index 00000000..0e99da46 --- /dev/null +++ b/doc/themes/next/source/css/_common/components/back-to-top-sidebar.styl @@ -0,0 +1,19 @@ +.back-to-top { + visibility: hidden; + margin: (20px - $sidebar-offset) -10px -20px; + background: $b2t-sidebar-bg-color; + font-size: $b2t-font-size; + opacity: $b2t-opacity; + cursor: pointer; + text-align: center; + &:hover { opacity: 0.8; } + + +tablet-mobile() { + hexo-config('sidebar.onmobile') ? fixbutton() : hide(); + } + + &.back-to-top-on { + visibility: visible; + the-transition(); + } +} diff --git a/doc/themes/next/source/css/_common/components/back-to-top.styl b/doc/themes/next/source/css/_common/components/back-to-top.styl new file mode 100644 index 00000000..1f64977c --- /dev/null +++ b/doc/themes/next/source/css/_common/components/back-to-top.styl @@ -0,0 +1,24 @@ +.back-to-top { + box-sizing: border-box; + position: fixed; + bottom: $b2t-position-bottom; + right: $b2t-position-right; + z-index: $zindex-5; + padding: 0 6px; + width: hexo-config('back2top.scrollpercent') ? initial : 24px; + background: $b2t-bg-color; + font-size: $b2t-font-size; + opacity: $b2t-opacity; + color: $b2t-color; + cursor: pointer; + text-align: center; + transition-property: bottom; + the-transition(); + + &.back-to-top-on { + bottom: $b2t-position-bottom-on; + } + &:hover { + color: $sidebar-highlight; + } +} diff --git a/doc/themes/next/source/css/_common/components/buttons.styl b/doc/themes/next/source/css/_common/components/buttons.styl new file mode 100644 index 00000000..53acc9f1 --- /dev/null +++ b/doc/themes/next/source/css/_common/components/buttons.styl @@ -0,0 +1,38 @@ +.btn { + display: inline-block; + padding: 0 20px; + font-size: $btn-default-font-size; + color: $btn-default-color; + background: $btn-default-bg; + border: $btn-default-border-width solid $btn-default-border-color; + text-decoration: none; + border-radius: $btn-default-radius; + transition-property: background-color; + the-transition(); + line-height: 2; + + &:hover { + border-color: $btn-default-hover-border-color; + color: $btn-default-hover-color; + background: $btn-default-hover-bg; + } + + +.btn { + margin: 0 0 8px 8px; + } + + .fa-fw { + width: (18em / 14); + text-align: left; + } +} + +.btn-bar { + show(); + width: 22px; + height: 2px; + background: $text-color; + border-radius: 1px; + + &+.btn-bar { margin-top: 4px; } +} diff --git a/doc/themes/next/source/css/_common/components/comments.styl b/doc/themes/next/source/css/_common/components/comments.styl new file mode 100644 index 00000000..bf3edb94 --- /dev/null +++ b/doc/themes/next/source/css/_common/components/comments.styl @@ -0,0 +1 @@ +.comments { margin: 60px 20px 0; } diff --git a/doc/themes/next/source/css/_common/components/components.styl b/doc/themes/next/source/css/_common/components/components.styl new file mode 100644 index 00000000..1a399abf --- /dev/null +++ b/doc/themes/next/source/css/_common/components/components.styl @@ -0,0 +1,18 @@ +@import "highlight"; +@import "tags"; + +@import "buttons"; +@import "pagination"; +@import "comments"; +@import (hexo-config('back2top.sidebar') ? "back-to-top-sidebar" : "back-to-top") if (hexo-config('back2top.enable')); + +@import "header"; +@import "post"; +@import "sidebar"; +@import "footer"; +@import "third-party"; + +@import "pages"; + +@import "rainbow" if hexo-config('safari_rainbow'); +@import "scrollbar" if hexo-config('custom_scrollbar'); diff --git a/doc/themes/next/source/css/_common/components/footer/footer.styl b/doc/themes/next/source/css/_common/components/footer/footer.styl new file mode 100644 index 00000000..f3f37757 --- /dev/null +++ b/doc/themes/next/source/css/_common/components/footer/footer.styl @@ -0,0 +1,30 @@ +.footer { + font-size: 14px; + color: $grey-dark; + + img { border: none; } +} + +.footer-inner { text-align: center; } + +@keyframes iconAnimate { + 0%, 100% { transform: scale(1); } + 10%, 30% { transform: scale(0.9); } + 20%, 40%, 60%, 80% { transform: scale(1.1); } + 50%, 70% { transform: scale(1.1); } +} + +if hexo-config('footer.icon.animated') { + #animate { + animation: iconAnimate 1.33s ease-in-out infinite; + } +} + +.with-love { + display: inline-block; + margin: 0 5px; + color: unquote(hexo-config('footer.icon.color')); +} + +.powered-by, +.theme-info { display: inline-block; } diff --git a/doc/themes/next/source/css/_common/components/header/github-banner.styl b/doc/themes/next/source/css/_common/components/header/github-banner.styl new file mode 100644 index 00000000..8219c17e --- /dev/null +++ b/doc/themes/next/source/css/_common/components/header/github-banner.styl @@ -0,0 +1,55 @@ +@keyframes octocat-wave { + 0%, 100% { + transform: rotate(0); + } + 20%, 60% { + transform: rotate(-25deg); + } + 40%, 80% { + transform: rotate(10deg); + } +} + +.github-corner { + scheme = hexo-config('scheme'); + bg_color = unquote(hexo-config('android_chrome_color')); + mobile_layout_economy = hexo-config('mobile_layout_economy'); + + :hover .octo-arm { + animation: octocat-wave 560ms ease-in-out; + } + > svg { + fill: bg_color; + color: #fff; + position: absolute; + top: 0; + border: 0; + right: 0; + } + +tablet-mobile() { + > svg { + if (scheme == 'Pisces') || (scheme == 'Gemini') { + fill: #fff; + color: bg_color; + } + } + .github-corner:hover .octo-arm { + animation: none; + } + .github-corner .octo-arm { + animation: octocat-wave 560ms ease-in-out; + } + } + +mobile() { + > svg { + if (scheme == 'Mist') { + top: inherit; + if mobile_layout_economy { + +mobile-small() { + margin-top: initial; + } + } + } + } + } +} diff --git a/doc/themes/next/source/css/_common/components/header/header.styl b/doc/themes/next/source/css/_common/components/header/header.styl new file mode 100644 index 00000000..997933b9 --- /dev/null +++ b/doc/themes/next/source/css/_common/components/header/header.styl @@ -0,0 +1,9 @@ +.header { background: $head-bg; } + +.header-inner { position: relative; } + +@import "headerband"; +@import "site-meta"; +@import "site-nav"; +@import "menu"; +@import "github-banner" if hexo-config('github_banner.enable'); diff --git a/doc/themes/next/source/css/_common/components/header/headerband.styl b/doc/themes/next/source/css/_common/components/header/headerband.styl new file mode 100644 index 00000000..382dbd9c --- /dev/null +++ b/doc/themes/next/source/css/_common/components/header/headerband.styl @@ -0,0 +1,4 @@ +.headband { + height: $headband-height; + background: $headband-bg; +} diff --git a/doc/themes/next/source/css/_common/components/header/menu.styl b/doc/themes/next/source/css/_common/components/header/menu.styl new file mode 100644 index 00000000..1efcbe4d --- /dev/null +++ b/doc/themes/next/source/css/_common/components/header/menu.styl @@ -0,0 +1,32 @@ +// Menu +// -------------------------------------------------- +.menu { + margin-top: 20px; + padding-left: 0; + text-align: center; +} + +.menu .menu-item { + display: inline-block; + margin: 0 10px; + list-style: none; + + +mobile() { + margin-top: 10px; + } + + a, span.exturl { + show(); + font-size: 13px; + line-height: inherit; + border-bottom: 1px solid $menu-link-border; + transition-property: border-color; + the-transition(); + + &:hover { border-bottom-color: $menu-link-hover-border; } + } + + .fa { margin-right: 5px; } +} + +.use-motion .menu-item { opacity: 0; } diff --git a/doc/themes/next/source/css/_common/components/header/site-meta.styl b/doc/themes/next/source/css/_common/components/header/site-meta.styl new file mode 100644 index 00000000..af2f3ae4 --- /dev/null +++ b/doc/themes/next/source/css/_common/components/header/site-meta.styl @@ -0,0 +1,48 @@ +.site-meta { + margin: 0; + text-align: $site-meta-text-align; + + +mobile() { text-align: center; } +} + +.brand { + position: relative; + display: inline-block; + padding: 0 40px; + color: $brand-color; + background: $brand-bg; + border-bottom: none; + &:hover { color: $brand-hover-color; } +} + +.logo { + display: inline-block; + margin-right: 5px; + line-height: 36px; + vertical-align: top; +} + +.site-title { + display: inline-block; + vertical-align: top; + line-height: 36px; + font-size: $logo-font-size; + font-weight: normal; + font-family: $font-family-logo; +} + +.site-subtitle { + margin-top: 10px; + font-size: $subtitle-font-size; + color: $subtitle-color; +} + +.use-motion { + .brand { opacity: 0; } + + .logo, .site-title, .site-subtitle, .custom-logo-image { + opacity: 0; + position: relative; + top: -10px; + } +} diff --git a/doc/themes/next/source/css/_common/components/header/site-nav.styl b/doc/themes/next/source/css/_common/components/header/site-nav.styl new file mode 100644 index 00000000..bcd2bff4 --- /dev/null +++ b/doc/themes/next/source/css/_common/components/header/site-nav.styl @@ -0,0 +1,28 @@ +.site-nav-toggle { + hide(); + position: absolute; + top: 10px; + left: 10px; + +mobile() { + show(); + } + + button { + margin-top: 2px; + padding: 9px 10px; + background: transparent; + border: none; + } +} + +.site-nav { + +mobile() { + hide(); + margin: 0 -10px; + padding: 0 10px; + clear: both; + border-top: 1px solid $gray-lighter; + } + +tablet() { display: block !important; } + +desktop() { display: block !important; } +} diff --git a/doc/themes/next/source/css/_common/components/highlight/diff.styl b/doc/themes/next/source/css/_common/components/highlight/diff.styl new file mode 100644 index 00000000..7a18f601 --- /dev/null +++ b/doc/themes/next/source/css/_common/components/highlight/diff.styl @@ -0,0 +1,8 @@ +$highlight_theme = hexo-config("highlight_theme") + +if $highlight_theme == "normal" + $highlight-deletion = #fdd + $highlight-addition = #dfd +else + $highlight-deletion = #800000 + $highlight-addition = #008000 diff --git a/doc/themes/next/source/css/_common/components/highlight/highlight.styl b/doc/themes/next/source/css/_common/components/highlight/highlight.styl new file mode 100644 index 00000000..ead2202c --- /dev/null +++ b/doc/themes/next/source/css/_common/components/highlight/highlight.styl @@ -0,0 +1,182 @@ +// https://github.com/chriskempson/tomorrow-theme + +@require "theme" +@require "diff" + +// Placeholder: $code-block +$code-block { + overflow: auto; + margin: 20px 0; + padding: 0; + font-size $code-font-size; + color: $highlight-foreground; + background: $highlight-background; + line-height: $line-height-code-block; +} + +pre, code { font-family: $code-font-family; } + +code { + word-wrap(); + padding: 2px 4px; + color: $code-foreground; + background: $code-background; + border-radius: $code-border-radius; + font-size: $code-font-size; +} + +pre { + @extend $code-block; + padding: 10px; + code { + padding: 0; + color: $highlight-foreground; + background: none; + text-shadow: none; + } +} + +.highlight { + @extend $code-block; + // Read values from NexT config and set they as local variables to use as string variables (in any CSS section). + hexo-config('codeblock.border_radius') is a 'unit' ? (cbradius = unit(hexo-config('codeblock.border_radius'), px)) : (cbradius = 1px) + border-radius: cbradius; + + pre { + border: none; + margin: 0; + padding: 10px 0; + } + + table { + margin: 0; + width: auto; + border: none; + } + + td { + border: none; + padding: 0; + } + + figcaption { + clearfix(); + font-size: 1em; + color: $highlight-foreground; + line-height: 1em; + margin-bottom: 1em; + margin: 0em; + padding: 0.5em; + background: $code-background; + border-bottom: 1px solid #e9e9e9; + + a { + float: right; + color: $highlight-foreground; + + &:hover { border-bottom-color: $highlight-foreground; } + } + } + + .gutter pre { + padding-left: 10px + padding-right: 10px + color: $highlight-gutter.color + text-align: right + background-color: $highlight-gutter.bg-color + } + + .code pre { + width: 100% + padding-left: 10px + padding-right: 10px + background-color: $highlight-background + } + + .line { height: 20px; } +} + +.gutter { + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +.gist table { + width: auto; + + td { border: none; } +} + +// For diff highlight +pre .deletion { background: $highlight-deletion; } +pre .addition { background: $highlight-addition; } +pre .meta { color: $highlight-purple; } + +pre { + + .comment { color: $highlight-comment; } + + .variable + .attribute + .tag + .name + .regexp + .ruby .constant + .xml .tag .title + .xml .pi + .xml .doctype + .html .doctype + .css .id + .css .class + .css .pseudo { + color: $highlight-red; + } + + .number + .preprocessor + .built_in + .builtin-name + .literal + .params + .constant + .command { + color: $highlight-orange; + } + + .ruby .class .title + .css .rules .attribute + .string + .symbol + .value + .inheritance + .header + .ruby .symbol + .xml .cdata + .special + .formula { + color: $highlight-green; + } + + .title + .css .hexcolor { + color: $highlight-aqua; + } + + .function + .python .decorator + .python .title + .ruby .function .title + .ruby .title .keyword + .perl .sub + .javascript .title + .coffeescript .title { + color: $highlight-blue; + } + + .keyword + .javascript .function { + color: $highlight-purple; + } +} diff --git a/doc/themes/next/source/css/_common/components/highlight/theme.styl b/doc/themes/next/source/css/_common/components/highlight/theme.styl new file mode 100644 index 00000000..ff1f4be0 --- /dev/null +++ b/doc/themes/next/source/css/_common/components/highlight/theme.styl @@ -0,0 +1,92 @@ +$highlight_theme = hexo-config("highlight_theme") + + +if $highlight_theme == "normal" + $highlight-background = #f7f7f7 + $highlight-current-line = #efefef + $highlight-selection = #d6d6d6 + $highlight-foreground = #4d4d4c + $highlight-comment = #8e908c + $highlight-red = #c82829 + $highlight-orange = #f5871f + $highlight-yellow = #eab700 + $highlight-green = #718c00 + $highlight-aqua = #3e999f + $highlight-blue = #4271ae + $highlight-purple = #8959a8 + $highlight-gutter = { + color: #869194, + bg-color: #eff2f3 + } + +if $highlight_theme == "night" + $highlight-background = #1d1f21 + $highlight-current-line = #282a2e + $highlight-selection = #373b41 + $highlight-foreground = #c5c8c6 + $highlight-comment = #969896 + $highlight-red = #cc6666 + $highlight-orange = #de935f + $highlight-yellow = #f0c674 + $highlight-green = #b5bd68 + $highlight-aqua = #8abeb7 + $highlight-blue = #81a2be + $highlight-purple = #b294bb + $highlight-gutter = { + color: lighten($highlight-background, 50%), + bg-color: darken($highlight-background, 100%) + } + +if $highlight_theme == "night eighties" + $highlight-background = #2d2d2d + $highlight-current-line = #393939 + $highlight-selection = #515151 + $highlight-foreground = #cccccc + $highlight-comment = #999999 + $highlight-red = #f2777a + $highlight-orange = #f99157 + $highlight-yellow = #ffcc66 + $highlight-green = #99cc99 + $highlight-aqua = #66cccc + $highlight-blue = #6699cc + $highlight-purple = #cc99cc + $highlight-gutter = { + color: $highlight-comment, + bg-color: darken($highlight-background, 40%) + } + +if $highlight_theme == "night blue" + $highlight-background = #002451 + $highlight-current-line = #00346e + $highlight-selection = #003f8e + $highlight-foreground = #ffffff + $highlight-comment = #7285b7 + $highlight-red = #ff9da4 + $highlight-orange = #ffc58f + $highlight-yellow = #ffeead + $highlight-green = #d1f1a9 + $highlight-aqua = #99ffff + $highlight-blue = #bbdaff + $highlight-purple = #ebbbff + $highlight-gutter = { + color: $highlight-comment, + bg-color: darken($highlight-background, 60%) + } + +if $highlight_theme == "night bright" + $highlight-background = #000000 + $highlight-current-line = #2a2a2a + $highlight-selection = #424242 + $highlight-foreground = #eaeaea + $highlight-comment = #969896 + $highlight-red = #d54e53 + $highlight-orange = #e78c45 + $highlight-yellow = #e7c547 + $highlight-green = #b9ca4a + $highlight-aqua = #70c0b1 + $highlight-blue = #7aa6da + $highlight-purple = #c397d8 + $highlight-gutter = { + color: lighten($highlight-background, 40%), + bg-color: lighten($highlight-background, 16%) + } diff --git a/doc/themes/next/source/css/_common/components/pages/archive.styl b/doc/themes/next/source/css/_common/components/pages/archive.styl new file mode 100644 index 00000000..ee5e4b5f --- /dev/null +++ b/doc/themes/next/source/css/_common/components/pages/archive.styl @@ -0,0 +1,34 @@ +.page-archive { + + .archive-page-counter { + position: relative; + top: 3px; + left: 20px; + + +mobile() { + top: 5px; + } + } + + .posts-collapse { + + .archive-move-on { + position: absolute; + top: 11px; + left: 0; + margin-left: -6px; + width: 10px; + height: 10px; + opacity: 0.5; + background: $black-light; + border: 1px solid white; + + circle(); + } + } + + .fa-external-link { + font-size: 15px; + margin-left: 5px; + } +} diff --git a/doc/themes/next/source/css/_common/components/pages/breadcrumb.styl b/doc/themes/next/source/css/_common/components/pages/breadcrumb.styl new file mode 100644 index 00000000..4750de76 --- /dev/null +++ b/doc/themes/next/source/css/_common/components/pages/breadcrumb.styl @@ -0,0 +1,21 @@ +ul.breadcrumb { + list-style: none; + margin: 1em 0; + padding: 0 2em; + text-align: center; + font-size: $font-size-small + + & li { + display: inline; + } + + & li+li:before { + padding: 0.5em; + font-weight: normal; + content: "/\00a0"; + } + + & li+li:last-child { + font-weight: bold; + } +} diff --git a/doc/themes/next/source/css/_common/components/pages/categories.styl b/doc/themes/next/source/css/_common/components/pages/categories.styl new file mode 100644 index 00000000..db3bb10a --- /dev/null +++ b/doc/themes/next/source/css/_common/components/pages/categories.styl @@ -0,0 +1,27 @@ +.category-all-page { + .category-all-title { text-align: center; } + + .category-all { margin-top: 20px; } + + .category-list { + margin: 0; + padding: 0; + list-style: none; + } + + .category-list-item { margin: 5px 10px; } + + .category-list-count { + color: $grey; + &:before { + display: inline; + content: " (" + } + &:after { + display: inline; + content: ") " + } + } + + .category-list-child { padding-left: 10px; } +} diff --git a/doc/themes/next/source/css/_common/components/pages/pages.styl b/doc/themes/next/source/css/_common/components/pages/pages.styl new file mode 100644 index 00000000..4fba2544 --- /dev/null +++ b/doc/themes/next/source/css/_common/components/pages/pages.styl @@ -0,0 +1,8 @@ +// Page specific styles + +@import "archive"; +@import "categories"; +@import "schedule"; +@import "post-detail"; +@import "breadcrumb"; +@import "tag-cloud"; diff --git a/doc/themes/next/source/css/_common/components/pages/post-detail.styl b/doc/themes/next/source/css/_common/components/pages/post-detail.styl new file mode 100644 index 00000000..3f26afdb --- /dev/null +++ b/doc/themes/next/source/css/_common/components/pages/post-detail.styl @@ -0,0 +1,6 @@ +.page-post-detail { + + .sidebar-toggle-line { background: $sidebar-highlight; } + + .comments { overflow: hidden; } +} diff --git a/doc/themes/next/source/css/_common/components/pages/schedule.styl b/doc/themes/next/source/css/_common/components/pages/schedule.styl new file mode 100644 index 00000000..863d98c8 --- /dev/null +++ b/doc/themes/next/source/css/_common/components/pages/schedule.styl @@ -0,0 +1,114 @@ +@keyframes dot-flash { + from { opacity: 1; transform: scale(1.1); } + to { opacity: 0; transform: scale(1); } +} + +#event-list { + padding-left: 30px; + hr { + margin: 20px 0 45px 0 !important; + background: #222; + &:after { + display: inline-block; + content: 'NOW'; + background: #222; + color: #FFF; + font-weight: bold; + text-align: right; + padding: 0 5px; + } + } + li.event { + margin: 20px 0px; + background: #F9F9F9; + padding-left: 10px; + min-height: 40px; + h2.event-summary { + margin: 0; + padding-bottom: 3px; + &:before { + display: inline-block; + font-family: FontAwesome; + font-size: 8px; + content: '\f111'; + vertical-align: middle; + margin-right: 25px; + color: #bbb; + } + } + span.event-relative-time { + display: inline-block; + font-size: 12px; + font-weight: 400; + padding-left: 12px; + color: #bbb; + } + span.event-details { + show(); + color: #bbb; + margin-left: 56px; + padding-top: 3px; + padding-bottom: 6px; + text-indent: -24px; + line-height: 18px; + &:before { + text-indent: 0; + display: inline-block; + width: 14px; + font-family: FontAwesome; + text-align: center; + margin-right: 9px; + color: #bbb; + } + &.event-location:before { + content: '\f041'; + } + &.event-duration:before { + content: '\f017'; + } + } + } + li.event-past { + background: #FCFCFC; + padding: 15px 0 15px 10px; + & > * { + opacity: .9; + } + h2.event-summary { + color: #bbb; + &:before { + color: #DFDFDF; + } + } + } + li.event-now { + background: #222; + color: #FFF; + padding: 15px 0 15px 10px; + h2.event-summary { + &:before { + transform: scale(1.2); + color: #FFF; + animation: dot-flash 1s alternate infinite ease-in-out; + } + } + * { + color: #FFF !important; + } + } + li.event-future { + background: #222; + color: #FFF; + padding: 15px 0 15px 10px; + h2.event-summary { + &:before { + transform: scale(1.2); + color: #FFF; + animation: dot-flash 1s alternate infinite ease-in-out; + } + } + * { + color: #FFF !important; + } + } +} diff --git a/doc/themes/next/source/css/_common/components/pages/tag-cloud.styl b/doc/themes/next/source/css/_common/components/pages/tag-cloud.styl new file mode 100644 index 00000000..fc65edab --- /dev/null +++ b/doc/themes/next/source/css/_common/components/pages/tag-cloud.styl @@ -0,0 +1,12 @@ +.tag-cloud { + text-align: center; + + a { + display: inline-block; + margin: 10px; + } + + a:hover { + color: $link-hover-color !important; + } +} diff --git a/doc/themes/next/source/css/_common/components/pagination.styl b/doc/themes/next/source/css/_common/components/pagination.styl new file mode 100644 index 00000000..22972b3c --- /dev/null +++ b/doc/themes/next/source/css/_common/components/pagination.styl @@ -0,0 +1,57 @@ +.pagination { + margin: 120px 0 40px; + text-align: center; + border-top: 1px solid $pagination-border; +} + +.page-number-basic { + display: inline-block; + position: relative; + top: -1px; + margin: 0 10px; + padding: 0 11px; + + +mobile() { margin: 0 5px; } +} + +.pagination { + .prev, .next, .page-number { + @extend .page-number-basic; + border-bottom: 0; + border-top: 1px solid $pagination-link-border; + transition-property: border-color; + the-transition(); + + &:hover { border-top-color: $pagination-link-hover-border; } + } + + .space { + @extend .page-number-basic; + padding: 0; + margin: 0; + } + + .prev { margin-left: 0; } + .next { margin-right: 0; } + + .page-number.current { + color: $pagination-active-color; + background: $pagination-active-bg; + border-top-color: $pagination-active-border; + } +} + ++mobile() { + .pagination { border-top: none; } + + .pagination { + .prev, .next, .page-number { + margin-bottom: 10px; + border-top: 0; + border-bottom: 1px solid $pagination-link-border; + padding: 0 10px; + + &:hover { border-bottom-color: $pagination-link-hover-border; } + } + } +} diff --git a/doc/themes/next/source/css/_common/components/post/post-button.styl b/doc/themes/next/source/css/_common/components/post/post-button.styl new file mode 100644 index 00000000..fd0809f8 --- /dev/null +++ b/doc/themes/next/source/css/_common/components/post/post-button.styl @@ -0,0 +1,3 @@ +.post-button { + margin-top: 40px; +} diff --git a/doc/themes/next/source/css/_common/components/post/post-collapse.styl b/doc/themes/next/source/css/_common/components/post/post-collapse.styl new file mode 100644 index 00000000..eaca91bf --- /dev/null +++ b/doc/themes/next/source/css/_common/components/post/post-collapse.styl @@ -0,0 +1,111 @@ +// TODO: Refactor. + ++mobile() { + .posts-collapse { + margin: 0 20px; + + .post-title, .post-meta { + show(); + width: auto; + text-align: left; + } + } +} + +.posts-collapse { + position: relative; + z-index: $zindex-1; + + &::after { + content: " "; + position: absolute; + top: 20px; + left: 0; + margin-left: -2px; + width: 4px; + height: 100%; + background: $whitesmoke; + z-index: $zindex-bottom; + } + + margin-left: $posts-collapse-left; + +mobile() { margin: 0 20px; } + + .collection-title { + position: relative; + margin: 60px 0; + + h1, h2 { margin-left: 20px; } + + small { color: $grey; margin-left: 5px; } + + &::before { + content: " "; + position: absolute; + left: 0; + top: 50%; + margin-left: -4px; + margin-top: -4px; + width: 8px; + height: 8px; + background: $grey; + circle(); + } + } + + .post { margin: 30px 0; } + + .post-header { + position: relative; + the-transition(); + transition-property: border; + border-bottom: 1px dashed $grey-light; + + &::before { + content: " "; + position: absolute; + left: 0; + top: 12px; + width: 6px; + height: 6px; + margin-left: -4px; + background: $grey; + circle(); + border: 1px solid white; + the-transition(); + transition-property: background; + } + } + + .post-header:hover { + border-bottom-color: $grey-dim; + + &::before { background: $black-deep; } + } + + .post-meta { + position: absolute; + font-size: 12px; + left: 20px; + top: 5px; + } + + .post-comments-count { display: none; } + + .post-title { + margin-left: 60px; + font-size: 16px; + font-weight: normal; + line-height: inherit; + + &::after { + margin-left: 3px; + opacity: 0.6; + } + + a, span.exturl { + color: $grey-dim; + border-bottom: none; + } + } +} diff --git a/doc/themes/next/source/css/_common/components/post/post-copyright.styl b/doc/themes/next/source/css/_common/components/post/post-copyright.styl new file mode 100644 index 00000000..717cc085 --- /dev/null +++ b/doc/themes/next/source/css/_common/components/post/post-copyright.styl @@ -0,0 +1,11 @@ +.post-copyright { + margin: $post-copyright.margin; + padding: $post-copyright.padding; + border-left: $post-copyright.border.width $post-copyright.border.style $post-copyright.border.color; + background-color: $post-copyright.bg; + list-style: none; + + i.fa { + font-size: 15px; + } +} diff --git a/doc/themes/next/source/css/_common/components/post/post-eof.styl b/doc/themes/next/source/css/_common/components/post/post-eof.styl new file mode 100644 index 00000000..d1e984ff --- /dev/null +++ b/doc/themes/next/source/css/_common/components/post/post-eof.styl @@ -0,0 +1,15 @@ +.posts-expand { + .post-eof { + margin: $post-eof-margin-top auto $post-eof-margin-bottom; + width: 8%; + height: 1px; + background: $grey-light; + text-align: center; + } +} + +.post:last-child { + .post-eof { + hide(); + } +} diff --git a/doc/themes/next/source/css/_common/components/post/post-expand.styl b/doc/themes/next/source/css/_common/components/post/post-expand.styl new file mode 100644 index 00000000..466571c7 --- /dev/null +++ b/doc/themes/next/source/css/_common/components/post/post-expand.styl @@ -0,0 +1,64 @@ +// TODO: Refactor. + +.posts-expand { + padding-top: 40px; +} + ++mobile() { + .posts-expand { + margin: 0 20px; + } + + .post-body { + pre { + .gutter pre { + padding-right: 10px; + } + } + + .highlight { + margin-left: 0px; + margin-right: 0px; + padding: 0; + .gutter pre { + padding-right: 10px; + } + } + } +} + +.posts-expand .post-body { + +desktop() { + text-align: unquote(hexo-config('text_align.desktop')); + } + +tablet-mobile() { + text-align: unquote(hexo-config('text_align.mobile')); + } + + h2, h3, h4, h5, h6 { + padding-top: 10px; + + .header-anchor { + float: right; + margin-left: 10px; + color: $grey-light; + border-bottom-style: none; + visibility: hidden; + + &:hover { + color: inherit; + } + } + + &:hover .header-anchor { + visibility: visible; + } + } + + img { + box-sizing: border-box; + margin: 0 auto 25px; + padding: 3px; + border: 1px solid $gray-lighter; + } +} diff --git a/doc/themes/next/source/css/_common/components/post/post-gallery.styl b/doc/themes/next/source/css/_common/components/post/post-gallery.styl new file mode 100644 index 00000000..9e4e8cc7 --- /dev/null +++ b/doc/themes/next/source/css/_common/components/post/post-gallery.styl @@ -0,0 +1,27 @@ +.post-gallery { + display: table; + table-layout: fixed; + width: 100%; + border-collapse: separate; +} + +.post-gallery-row { + display: table-row; +} + +.post-gallery .post-gallery-img { + display: table-cell; + text-align: center; + vertical-align: middle; + border: none; + + img { + max-width: 100%; + max-height: 100%; + border: none; + } +} + +.fancybox-close, .fancybox-close:hover { + border: none; +} diff --git a/doc/themes/next/source/css/_common/components/post/post-meta.styl b/doc/themes/next/source/css/_common/components/post/post-meta.styl new file mode 100644 index 00000000..e05e411a --- /dev/null +++ b/doc/themes/next/source/css/_common/components/post/post-meta.styl @@ -0,0 +1,51 @@ +.posts-expand .post-meta { + margin: 3px 0 60px 0; + color: $grey-dark; + font-family: $font-family-posts; + font-size: 12px; + text-align: center; + + .post-category-list { + display: inline-block; + margin: 0; + padding: 3px; + } + .post-category-list-link { color: $grey-dark; } + + .post-description { + font-size: 14px; + margin-top: 2px; + } + + time { + border-bottom: 1px dashed $grey-dark; + cursor: help; + } +} + +.post-symbolscount { + if !hexo-config('symbols_count_time.separated_meta') { display: inline-block; } +} + +.post-meta-divider { + margin: 0 .5em; +} + +.post-meta-item-icon { + margin-right: 3px; + +tablet() { + display: inline-block; + } + +mobile() { + display: inline-block; + } +} + +.post-meta-item-text { + +tablet() { + hide(); + } + +mobile() { + hide(); + } +} diff --git a/doc/themes/next/source/css/_common/components/post/post-nav.styl b/doc/themes/next/source/css/_common/components/post/post-nav.styl new file mode 100644 index 00000000..a69dd61d --- /dev/null +++ b/doc/themes/next/source/css/_common/components/post/post-nav.styl @@ -0,0 +1,51 @@ +.post-nav { + display: table; + margin-top: 15px; + width: 100%; + border-top: 1px solid $gainsboro; +} + +.post-nav-divider { + display: table-cell; + width: 10%; +} + +.post-nav-item { + display: table-cell; + padding: 10px 0 0 0; + width: 45%; + vertical-align: top; + + a { + position: relative; + show(); + line-height: 25px; + font-size: 14px; + color: $link-color; + border-bottom: none; + + &:hover { + color: $link-hover-color; + border-bottom: none; + } + + &:active { top: 2px; } + } + + .fa { + font-size: 12px; + margin-right: 5px; + } +} + +.post-nav-next { + a { padding-left: 5px; } +} + +.post-nav-prev { + text-align: right; + + a { padding-right: 5px; } + + .fa { margin-left: 5px; } +} diff --git a/doc/themes/next/source/css/_common/components/post/post-reading_progress.styl b/doc/themes/next/source/css/_common/components/post/post-reading_progress.styl new file mode 100644 index 00000000..52d6e398 --- /dev/null +++ b/doc/themes/next/source/css/_common/components/post/post-reading_progress.styl @@ -0,0 +1,10 @@ +.reading-progress-bar { + position: fixed; + top: 0; + left: 0; + z-index: 9999; + show(); + width: 0; + height: unquote(hexo-config('reading_progress.height')); + background: unquote(hexo-config('reading_progress.color')); +} diff --git a/doc/themes/next/source/css/_common/components/post/post-reward.styl b/doc/themes/next/source/css/_common/components/post/post-reward.styl new file mode 100644 index 00000000..bcdf8178 --- /dev/null +++ b/doc/themes/next/source/css/_common/components/post/post-reward.styl @@ -0,0 +1,64 @@ +#reward-container { + padding: 10px 0; + margin: 20px auto; + width: 90%; + text-align: center; +} + +#reward-button { + cursor: pointer; + border: 0; + outline: 0; + display: inline-block; + vertical-align: text-top; + margin: 0; + padding: 0 15px; + border-radius: 5px; + height: $font-size-large * 2; + line-height: $font-size-large * 2; + font-size: $font-size-large; + color: #fff; + background: #F44336; + letter-spacing: normal; + text-transform: none; + text-indent: 0px; + text-shadow: none; +} + +#reward-button span:hover { + background: #F7877F; +} + +#qr { + padding-top: 20px; + + a { + border: 0; + } + + img { + width: 180px; + max-width: 100%; + display: inline-block; + margin: 0.8em 2em 0 2em; + } + + p { + text-align: center; + } + + if hexo-config('reward_settings.animation') { + & > div:hover p { + animation: roll 0.1s infinite linear; + } + + @keyframes roll { + from { + transform: rotateZ(30deg); + } + to { + transform: rotateZ(-30deg); + } + } + } +} diff --git a/doc/themes/next/source/css/_common/components/post/post-rtl.styl b/doc/themes/next/source/css/_common/components/post/post-rtl.styl new file mode 100644 index 00000000..ea048b9f --- /dev/null +++ b/doc/themes/next/source/css/_common/components/post/post-rtl.styl @@ -0,0 +1,11 @@ +.rtl { + &.post-body { + p, a, h1, h2, h3, h4, h5, h6, li, ul, ol { + direction: rtl; + font-family: UKIJ Ekran; + } + } + &.post-title { + font-family: UKIJ Ekran; + } +} diff --git a/doc/themes/next/source/css/_common/components/post/post-tags.styl b/doc/themes/next/source/css/_common/components/post/post-tags.styl new file mode 100644 index 00000000..8c04ec7f --- /dev/null +++ b/doc/themes/next/source/css/_common/components/post/post-tags.styl @@ -0,0 +1,10 @@ +.posts-expand .post-tags { + margin-top: 40px; + text-align: center; + + a { + display: inline-block; + margin-right: 10px; + font-size: 13px; + } +} diff --git a/doc/themes/next/source/css/_common/components/post/post-title.styl b/doc/themes/next/source/css/_common/components/post/post-title.styl new file mode 100644 index 00000000..58409ac1 --- /dev/null +++ b/doc/themes/next/source/css/_common/components/post/post-title.styl @@ -0,0 +1,54 @@ +.posts-expand .post-title { + word-wrap(); + text-align: center; + font-weight: $posts-expand-title-font-weight; + + if hexo-config('post_edit.enable') { + .post-edit-link { + color: #bbb; + display: inline-block; + float: right; + border-bottom: none; + the-transition-ease-in(); + margin-left: -1.2em; + +mobile-small() { + margin-left: initial; + } + &:hover { + color: black; + } + } + } +} + +.posts-expand .post-title-link { + display: inline-block; + position: relative; + color: $black-light; + border-bottom: none; + line-height: 1.2; + vertical-align: top; + + &::before { + content: ""; + position: absolute; + width: 100%; + height: 2px; + bottom: 0; + left: 0; + background-color: #000; + visibility: hidden; + transform: scaleX(0); + the-transition(); + } + + &:hover::before { + visibility: visible; + transform: scaleX(1); + } + + .fa { + font-size: 20px; + margin-left: 5px; + } +} diff --git a/doc/themes/next/source/css/_common/components/post/post-type.styl b/doc/themes/next/source/css/_common/components/post/post-type.styl new file mode 100644 index 00000000..2542d4f2 --- /dev/null +++ b/doc/themes/next/source/css/_common/components/post/post-type.styl @@ -0,0 +1,14 @@ +// TODO: Refactor. + +.page-home, .page-post-detail { + .post-type-quote { + .post-header, + .post-tags { + hide(); + } + + blockquote { + @extend .blockquote-center + } + } +} diff --git a/doc/themes/next/source/css/_common/components/post/post-widgets.styl b/doc/themes/next/source/css/_common/components/post/post-widgets.styl new file mode 100644 index 00000000..f9eda656 --- /dev/null +++ b/doc/themes/next/source/css/_common/components/post/post-widgets.styl @@ -0,0 +1,50 @@ +.post-widgets { + border-top: 1px solid #eee; + padding-top: 9px; + margin-top: 45px; + display: flex; + justify-content: center; + flex-wrap: wrap; + align-items: center; + + .post-meta-divider { + height: 25px; + color: $grey-dark; + } +} + +.wp_rating { + height: 20px; + margin-right: 10px; + text-align: center; + line-height: 20px; + padding-top: 6px; +} + +.social-like { + font-size: 14px; + text-align: center; + display: flex; + justify-content: center; +} + +.vk_like { + width: 85px; + height: 21px; + padding-top: 7px; + align-self: center; +} + +.fb_like { + height: 30px; + align-self: center; +} + +.bdsharebuttonbox { + margin-top: 10px; + display: flex; + justify-content: center; + a { border: none; } +} + +.bdshare-slide-button-box a { border: none; } diff --git a/doc/themes/next/source/css/_common/components/post/post.styl b/doc/themes/next/source/css/_common/components/post/post.styl new file mode 100644 index 00000000..27e270e3 --- /dev/null +++ b/doc/themes/next/source/css/_common/components/post/post.styl @@ -0,0 +1,61 @@ +.post-body { + word-wrap(); + font-family: $font-family-posts; +} + +.post-body span.exturl { + .fa { + font-size: 14px; + margin-left: 4px; + } +} + +.post-body .fancybox img { + display: block !important; + margin: 0 auto; + cursor: pointer; + cursor: zoom-in; +} + +.post-body .image-caption, +.post-body .figure .caption { + margin: -20px auto 15px; + text-align: center; + font-size: $font-size-base; + color: $grey-dark; + font-weight: bold; + line-height: 1; +} + +.post-sticky-flag { + display: inline-block; + font-size: 16px; + transform: rotate(30deg); +} + +.use-motion { + if hexo-config('motion.transition.post_block') { + .post-block, + .pagination, + .comments { opacity: 0; } + } + if hexo-config('motion.transition.post_header') { .post-header { opacity: 0; } } + if hexo-config('motion.transition.post_body') { .post-body { opacity: 0; } } + if hexo-config('motion.transition.coll_header') { .collection-title { opacity: 0; } } +} + +@import "post-expand"; +@import "post-collapse"; +@import "post-type"; +@import "post-title"; +@import "post-meta"; +@import "post-button"; +@import "post-tags"; +@import "post-nav"; +@import "post-eof"; +@import "post-gallery"; +@import "post-reward" if hexo-config('reward_settings.enable'); +@import "post-copyright" if hexo-config('creative_commons.post'); +@import "post-widgets" if (hexo-config('facebook_sdk.enable') and hexo-config('facebook_sdk.like_button')) or (hexo-config('vkontakte_api.enable') and hexo-config('vkontakte_api.like')) or hexo-config('rating.enable') or hexo-config('likely.enable') or (hexo-config('needmoreshare2.enable') and hexo-config('needmoreshare2.postbottom.enable')) or hexo-config('baidushare'); +@import "post-rtl"; +@import "post-reading_progress" if hexo-config('reading_progress.enable'); diff --git a/doc/themes/next/source/css/_common/components/rainbow.styl b/doc/themes/next/source/css/_common/components/rainbow.styl new file mode 100644 index 00000000..db37e790 --- /dev/null +++ b/doc/themes/next/source/css/_common/components/rainbow.styl @@ -0,0 +1,43 @@ +body { + overscroll-behavior: none; +} +@media screen and (-webkit-min-device-pixel-ratio: 0) { + body:before { + right: 0; + top: 0; + left: 0; + height: 100px; + z-index: 2147483647; + position: fixed; + content: ""; + show(); + transform: translateY(-99.99px); + background: linear-gradient(124deg, + #FF0000, + #FF7F00, + #FFFF00, + #7FFF00, + #00FF00, + #00FF7F, + #00FFFF, + #007FFF, + #0000FF, + #7F00FF, + #FF00FF, + #FF007F, + #FF0000); + animation: rainbow 15s ease infinite; + background-size: 1000% 1000%; + } +} +@keyframes rainbow { + 0% { + background-position: 0% 80%; + } + 50% { + background-position: 100% 20%; + } + 100% { + background-position: 0% 80%; + } +} diff --git a/doc/themes/next/source/css/_common/components/scrollbar.styl b/doc/themes/next/source/css/_common/components/scrollbar.styl new file mode 100644 index 00000000..f172d7b8 --- /dev/null +++ b/doc/themes/next/source/css/_common/components/scrollbar.styl @@ -0,0 +1,31 @@ +// scrollbar +::-webkit-scrollbar { + width: 8px; + height: 8px; +} + +// track +::-webkit-scrollbar-track { + +} + +// Handle style +::-webkit-scrollbar-thumb { + border-radius: 10px; + background: rgba(0, 0, 0, 0.2); +} + +// inactive style +::-webkit-scrollbar-thumb:window-inactive { + background: rgba(0, 0, 0, 0.1); +} + +// hover style +::-webkit-scrollbar-thumb:hover{ + background-color: rgba(0, 0, 0, 0.3); +} + +// active style +::-webkit-scrollbar-thumb:active{ + background-color: rgba(0, 0, 0, 0.4); +} diff --git a/doc/themes/next/source/css/_common/components/sidebar/sidebar-author-links.styl b/doc/themes/next/source/css/_common/components/sidebar/sidebar-author-links.styl new file mode 100644 index 00000000..964afaa5 --- /dev/null +++ b/doc/themes/next/source/css/_common/components/sidebar/sidebar-author-links.styl @@ -0,0 +1,24 @@ +.links-of-author { + margin-top: 20px; + + a, span.exturl { + display: inline-block; + vertical-align: middle; + margin-right: 10px; + margin-bottom: 10px; + border-bottom-color: $black-light; + font-size: 13px; + if hexo-config('social_icons.transition') { the-transition(); } + + &:before { + display: inline-block; + vertical-align: middle; + margin-right: 3px; + content: " "; + width: 4px; + height: 4px; + circle(); + background: rgb(random-color(0, 255) - 50%, random-color(0, 255) - 50%, random-color(0, 255) - 50%); + } + } +} diff --git a/doc/themes/next/source/css/_common/components/sidebar/sidebar-author.styl b/doc/themes/next/source/css/_common/components/sidebar/sidebar-author.styl new file mode 100644 index 00000000..641330d5 --- /dev/null +++ b/doc/themes/next/source/css/_common/components/sidebar/sidebar-author.styl @@ -0,0 +1,39 @@ +.site-author-image { + show(); + margin: 0 auto; + padding: $site-author-image-padding; + max-width: $site-author-image-width; + height: $site-author-image-height; + border: $site-author-image-border-width solid $site-author-image-border-color; + opacity: hexo-config('avatar.opacity') is a 'unit' ? hexo-config('avatar.opacity') : 1; +} + +if hexo-config('avatar.rounded') { + .site-author-image { + border-radius: 100%; + } +} + +if hexo-config('avatar.rotated') { + .site-author-image { + transition: transform 1.0s ease-out; + } + + .site-author-image:hover { + transform: rotateZ(360deg); + } +} + +.site-author-name { + margin: $site-author-name-margin; + text-align: $site-author-name-align; + color: $site-author-name-color; + font-weight: $site-author-name-weight; +} + +.site-description { + margin-top: $site-description-margin-top; + text-align: $site-description-align; + font-size: $site-description-font-size; + color: $site-description-color; +} diff --git a/doc/themes/next/source/css/_common/components/sidebar/sidebar-blogroll.styl b/doc/themes/next/source/css/_common/components/sidebar/sidebar-blogroll.styl new file mode 100644 index 00000000..506f36cd --- /dev/null +++ b/doc/themes/next/source/css/_common/components/sidebar/sidebar-blogroll.styl @@ -0,0 +1,28 @@ +.links-of-blogroll { + margin-top: 10px; + font-size: 13px; +} + +.links-of-blogroll-title { + margin-top: 0; + font-size: 14px; + font-weight: $font-weight-bold; +} +.links-of-blogroll-list { + margin: 0; + padding: 0; + list-style: none; +} + +.links-of-blogroll-item { + padding: 2px 10px; + + a, span.exturl { + max-width: 280px; + box-sizing: border-box; + display: inline-block; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + } +} diff --git a/doc/themes/next/source/css/_common/components/sidebar/sidebar-button.styl b/doc/themes/next/source/css/_common/components/sidebar/sidebar-button.styl new file mode 100644 index 00000000..da85a555 --- /dev/null +++ b/doc/themes/next/source/css/_common/components/sidebar/sidebar-button.styl @@ -0,0 +1,23 @@ +.feed-link, .chat { + margin-top: 10px; + + a { + display: inline-block; + padding: 0 15px; + color: rgb(252, 100, 35); + border: 1px solid rgb(252, 100, 35) !important; + border-radius: 4px; + + i { + color: rgb(252, 100, 35); + font-size: 14px; + } + + &:hover { + color: white; + background: rgb(252, 100, 35); + + i { color: white; } + } + } +} diff --git a/doc/themes/next/source/css/_common/components/sidebar/sidebar-dimmer.styl b/doc/themes/next/source/css/_common/components/sidebar/sidebar-dimmer.styl new file mode 100644 index 00000000..b209bffc --- /dev/null +++ b/doc/themes/next/source/css/_common/components/sidebar/sidebar-dimmer.styl @@ -0,0 +1,18 @@ +.sidebar-active + #sidebar-dimmer { + +mobile() { + opacity: .7; + transition: opacity .5s; + } + transform: translateX(-100%); +} + +#sidebar-dimmer { + show(); + position: fixed; + top: 0; + left: 100%; + width: 100%; + height: 100%; + background: #000; + opacity: 0; +} diff --git a/doc/themes/next/source/css/_common/components/sidebar/sidebar-nav.styl b/doc/themes/next/source/css/_common/components/sidebar/sidebar-nav.styl new file mode 100644 index 00000000..cfdb0f19 --- /dev/null +++ b/doc/themes/next/source/css/_common/components/sidebar/sidebar-nav.styl @@ -0,0 +1,30 @@ +// Sidebar Navigation + +.sidebar-nav { + margin: 0 0 20px; + padding-left: 0; +} + +.sidebar-nav li { + display: inline-block; + cursor: pointer; + border-bottom: 1px solid transparent; + font-size: 14px; + color: $sidebar-nav-color; + + &:hover { color: $sidebar-nav-hover-color; } +} + +.page-post-detail .sidebar-nav-toc { padding: 0 5px; } + +.page-post-detail .sidebar-nav-overview { margin-left: 10px; } + +.sidebar-nav .sidebar-nav-active { + color: $sidebar-highlight; + border-bottom-color: $sidebar-highlight; + + &:hover { color: $sidebar-highlight; } +} + +.sidebar-panel { display: none; } +.sidebar-panel-active { display: block; } diff --git a/doc/themes/next/source/css/_common/components/sidebar/sidebar-toc.styl b/doc/themes/next/source/css/_common/components/sidebar/sidebar-toc.styl new file mode 100644 index 00000000..183d08ab --- /dev/null +++ b/doc/themes/next/source/css/_common/components/sidebar/sidebar-toc.styl @@ -0,0 +1,61 @@ +.post-toc-empty { + font-size: 14px; + color: $grey-dim; +} + +.post-toc-wrap { overflow: hidden; } + +.post-toc { overflow: auto; } + +.post-toc ol { + margin: 0; + padding: 0 2px 5px 10px; + text-align: left; + list-style: none; + font-size: 14px; + + & > ol { padding-left: 0; } + + a { + the-transition(); + transition-property: all; + color: $toc-link-color; + border-bottom-color: $toc-link-border-color; + + &:hover { + color: $toc-link-hover-color; + border-bottom-color: $toc-link-hover-border-color; + } + } +} + +.post-toc .nav-item { + overflow: hidden; + text-overflow: ellipsis; + //text-align: justify; + white-space: nowrap if !hexo-config('toc.wrap'); + line-height: 1.8; +} + +.post-toc .nav .nav-child { + display: hexo-config('toc.expand_all') ? block : none; +} + +.post-toc .nav .active > .nav-child { display: block; } + +.post-toc .nav .active-current > .nav-child { + show(); + & > .nav-item { display: block; } +} + +.post-toc .nav .active > a { + color: $toc-link-active-color; + border-bottom-color: $toc-link-active-border-color; +} + +.post-toc .nav .active-current > a { + color: $toc-link-active-current-color; + &:hover { + color: $toc-link-active-current-border-color; + } +} diff --git a/doc/themes/next/source/css/_common/components/sidebar/sidebar-toggle.styl b/doc/themes/next/source/css/_common/components/sidebar/sidebar-toggle.styl new file mode 100644 index 00000000..a0f3bcf4 --- /dev/null +++ b/doc/themes/next/source/css/_common/components/sidebar/sidebar-toggle.styl @@ -0,0 +1,31 @@ +.sidebar-toggle { + &:hover .sidebar-toggle-line { + background: $sidebar-highlight; + } + position: fixed; + right: $b2t-position-right; + bottom: 45px; + width: 14px; + height: 14px; + padding: 5px; + background: $black-deep; + line-height: 0; + z-index: $zindex-5; + cursor: pointer; + + +tablet-mobile() { + hexo-config('sidebar.onmobile') ? fixbutton() : hide(); + } +} + +.sidebar-toggle-line { + position: relative; + display: inline-block; + vertical-align: top; + height: 2px; + width: 100%; + background: white; + margin-top: 3px; + + &:first-child { margin-top: 0; } +} diff --git a/doc/themes/next/source/css/_common/components/sidebar/sidebar.styl b/doc/themes/next/source/css/_common/components/sidebar/sidebar.styl new file mode 100644 index 00000000..a74c4ced --- /dev/null +++ b/doc/themes/next/source/css/_common/components/sidebar/sidebar.styl @@ -0,0 +1,64 @@ +.sidebar { + position: fixed; + right: 0; + top: 0; + bottom: 0; + + width: 0; + z-index: $zindex-4; + box-shadow: inset 0 2px 6px black; + background: $black-deep; + + a, span.exturl { + color: $grey-dark; + border-bottom-color: $black-light; + &:hover { + color: $gainsboro; + border-bottom-color: $gainsboro; + } + } + + +tablet-mobile() { + hide() if not hexo-config('sidebar.onmobile'); + } +} + +.sidebar-inner { + position: relative; + padding: 20px 10px; + color: $grey-dark; + text-align: center; +} + +.site-overview-wrap { + overflow: hidden; +} + +.site-overview { + overflow-y: auto; + overflow-x: hidden; +} + +.cc-license { + margin-top: 10px; + text-align: center; + + .cc-opacity { + opacity: 0.7; + border-bottom: none; + + &:hover { opacity: 0.9; } + } + + img { display: inline-block; } +} + +@import "sidebar-toggle"; +@import "sidebar-author"; +@import "sidebar-author-links"; +@import "sidebar-button"; +@import "sidebar-blogroll"; +@import "sidebar-nav"; +@import "site-state" if hexo-config('site_state'); +@import "sidebar-toc" if hexo-config('toc.enable'); +@import "sidebar-dimmer" if hexo-config('sidebar.dimmer'); diff --git a/doc/themes/next/source/css/_common/components/sidebar/site-state.styl b/doc/themes/next/source/css/_common/components/sidebar/site-state.styl new file mode 100644 index 00000000..79481699 --- /dev/null +++ b/doc/themes/next/source/css/_common/components/sidebar/site-state.styl @@ -0,0 +1,31 @@ +.site-state { + display: flex; + justify-content: center; + overflow: hidden; + line-height: 1.4; + white-space: nowrap; + text-align: $site-state-align; + margin-top: 10px; +} + +.site-state-item { + padding: 0 15px; + border-left: 1px solid $site-state-item-border-color; + + &:first-child { border-left: none; } + + a { border-bottom: none; } +} + +.site-state-item-count { + show(); + text-align: center; + color: $site-state-item-count-color; + font-weight: $font-weight-bold; + font-size: $site-state-item-count-font-size; +} + +.site-state-item-name { + font-size: $site-state-item-name-font-size; + color: $site-state-item-name-color; +} diff --git a/doc/themes/next/source/css/_common/components/tags/blockquote-center.styl b/doc/themes/next/source/css/_common/components/tags/blockquote-center.styl new file mode 100644 index 00000000..2e29c3f8 --- /dev/null +++ b/doc/themes/next/source/css/_common/components/tags/blockquote-center.styl @@ -0,0 +1,33 @@ +// Blockquote with all children centered. +.blockquote-center { + position: relative; + margin: 40px 0; + padding: 0; + border-left: none; + text-align: center; + + &::before, &::after { + position: absolute; + content: ' '; + show(); + width: 100%; + height: 24px; + opacity: 0.2; + background-repeat: no-repeat; + background-position: 0 -6px; + background-size: 22px 22px; + } + &::before { + top: -20px; + background-image: url($center-quote-left); + border-top: 1px solid $grey-light; + } + &::after { + bottom: -20px; + background-image: url($center-quote-right); + border-bottom: 1px solid $grey-light; + background-position: 100% 8px; + } + + p, div { text-align: center; } +} diff --git a/doc/themes/next/source/css/_common/components/tags/full-image.styl b/doc/themes/next/source/css/_common/components/tags/full-image.styl new file mode 100644 index 00000000..e0e72ffa --- /dev/null +++ b/doc/themes/next/source/css/_common/components/tags/full-image.styl @@ -0,0 +1,6 @@ +.posts-expand .post-body img.full-image { + border: none; + //max-width: 100%; + //width: auto; + //margin: 20px auto 25px; +} diff --git a/doc/themes/next/source/css/_common/components/tags/group-pictures.styl b/doc/themes/next/source/css/_common/components/tags/group-pictures.styl new file mode 100644 index 00000000..ce1461dd --- /dev/null +++ b/doc/themes/next/source/css/_common/components/tags/group-pictures.styl @@ -0,0 +1,35 @@ +.post .post-body .group-picture { + img { + box-sizing: border-box; + padding: 0 3px; + border: none; + } +} + +.post .group-picture-row { + overflow: hidden; + margin-top: 6px; + &:first-child { margin-top: 0; } +} + +.post .group-picture-column { float: left; } + +.page-post-detail .post-body .group-picture-column { + float: none; + margin-top: 10px; + width: auto !important; + img { margin: 0 auto; } +} + +.page-archive { + .group-picture-container { overflow: hidden; } + .group-picture-row { + float: left; + &:first-child { margin-top: 6px; } + } + + .group-picture-column { + max-width: 150px; + max-height: 150px; + } +} diff --git a/doc/themes/next/source/css/_common/components/tags/label.styl b/doc/themes/next/source/css/_common/components/tags/label.styl new file mode 100644 index 00000000..4401dd35 --- /dev/null +++ b/doc/themes/next/source/css/_common/components/tags/label.styl @@ -0,0 +1,11 @@ +.post-body .label { + display: inline; + padding: 0 2px; + + &.default { background-color: $label-default; } + &.primary { background-color: $label-primary; } + &.info { background-color: $label-info; } + &.success { background-color: $label-success; } + &.warning { background-color: $label-warning; } + &.danger { background-color: $label-danger; } +} diff --git a/doc/themes/next/source/css/_common/components/tags/note.styl b/doc/themes/next/source/css/_common/components/tags/note.styl new file mode 100644 index 00000000..4bf0a1d7 --- /dev/null +++ b/doc/themes/next/source/css/_common/components/tags/note.styl @@ -0,0 +1,278 @@ +.post-body .note { + note_icons = hexo-config('note.icons'); + note_style = hexo-config('note.style'); + + position: relative; + padding: 15px; + margin-bottom: 20px; + + if note_style == 'simple' { + border: 1px solid $gainsboro; + border-left-width: 5px; + } + if note_style == 'modern' { + border: 1px solid transparent; + background-color: $whitesmoke; + } + if note_style == 'flat' { + border: initial; + border-left: 3px solid $gainsboro; + background-color: lighten($gainsboro, 65%); + } + border-radius: unit(hexo-config('note.border_radius'), px) if hexo-config('note.border_radius') is a 'unit'; + + h2, h3, h4, h5, h6 { + if note_icons { + margin-top: 3px; + } else { + margin-top: 0; + } + margin-bottom: 0; + border-bottom: initial; + padding-top: 0 !important; + } + + p, ul, ol, table, pre, blockquote { + &:first-child { + margin-top: 0; + } + &:last-child { + margin-bottom: 0; + } + } + + if note_icons { + &:not(.no-icon) { + padding-left: 45px; + &:before { + position: absolute; + font-family: $font-family-icons; + font-size: larger; + top: 13px; + left: 15px; + } + } + } + + &.default { + if note_style == 'flat' { + background-color: $note-default-bg; + } + if note_style == 'modern' { + background-color: $note-modern-default-bg; + border-color: $note-modern-default-border; + color: $note-modern-default-text; + a, span.exturl { + &:not(.btn) { + color: $note-modern-default-text; + border-bottom: 1px solid $note-modern-default-text; + &:hover { + color: $note-modern-default-hover; + border-bottom: 1px solid $note-modern-default-hover; + } + } + } + } + if not note_style == 'modern' { + border-left-color: $note-default-border; + h2, h3, h4, h5, h6 { + color: $note-default-text; + } + } + if note_icons { + &:not(.no-icon) { + &:before { + content: $note-default-icon; + if not note_style == 'modern' { + color: $note-default-text; + } + } + } + } + } + + &.primary { + if note_style == 'flat' { + background-color: $note-primary-bg; + } + if note_style == 'modern' { + background-color: $note-modern-primary-bg; + border-color: $note-modern-primary-border; + color: $note-modern-primary-text; + a, span.exturl { + &:not(.btn) { + color: $note-modern-primary-text; + border-bottom: 1px solid $note-modern-primary-text; + &:hover { + color: $note-modern-primary-hover; + border-bottom: 1px solid $note-modern-primary-hover; + } + } + } + } + if not note_style == 'modern' { + border-left-color: $note-primary-border; + h2, h3, h4, h5, h6 { + color: $note-primary-text; + } + } + if note_icons { + &:not(.no-icon) { + &:before { + content: $note-primary-icon; + if not note_style == 'modern' { + color : $note-primary-text; + } + } + } + } + } + + &.info { + if note_style == 'flat' { + background-color: $note-info-bg; + } + if note_style == 'modern' { + background-color: $note-modern-info-bg; + border-color: $note-modern-info-border; + color: $note-modern-info-text; + a, span.exturl { + &:not(.btn) { + color: $note-modern-info-text; + border-bottom: 1px solid $note-modern-info-text; + &:hover { + color: $note-modern-info-hover; + border-bottom: 1px solid $note-modern-info-hover; + } + } + } + } + if not note_style == 'modern' { + border-left-color: $note-info-border; + h2, h3, h4, h5, h6 { + color: $note-info-text; + } + } + if note_icons { + &:not(.no-icon) { + &:before { + content: $note-info-icon; + if not note_style == 'modern' { + color : $note-info-text; + } + } + } + } + } + + &.success { + if note_style == 'flat' { + background-color: $note-success-bg; + } + if note_style == 'modern' { + background-color: $note-modern-success-bg; + border-color: $note-modern-success-border; + color: $note-modern-success-text; + a, span.exturl { + &:not(.btn) { + color: $note-modern-success-text; + border-bottom: 1px solid $note-modern-success-text; + &:hover { + color: $note-modern-success-hover; + border-bottom: 1px solid $note-modern-success-hover; + } + } + } + } + if not note_style == 'modern' { + border-left-color: $note-success-border; + h2, h3, h4, h5, h6 { + color: $note-success-text; + } + } + if note_icons { + &:not(.no-icon) { + &:before { + content: $note-success-icon; + if not note_style == 'modern' { + color : $note-success-text; + } + } + } + } + } + + &.warning { + if note_style == 'flat' { + background-color: $note-warning-bg; + } + if note_style == 'modern' { + background-color: $note-modern-warning-bg; + border-color: $note-modern-warning-border; + color: $note-modern-warning-text; + a, span.exturl { + &:not(.btn) { + color: $note-modern-warning-text; + border-bottom: 1px solid $note-modern-warning-text; + &:hover { + color: $note-modern-warning-hover; + border-bottom: 1px solid $note-modern-warning-hover; + } + } + } + } + if not note_style == 'modern' { + border-left-color: $note-warning-border; + h2, h3, h4, h5, h6 { + color: $note-warning-text; + } + } + if note_icons { + &:not(.no-icon) { + &:before { + content: $note-warning-icon; + if not note_style == 'modern' { + color : $note-warning-text; + } + } + } + } + } + + &.danger { + if note_style == 'flat' { + background-color: $note-danger-bg; + } + if note_style == 'modern' { + background-color: $note-modern-danger-bg; + border-color: $note-modern-danger-border; + color: $note-modern-danger-text; + a, span.exturl { + &:not(.btn) { + color: $note-modern-danger-text; + border-bottom: 1px solid $note-modern-danger-text; + &:hover { + color: $note-modern-danger-hover; + border-bottom: 1px solid $note-modern-danger-hover; + } + } + } + } + if not note_style == 'modern' { + border-left-color: $note-danger-border; + h2, h3, h4, h5, h6 { + color: $note-danger-text; + } + } + if note_icons { + &:not(.no-icon) { + &:before { + content: $note-danger-icon; + if not note_style == 'modern' { + color : $note-danger-text; + } + } + } + } + } +} diff --git a/doc/themes/next/source/css/_common/components/tags/pdf.styl b/doc/themes/next/source/css/_common/components/tags/pdf.styl new file mode 100644 index 00000000..da1fe004 --- /dev/null +++ b/doc/themes/next/source/css/_common/components/tags/pdf.styl @@ -0,0 +1,6 @@ +.pdfobject-container { + position: relative; + overflow: auto; + width: 100%; + height: unquote(hexo-config('pdf.height')); +} diff --git a/doc/themes/next/source/css/_common/components/tags/tabs.styl b/doc/themes/next/source/css/_common/components/tags/tabs.styl new file mode 100644 index 00000000..506ddbbb --- /dev/null +++ b/doc/themes/next/source/css/_common/components/tags/tabs.styl @@ -0,0 +1,95 @@ +.post-body .tabs { + position: relative; + show(); + margin-bottom: 20px; + padding-top: 10px; + + // Read tabs border_radius from NexT config and set in "tbr px" to use it as string variable in this CSS section. + hexo-config('tabs.border_radius') is a 'unit' ? (tbr = unit(hexo-config('tabs.border_radius'), px)) : (tbr = 0) + + ul.nav-tabs { + margin: 0; + padding: 0; + display: flex; + margin-bottom: -1px; + + +mobile-smallest() { + show(); + margin-bottom: 5px; + } + + li.tab { + list-style-type: none !important; + margin: 0 .25em 0 0; + border-top: 3px solid transparent; + border-left: 1px solid transparent; + border-right: 1px solid transparent; + + +mobile-smallest() { + margin: initial; + border-top: 1px solid transparent; + border-left: 3px solid transparent; + border-right: 1px solid transparent; + border-bottom: 1px solid transparent; + } + + if tbr > 0 { + border-radius: tbr tbr 0 0; + +mobile-smallest() { border-radius: tbr; } + } + if hexo-config('tabs.transition.tabs') { the-transition-ease-out(); } + + & a { + outline: 0; + border-bottom: initial; + show(); + line-height: 1.8em; + padding: .25em .75em; + & i { width: (18em / 14); } + if hexo-config('tabs.transition.labels') { the-transition-ease-out(); } + } + + &.active { + border-top: 3px solid $orange; + border-left: 1px solid $table-border-color; + border-right: 1px solid $table-border-color; + background-color: #fff; + + +mobile-smallest() { + border-top: 1px solid $table-border-color; + border-left: 3px solid $orange; + border-right: 1px solid $table-border-color; + border-bottom: 1px solid $table-border-color; + } + + & a { + cursor: default; + color: $link-color; + } + } + } + } + + .tab-content { + background-color: #fff; + + .tab-pane { + border: 1px solid $table-border-color; + padding: 20px 20px 0 20px; + if tbr > 0 { border-radius: tbr; } + + &:not(.active) { + hide(); + } + &.active { + show(); + if tbr > 0 { + &:nth-of-type(1) { + border-radius: 0 tbr tbr tbr; + +mobile-smallest() { border-radius: tbr; } + } + } + } + } + } +} diff --git a/doc/themes/next/source/css/_common/components/tags/tags.styl b/doc/themes/next/source/css/_common/components/tags/tags.styl new file mode 100644 index 00000000..664b63e4 --- /dev/null +++ b/doc/themes/next/source/css/_common/components/tags/tags.styl @@ -0,0 +1,7 @@ +@import "full-image"; +@import "blockquote-center"; +@import "group-pictures"; +@import "label"; +@import "note" if not hexo-config('note.style') == 'disabled'; +@import "tabs" if hexo-config('tabs.enable'); +@import "pdf" if hexo-config('pdf.enable'); diff --git a/doc/themes/next/source/css/_common/components/third-party/algolia-search.styl b/doc/themes/next/source/css/_common/components/third-party/algolia-search.styl new file mode 100644 index 00000000..bb790ecb --- /dev/null +++ b/doc/themes/next/source/css/_common/components/third-party/algolia-search.styl @@ -0,0 +1,135 @@ +// fix bug using algolia search's CDN +.ais-search-box--magnifier svg { + display: none !important; +} +.ais-search-box--reset svg { + display: none !important; +} + +.algolia-pop-overlay + position: fixed + width: 100% + height: 100% + top: 0 + left: 0 + z-index: 2080 + background-color: rgba(0, 0, 0, 0.3) + +mobile() + hide(); + +.algolia-popup + overflow: hidden + padding: 0 + display: none + position: fixed + top: 10% + left: 50% + width: 700px + height: 80% + margin-left: -350px + background: #fff + color: #333 + z-index: 9999 + border-radius: 5px + +mobile() + padding: 0 + top: 0 + left: 0 + margin: 0 + width: 100% + height: 100% + border-radius: 0 + + .popup-btn-close + position: absolute + right: 14px + color: #4EBD79 + font-size: 14px + font-weight: bold + text-transform: uppercase + cursor: pointer + padding-left: 15px + border-left: 1px solid #eee + top: 10px + .fa + color: $grey-dark + font-size: 18px + &:hover .fa + color: $black-deep + +.algolia-search + padding: 10px 15px 5px + max-height: 50px + border-bottom: 1px solid #ccc + background: $whitesmoke + border-top-left-radius: 5px + border-top-right-radius: 5px + +.algolia-search-input-icon + display: inline-block + width: 20px + .fa + font-size: 18px + +.algolia-search-input + display: inline-block + width: calc(90% - 20px) + input + padding: 5px 0 + width: 100% + outline: none + border: none + background: transparent + +.algolia-powered + float: right + img + display: inline-block + height: 18px + vertical-align: middle + +.algolia-results + position: relative + overflow: auto + padding: 10px 30px + height: calc(100% - 50px) + + hr + margin: 10px 0 + + .highlight + font-style: normal + margin: 0 + padding: 0 2px + font-size: inherit + color: red + +.algolia-hits + margin-top: 20px + +.algolia-hit-item + margin: 15px 0 + +.algolia-hit-item-link + display: block + border-bottom: 1px dashed #ccc + the-transition() + +.algolia-pagination + .pagination + margin: 40px 0px + border-top: none + padding: 0 + opacity: 1 + .pagination-item + display: inline-block + .page-number + border-top: none + &:hover + border-bottom: 1px solid $black-deep + + .current .page-number + @extend .pagination .page-number.current + + .disabled-item + visibility: hidden diff --git a/doc/themes/next/source/css/_common/components/third-party/copy-code.styl b/doc/themes/next/source/css/_common/components/third-party/copy-code.styl new file mode 100644 index 00000000..a1aab622 --- /dev/null +++ b/doc/themes/next/source/css/_common/components/third-party/copy-code.styl @@ -0,0 +1,47 @@ +.copy-btn { + display: inline-block; + padding: 6px 12px; + font-size: 13px; + font-weight: 700; + line-height: 20px; + color: #333; + white-space: nowrap; + vertical-align: middle; + cursor: pointer; + if hexo-config('codeblock.copy_button.style') == 'flat' { + background-color: #fff; + border: none; + } + else { + background-color: #eee; + background-image: linear-gradient(#fcfcfc, #eee); + border: 1px solid #d5d5d5; + border-radius: 3px; + } + user-select: none; + outline: 0; +} + +.highlight-wrap .copy-btn { + transition: opacity .3s ease-in-out; + opacity: 0; + padding: 2px 6px; + position: absolute; + if hexo-config('codeblock.copy_button.style') == 'flat' { + right: 0px; + height: 42px; + } + else { + right: 4px; + top: 8px; + } +} + +.highlight-wrap:hover .copy-btn, +.highlight-wrap .copy-btn:focus { + opacity: 1; +} + +.highlight-wrap { + position: relative; +} diff --git a/doc/themes/next/source/css/_common/components/third-party/gitalk.styl b/doc/themes/next/source/css/_common/components/third-party/gitalk.styl new file mode 100644 index 00000000..fed02068 --- /dev/null +++ b/doc/themes/next/source/css/_common/components/third-party/gitalk.styl @@ -0,0 +1,4 @@ +.gt-header a, .gt-comments a, .gt-popup a + border-bottom: none; +.gt-container .gt-popup .gt-action.is--active:before + top: 0.7em; \ No newline at end of file diff --git a/doc/themes/next/source/css/_common/components/third-party/gitment.styl b/doc/themes/next/source/css/_common/components/third-party/gitment.styl new file mode 100644 index 00000000..c374f1a0 --- /dev/null +++ b/doc/themes/next/source/css/_common/components/third-party/gitment.styl @@ -0,0 +1,24 @@ +#gitment-display-button { + display: inline-block; + padding: 0 15px; + color: #0a9caf; + cursor: pointer; + font-size: 14px; + border: 1px solid #0a9caf; + border-radius: 4px; +} + +#gitment-display-button:hover { + color: #fff; + background: #0a9caf; +} + +#gitment-container a { + border-bottom: none; +} + +if hexo-config('gitment.cleanly') { + a.gitment-editor-footer-tip, .gitment-container.gitment-footer-container { + hide(); + } +} diff --git a/doc/themes/next/source/css/_common/components/third-party/han.styl b/doc/themes/next/source/css/_common/components/third-party/han.styl new file mode 100644 index 00000000..48d82e0f --- /dev/null +++ b/doc/themes/next/source/css/_common/components/third-party/han.styl @@ -0,0 +1,3 @@ +i.fa { + font-family: FontAwesome !important; +} diff --git a/doc/themes/next/source/css/_common/components/third-party/localsearch.styl b/doc/themes/next/source/css/_common/components/third-party/localsearch.styl new file mode 100644 index 00000000..a04b146e --- /dev/null +++ b/doc/themes/next/source/css/_common/components/third-party/localsearch.styl @@ -0,0 +1,101 @@ +.local-search-pop-overlay + position: fixed + width: 100% + height: 100% + top: 0 + left: 0 + z-index: 2080 + background-color: rgba(0, 0, 0, 0.3) + +.local-search-popup + display: none + position: fixed + top: 10% + left: 50% + margin-left: -350px + width: 700px + height: 80% + padding: 0 + background: #fff + color: #333 + z-index: 9999 + border-radius: 5px + +mobile() + padding: 0 + top: 0 + left: 0 + margin: 0 + width: 100% + height: 100% + border-radius: 0 + + ul.search-result-list + padding: 0 + margin: 0 5px + + p.search-result + border-bottom: 1px dashed #ccc + padding: 5px 0 + + a.search-result-title + font-weight: bold + font-size: 16px + + .search-keyword + border-bottom: 1px dashed #f00 + font-weight: bold + color: #f00 + + .local-search-header + padding: 5px + height: 36px + background: #f5f5f5 + border-top-left-radius: 5px + border-top-right-radius: 5px + + #local-search-result + overflow: auto + position: relative + padding: 5px 25px + height: calc(100% - 55px) + + .local-search-input-wrapper + display: inline-block + width: calc(100% - 90px) + height: 36px + line-height: 36px + padding: 0 5px + + .local-search-input-wrapper input + padding: 8px 0 + height: 20px + display: block + width: 100% + outline: none + border: none + background: transparent + vertical-align: middle + + .search-icon, .popup-btn-close + display: inline-block + font-size: 18px + color: #999 + height: 36px + width: 18px + padding-left: 10px + padding-right: 10px + + .search-icon + float: left + + .popup-btn-close + border-left: 1px solid #eee + float: right + cursor: pointer + + #no-result + position: absolute + left: 50% + top: 50% + transform: translate(-50%, -50%) + color: #ccc diff --git a/doc/themes/next/source/css/_common/components/third-party/math.styl b/doc/themes/next/source/css/_common/components/third-party/math.styl new file mode 100644 index 00000000..9babd4d2 --- /dev/null +++ b/doc/themes/next/source/css/_common/components/third-party/math.styl @@ -0,0 +1,4 @@ +.has-jax { + overflow-x: auto; + overflow-y: hidden; +} diff --git a/doc/themes/next/source/css/_common/components/third-party/needsharebutton.styl b/doc/themes/next/source/css/_common/components/third-party/needsharebutton.styl new file mode 100644 index 00000000..7f2f48c8 --- /dev/null +++ b/doc/themes/next/source/css/_common/components/third-party/needsharebutton.styl @@ -0,0 +1,27 @@ +#needsharebutton-postbottom { + position: relative; + cursor: pointer; + height: 26px; + + .btn { + display: initial; + padding: 1px 4px; + border: 1px solid $btn-default-border-color; + border-radius: 3px; + } +} + +#needsharebutton-float { + position: fixed; + bottom: 38px; + left: -8px; + z-index: 9999; + cursor: pointer; + + .btn { + //display: initial; + padding: 0 10px 0 14px; + border: 1px solid $btn-default-border-color; + border-radius: 4px; + } +} diff --git a/doc/themes/next/source/css/_common/components/third-party/related-posts.styl b/doc/themes/next/source/css/_common/components/third-party/related-posts.styl new file mode 100644 index 00000000..b3f962ae --- /dev/null +++ b/doc/themes/next/source/css/_common/components/third-party/related-posts.styl @@ -0,0 +1,22 @@ +.popular-posts-header { + margin-top: $post-eof-margin-bottom; + margin-bottom: 10px; + font-size: $font-size-headings-base; + border-bottom: 1px solid $gainsboro; + show(); +} + +ul.popular-posts { + padding: 0; + + .popular-posts-item { + // list-style: none; + margin-left: 2em; + .popular-posts-title { + font-weight: normal; + font-size: $font-size-base; + margin: 0; + line-height: $line-height-base * 1.2; + } + } +} diff --git a/doc/themes/next/source/css/_common/components/third-party/third-party.styl b/doc/themes/next/source/css/_common/components/third-party/third-party.styl new file mode 100644 index 00000000..b6cb71dc --- /dev/null +++ b/doc/themes/next/source/css/_common/components/third-party/third-party.styl @@ -0,0 +1,9 @@ +@import "gitment" if hexo-config('gitment.enable'); +@import "gitalk" if hexo-config('gitalk.enable'); +@import "han" if hexo-config('han'); +@import "localsearch"; +@import "algolia-search" if hexo-config('algolia_search.enable'); +@import "needsharebutton" if hexo-config('needmoreshare2.enable'); +@import "related-posts" if hexo-config('related_posts.enable'); +@import "copy-code" if hexo-config('codeblock.copy_button.enable'); +@import "math" if hexo-config('math.enable') and hexo-config('math.engine') == 'mathjax'; diff --git a/doc/themes/next/source/css/_common/outline/outline.styl b/doc/themes/next/source/css/_common/outline/outline.styl new file mode 100644 index 00000000..b0ac5f36 --- /dev/null +++ b/doc/themes/next/source/css/_common/outline/outline.styl @@ -0,0 +1,62 @@ +// +// Layout +// Note: Must name this file "outline" instead of "layout" +// Or Hexo will use it as template layout. +// ================================================= + + +html, body { height: 100%; } + +.container { + position: relative; +} + + +// Header Section +// -------------------------------------------------- +.header-inner { + margin: 0 auto; + padding: 100px 0 70px; + width: $content-desktop; + + +desktop-large() { + .container & { width: $content-desktop-large; } + } + +desktop-largest() { + .container & { width: $content-desktop-largest; } + } +} + + +// Main Section +// -------------------------------------------------- +.main-inner { + margin: 0 auto; + width: $content-desktop; + + +desktop-large() { + .container & { width: $content-desktop-large; } + } + +desktop-largest() { + .container & { width: $content-desktop-largest; } + } +} + + +// Footer Section +// -------------------------------------------------- +.footer { + padding: 20px 0; +} +.footer-inner { + box-sizing: border-box; + margin: 0px auto; + width: $content-desktop; + + +desktop-large() { + .container & { width: $content-desktop-large; } + } + +desktop-largest() { + .container & { width: $content-desktop-largest; } + } +} diff --git a/doc/themes/next/source/css/_common/scaffolding/base.styl b/doc/themes/next/source/css/_common/scaffolding/base.styl new file mode 100644 index 00000000..3d4164e6 --- /dev/null +++ b/doc/themes/next/source/css/_common/scaffolding/base.styl @@ -0,0 +1,120 @@ +::selection { + background: $selection-bg; + color: $selection-color; +} + +body { + position: relative; // Required by scrollspy + font-family: $font-family-base; + font-size: $font-size-base; + line-height: $line-height-base; + color: $text-color; + background: $body-bg-color; + + +tablet-mobile() { padding-right: 0 !important; } + +desktop-large() { font-size: $font-size-large; } +} + +h1, h2, h3, h4, h5, h6 { + margin: 20px 0 15px; + padding: 0; + font-weight: bold; + line-height: 1.5; + font-family: $font-family-headings; +} + +for headline in (1..6) { + h{headline} { + font-size: $font-size-headings-base - $font-size-headings-step * headline; + code { + font-size: 1em; + } + } + + +mobile() { + h{headline} { + font-size: $font-size-headings-base - $font-size-headings-step * headline - 4px; + code { + font-size: 1em; + } + } + } +} + +p { margin: 0 0 20px 0; } + +a, span.exturl { + word-wrap(); + // Remove the gray background color from active links in IE 10. + background-color: transparent; + color: $link-color; + text-decoration: none; + outline: none; + border-bottom: 1px solid $link-decoration-color; + + &:hover { + color: $link-hover-color; + border-bottom-color: $link-decoration-hover-color; + } + + // For spanned external links. + cursor: pointer; +} + +video { + max-width: 100%; + show(); + margin-left: auto; + margin-right: auto; +} + +img { + show(); + margin: auto; + max-width: 100%; + height: auto; +} + +hr { + margin: 40px 0; + height: 3px; + border: none; + background-color: $gray-lighter; + background-image: repeating-linear-gradient( + -45deg, + white, + white 4px, + transparent 4px, + transparent 8px + ); +} + +blockquote { + margin: 0; + padding: 0 15px; + color: $grey-dim; + border-left: 4px solid $gray-lighter; + + cite::before { + content: "-"; + padding: 0 5px; + } +} + +dt { font-weight: $font-weight-bolder; } + +dd { + margin: 0; + padding: 0; +} + +kbd { + border: 1px solid $grey-light; + border-radius: 0.2em; + box-shadow: 0.1em 0.1em 0.2em rgba(0, 0, 0, 0.1); + background-color: #f9f9f9; + font-family: inherit; + background-image: linear-gradient(top, #eee, white, #eee); + padding: 0.1em 0.3em; + white-space: nowrap; +} diff --git a/doc/themes/next/source/css/_common/scaffolding/helpers.styl b/doc/themes/next/source/css/_common/scaffolding/helpers.styl new file mode 100644 index 00000000..1ddb506c --- /dev/null +++ b/doc/themes/next/source/css/_common/scaffolding/helpers.styl @@ -0,0 +1,68 @@ +// +// Helpers +// ================================================= + + +// Alignment +.text-left { text-align: left; } +.text-center { text-align: center; } +.text-right { text-align: right; } +.text-justify { text-align: justify; } +.text-nowrap { white-space: nowrap; } + + +// Transformation +.text-lowercase { text-transform: lowercase; } +.text-uppercase { text-transform: uppercase; } +.text-capitalize { text-transform: capitalize; } + + +// Center-align a block level element. +.center-block { + show(); + margin-left: auto; + margin-right: auto; +} + + +// Clearfix. http://nicolasgallagher.com/micro-clearfix-hack/ +.clearfix { + clearfix(); +} + +.pullquote { + width: 45%; + + &.left { + float: left; + margin-left: 5px; + margin-right: 10px; + } + + &.right { + float: right; + margin-left: 10px; + margin-right: 5px; + } +} + +.affix { + position: fixed; +} + +.translation { + margin-top: -20px; + font-size: 14px; + color: $grey-dark; +} + +// https://davidwalsh.name/detect-scrollbar-width +.scrollbar-measure { + width: 100px; + height: 100px; + overflow: scroll; + position: absolute; + top: -9999px; +} + +.use-motion .motion-element { opacity: 0; } diff --git a/doc/themes/next/source/css/_common/scaffolding/mobile.styl b/doc/themes/next/source/css/_common/scaffolding/mobile.styl new file mode 100644 index 00000000..60cffe9b --- /dev/null +++ b/doc/themes/next/source/css/_common/scaffolding/mobile.styl @@ -0,0 +1,135 @@ +/* +// > 1600px ++desktop-large() { + +} + +// > 992px ++desktop() { + +} + +// > 768px & < 991px ++tablet() { + +} + +// < 767px ++mobile() { + +} +*/ + +// < 567px ++mobile-small() { + + // For Muse & Mist schemes only vertical economy. + .header-inner { + margin-bottom: initial !important; + } + .main-inner { + margin-top: initial !important; + } + + // For Pisces & Gemini schemes only wider width (remove main blocks in Gemini). + .content-wrap { + padding: initial !important; + } + + // For all schemes wider width. + .posts-expand { + padding-top: $content-mobile-padding !important; + // For Muse & Mist & Pisces schemes only wider width. + margin: initial !important; + + .post-header { + padding: 0 18px; + } + + .post-meta { + margin: 3px 0 10px 0 !important; + } + + } + + .post-block { + // Inside posts blocks content padding (default 40px). + padding: $content-mobile-padding 0 !important; + } + + .post-body { + // For headers narrow width. + h2, h3, h4, h5, h6 { + margin: 10px 18px 8px; + } + // Rewrite paddings & margins inside tags. + .note, .tabs .tab-content .tab-pane { + h2, h3, h4, h5, h6 { + margin: 0 5px; + } + } + + // For paragraphs narrow width. + > p { + margin: 0 0 10px 0; + padding: 0 18px; + } + + // For lists narrow width. + > ul, > li { + padding: 0 18px; + } + + // For blockquotes. + > blockquote { + margin: 0 18px; + } + + // For external links alignment. + > span.exturl { + margin-left: 18px; + } + + // Rewrite paddings & margins inside tags. + .note > p, .tabs .tab-content .tab-pane > p { + padding: 0 5px; + } + + .video-container .fluid-vids { + margin-bottom: 10px !important; + } + + .note { + padding: 10px !important; + margin-bottom: 10px !important; + + if hexo-config('note.icons') { + &:not(.no-icon) { + padding-left: 35px !important; + &:before { + top: 8px !important; + left: 12px !important; + } + } + } + } + + .tabs .tab-content .tab-pane { + padding: 10px 10px 0 10px !important; + } + } + + // Need to refactor into flex. + .post-nav { + padding-bottom: 2px; + //padding: 2px 8px; + } + +} + +/* +// < 413px ++mobile-smallest() { + +} +*/ diff --git a/doc/themes/next/source/css/_common/scaffolding/normalize.styl b/doc/themes/next/source/css/_common/scaffolding/normalize.styl new file mode 100644 index 00000000..192eb9ce --- /dev/null +++ b/doc/themes/next/source/css/_common/scaffolding/normalize.styl @@ -0,0 +1,349 @@ +/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */ + +/* Document + ========================================================================== */ + +/** + * 1. Correct the line height in all browsers. + * 2. Prevent adjustments of font size after orientation changes in iOS. + */ + +html { + line-height: 1.15; /* 1 */ + -webkit-text-size-adjust: 100%; /* 2 */ +} + +/* Sections + ========================================================================== */ + +/** + * Remove the margin in all browsers. + */ + +body { + margin: 0; +} + +/** + * Render the `main` element consistently in IE. + */ + +main { + display: block; +} + +/** + * Correct the font size and margin on `h1` elements within `section` and + * `article` contexts in Chrome, Firefox, and Safari. + */ + +h1 { + font-size: 2em; + margin: 0.67em 0; +} + +/* Grouping content + ========================================================================== */ + +/** + * 1. Add the correct box sizing in Firefox. + * 2. Show the overflow in Edge and IE. + */ + +hr { + box-sizing: content-box; /* 1 */ + height: 0; /* 1 */ + overflow: visible; /* 2 */ +} + +/** + * 1. Correct the inheritance and scaling of font size in all browsers. + * 2. Correct the odd `em` font sizing in all browsers. + */ + +pre { + font-family: monospace, monospace; /* 1 */ + font-size: 1em; /* 2 */ +} + +/* Text-level semantics + ========================================================================== */ + +/** + * Remove the gray background on active links in IE 10. + */ + +a { + background-color: transparent; +} + +/** + * 1. Remove the bottom border in Chrome 57- + * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari. + */ + +abbr[title] { + border-bottom: none; /* 1 */ + text-decoration: underline; /* 2 */ + text-decoration: underline dotted; /* 2 */ +} + +/** + * Add the correct font weight in Chrome, Edge, and Safari. + */ + +b, +strong { + font-weight: bolder; +} + +/** + * 1. Correct the inheritance and scaling of font size in all browsers. + * 2. Correct the odd `em` font sizing in all browsers. + */ + +code, +kbd, +samp { + font-family: monospace, monospace; /* 1 */ + font-size: 1em; /* 2 */ +} + +/** + * Add the correct font size in all browsers. + */ + +small { + font-size: 80%; +} + +/** + * Prevent `sub` and `sup` elements from affecting the line height in + * all browsers. + */ + +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sub { + bottom: -0.25em; +} + +sup { + top: -0.5em; +} + +/* Embedded content + ========================================================================== */ + +/** + * Remove the border on images inside links in IE 10. + */ + +img { + border-style: none; +} + +/* Forms + ========================================================================== */ + +/** + * 1. Change the font styles in all browsers. + * 2. Remove the margin in Firefox and Safari. + */ + +button, +input, +optgroup, +select, +textarea { + font-family: inherit; /* 1 */ + font-size: 100%; /* 1 */ + line-height: 1.15; /* 1 */ + margin: 0; /* 2 */ +} + +/** + * Show the overflow in IE. + * 1. Show the overflow in Edge. + */ + +button, +input { /* 1 */ + overflow: visible; +} + +/** + * Remove the inheritance of text transform in Edge, Firefox, and IE. + * 1. Remove the inheritance of text transform in Firefox. + */ + +button, +select { /* 1 */ + text-transform: none; +} + +/** + * Correct the inability to style clickable types in iOS and Safari. + */ + +button, +[type="button"], +[type="reset"], +[type="submit"] { + -webkit-appearance: button; +} + +/** + * Remove the inner border and padding in Firefox. + */ + +button::-moz-focus-inner, +[type="button"]::-moz-focus-inner, +[type="reset"]::-moz-focus-inner, +[type="submit"]::-moz-focus-inner { + border-style: none; + padding: 0; +} + +/** + * Restore the focus styles unset by the previous rule. + */ + +button:-moz-focusring, +[type="button"]:-moz-focusring, +[type="reset"]:-moz-focusring, +[type="submit"]:-moz-focusring { + outline: 1px dotted ButtonText; +} + +/** + * Correct the padding in Firefox. + */ + +fieldset { + padding: 0.35em 0.75em 0.625em; +} + +/** + * 1. Correct the text wrapping in Edge and IE. + * 2. Correct the color inheritance from `fieldset` elements in IE. + * 3. Remove the padding so developers are not caught out when they zero out + * `fieldset` elements in all browsers. + */ + +legend { + box-sizing: border-box; /* 1 */ + color: inherit; /* 2 */ + display: table; /* 1 */ + max-width: 100%; /* 1 */ + padding: 0; /* 3 */ + white-space: normal; /* 1 */ +} + +/** + * Add the correct vertical alignment in Chrome, Firefox, and Opera. + */ + +progress { + vertical-align: baseline; +} + +/** + * Remove the default vertical scrollbar in IE 10+. + */ + +textarea { + overflow: auto; +} + +/** + * 1. Add the correct box sizing in IE 10. + * 2. Remove the padding in IE 10. + */ + +[type="checkbox"], +[type="radio"] { + box-sizing: border-box; /* 1 */ + padding: 0; /* 2 */ +} + +/** + * Correct the cursor style of increment and decrement buttons in Chrome. + */ + +[type="number"]::-webkit-inner-spin-button, +[type="number"]::-webkit-outer-spin-button { + height: auto; +} + +/** + * 1. Correct the odd appearance in Chrome and Safari. + * 2. Correct the outline style in Safari. + */ + +[type="search"] { + -webkit-appearance: textfield; /* 1 */ + outline-offset: -2px; /* 2 */ +} + +/** + * Remove the inner padding in Chrome and Safari on macOS. + */ + +[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} + +/** + * 1. Correct the inability to style clickable types in iOS and Safari. + * 2. Change font properties to `inherit` in Safari. + */ + +::-webkit-file-upload-button { + -webkit-appearance: button; /* 1 */ + font: inherit; /* 2 */ +} + +/* Interactive + ========================================================================== */ + +/* + * Add the correct display in Edge, IE 10+, and Firefox. + */ + +details { + display: block; +} + +/* + * Add the correct display in all browsers. + */ + +summary { + display: list-item; +} + +/* Misc + ========================================================================== */ + +/** + * Add the correct display in IE 10+. + */ + +template { + display: none; +} + +/** + * Add the correct display in IE 10. + */ + +[hidden] { + display: none; +} diff --git a/doc/themes/next/source/css/_common/scaffolding/scaffolding.styl b/doc/themes/next/source/css/_common/scaffolding/scaffolding.styl new file mode 100644 index 00000000..b5d35002 --- /dev/null +++ b/doc/themes/next/source/css/_common/scaffolding/scaffolding.styl @@ -0,0 +1,9 @@ +// +// Scaffolding +// ================================================= + +@import "normalize"; +@import "base"; +@import "helpers"; +@import "tables"; +@import "mobile" if hexo-config('mobile_layout_economy'); diff --git a/doc/themes/next/source/css/_common/scaffolding/tables.styl b/doc/themes/next/source/css/_common/scaffolding/tables.styl new file mode 100644 index 00000000..a563abce --- /dev/null +++ b/doc/themes/next/source/css/_common/scaffolding/tables.styl @@ -0,0 +1,38 @@ +.table-container { + margin: 20px 0; + overflow: auto; + -webkit-overflow-scrolling: touch; +} + +table { + width: $table-width; + border-collapse: collapse; + border-spacing: 0; + font-size: $table-font-size; +} + +table > tbody > tr { + &:nth-of-type(odd) { background-color: $table-row-odd-bg-color; } + &:hover { background-color: $table-row-hover-bg-color; } +} + +caption, th, td { + padding: $table-cell-padding; + text-align: $table-content-alignment; + vertical-align: $table-content-vertical; + font-weight: normal; +} + +th, td { + border: 1px solid $table-border-color; + border-bottom: 3px solid $table-cell-border-bottom-color; +} + +th { + padding-bottom: 10px; + font-weight: $table-th-font-weight; +} + +td { + border-bottom-width: 1px; +} diff --git a/doc/themes/next/source/css/_custom/custom.styl b/doc/themes/next/source/css/_custom/custom.styl new file mode 100644 index 00000000..5a664b44 --- /dev/null +++ b/doc/themes/next/source/css/_custom/custom.styl @@ -0,0 +1,6 @@ +// Custom styles. +.posts-expand .post-body img { + margin: 3px; + display: inline; + padding: 3px !important; +} \ No newline at end of file diff --git a/doc/themes/next/source/css/_mixins/Gemini.styl b/doc/themes/next/source/css/_mixins/Gemini.styl new file mode 100644 index 00000000..eb4102ee --- /dev/null +++ b/doc/themes/next/source/css/_mixins/Gemini.styl @@ -0,0 +1 @@ +@import "Pisces.styl"; diff --git a/HandyControl/Properties/Langs/Lang.en.Designer.cs b/doc/themes/next/source/css/_mixins/Mist.styl similarity index 100% rename from HandyControl/Properties/Langs/Lang.en.Designer.cs rename to doc/themes/next/source/css/_mixins/Mist.styl diff --git a/HandyControlDemo/Properties/Langs/Lang.en.Designer.cs b/doc/themes/next/source/css/_mixins/Muse.styl similarity index 100% rename from HandyControlDemo/Properties/Langs/Lang.en.Designer.cs rename to doc/themes/next/source/css/_mixins/Muse.styl diff --git a/doc/themes/next/source/css/_mixins/Pisces.styl b/doc/themes/next/source/css/_mixins/Pisces.styl new file mode 100644 index 00000000..5ccc1db9 --- /dev/null +++ b/doc/themes/next/source/css/_mixins/Pisces.styl @@ -0,0 +1,16 @@ +sidebar-inline-links-item() { + margin: 5px 0 0; + if !hexo-config('social_icons.icons_only') { width: 50%; } + + & a, span.exturl { + max-width: 216px; + box-sizing: border-box; + display: inline-block; + margin-right: 0; + margin-bottom: 0; + padding: 0 5px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + } +} diff --git a/doc/themes/next/source/css/_mixins/base.styl b/doc/themes/next/source/css/_mixins/base.styl new file mode 100644 index 00000000..83087e5a --- /dev/null +++ b/doc/themes/next/source/css/_mixins/base.styl @@ -0,0 +1,110 @@ +the-transition() { + transition-duration: 0.2s; + transition-timing-function: ease-in-out; + transition-delay: 0s; +} + +the-transition-ease-in() { + transition-duration: 0.2s; + transition-timing-function: ease-in; + transition-delay: 0s; +} + +the-transition-ease-out() { + transition-duration: 0.2s; + transition-timing-function: ease-out; + transition-delay: 0s; +} + +mobile-smallest() { + @media (max-width: 413px) { + {block} + } +} + +mobile-small() { + @media (max-width: 567px) { + {block} + } +} + +mobile() { + @media (max-width: 767px) { + {block} + } +} + +tablet-mobile() { + @media (max-width: 991px) { + {block} + } +} + +tablet() { + @media (min-width: 768px) and (max-width: 991px) { + {block} + } +} + +desktop() { + @media (min-width: 992px) { + {block} + } +} + +desktop-large() { + @media (min-width: 1200px) { + {block} + } +} + +desktop-largest() { + @media (min-width: 1600px) { + {block} + } +} + +circle() { + border-radius: 50%; +} + +hide() { + display: none; +} + +show() { + display: block; +} + +fixbutton() { + right: 20px; + opacity: 0.8; +} + +random-color($min, $max) { + return floor(math(0, 'random') * ($max - $min + 1) + $min); +} + +// Clearfix. http://nicolasgallagher.com/micro-clearfix-hack/ +clearfix() { + &:before, + &:after { + content: " "; + display: table; + } + &:after { clear: both; } +} + +word-wrap() { + overflow-wrap: break-word; + word-wrap: break-word; +} + +disable-touch-hover() { + // To prevent hover on external links with touch devices after click. + @media (hover:none) { + &:hover { + background: none; + } + } +} diff --git a/doc/themes/next/source/css/_mixins/custom.styl b/doc/themes/next/source/css/_mixins/custom.styl new file mode 100644 index 00000000..e69de29b diff --git a/doc/themes/next/source/css/_schemes/Gemini/index.styl b/doc/themes/next/source/css/_schemes/Gemini/index.styl new file mode 100644 index 00000000..d27a35d9 --- /dev/null +++ b/doc/themes/next/source/css/_schemes/Gemini/index.styl @@ -0,0 +1,278 @@ +@import "../Pisces/_layout"; +@import "../Pisces/_brand"; +@import "../Pisces/_menu"; +@import "../Pisces/_sub-menu"; +@import "../Pisces/_sidebar"; + +// ================================================= +// Rewrite _layout.styl +// ================================================= +// Sidebar padding used as main desktop content padding for sidebar padding and post blocks padding too. + +// In `source/css/_variables/Pisces.styl` there are variable for main offset: +// $sidebar-offset = 12px; +// This value alse can be changed in main NexT config as `sidebar: offset: 12` option. + +// In `source/css/_variables/base.styl` there are variables for other resolutions: +// $content-tablet-padding = 10px; +// $content-mobile-padding = 8px; +// P.S. If u want to change this paddings u may set this variables into `source/css/_variables/custom.styl`. + +// So, it will 12px in Desktop, 10px in Tablets and 8px in Mobiles for all possible paddings. +// ================================================= +// Read values from NexT config and set they as local variables to use as string variables (in any CSS section). +use_seo = hexo-config('seo'); + +// ================================================= +// Desktop layout styles. +// ================================================= +// Post blocks. +.content-wrap { + padding: initial; + background: initial; + box-shadow: initial; + border-radius: initial; +} + +// Post & Comments blocks. +.post-block { + padding: $content-desktop-padding; + background: white; + box-shadow: $box-shadow-inner; + border-radius: $border-radius-inner; +} + +// When blocks are siblings (homepage). +#posts > article + article { + .post-block { + margin-top: $sidebar-offset; + // Rewrite shadows & borders because all blocks have offsets. + box-shadow: $box-shadow; + border-radius: $border-radius; + } +} + +// Comments blocks. +.comments { + padding: $content-desktop-padding; + margin: auto; + margin-top: $sidebar-offset; + background: white; + box-shadow: $box-shadow; + border-radius: $border-radius; +} + +// Top main padding from header to posts (default 40px). +.posts-expand { + padding-top: initial; +} + +// Post navigation items. +.post-nav-divider { + width: 4%; +} +.post-nav-item { + width: 48%; +} + +// Post delimiters. +.post-eof { + hide(); +} + +// Pagination. +.pagination { + .prev, .next, .page-number { + margin-bottom: initial; + top: initial; + } + margin: $sidebar-offset 0 0; + border-top: initial; + background: white; + box-shadow: $box-shadow; + border-radius: $border-radius; + padding: 10px 0 10px; +} + +// Footer alignment. +.main { + padding-bottom: initial; +} +.footer { + bottom: auto; +} + +// Sub-menu(s). +.sub-menu { + border-bottom: initial !important; + box-shadow: $box-shadow-inner; + // Adapt submenu(s) with post-blocks. + &+ #content > #posts { + .post-block { + box-shadow: $box-shadow; + margin-top: $sidebar-offset; + +tablet() { + margin-top: $content-tablet-padding; + } + +mobile() { + margin-top: $content-mobile-padding; + } + } + } +} + +// ================================================= +// Headers. +// ================================================= +// No need anymore? +.post-header { + h1, h2 { + margin: initial; + } +} +.posts-expand .post-title-link { + line-height: inherit; +} +.posts-expand .post-title { + font-size: 1.7em; +} +.post-body { + h1 { + font-size: 1.6em; + border-bottom: 1px solid $body-bg-color; + code { + font-size: 1em; + } + } + h2 { + font-size: 1.45em; + border-bottom: 1px solid $body-bg-color; + code { + font-size: 1em; + } + } + h3 { + font-size: 1.3em; + code { + font-size: 1em; + } + if use_seo { + border-bottom: 1px solid $body-bg-color; + } else { + border-bottom: 1px dotted $body-bg-color; + } + } + h4 { + font-size: 1.2em; + code { + font-size: 1em; + } + if use_seo { + border-bottom: 1px dotted $body-bg-color; + } + } + h5 { + font-size: 1.07em; + code { + font-size: 1em; + } + } + h6 { + font-size: 1.03em; + code { + font-size: 1em; + } + } +} + +// ================================================= +// > 768px & < 991px +// ================================================= ++tablet() { + + // Posts in blocks. + .content-wrap { + padding: $content-tablet-padding; + } + .posts-expand { + margin: initial; + + // Components inside Posts. + .post-button { + margin-top: ($content-tablet-padding * 2); + } + } + + .post-block { + // Inside posts blocks content padding (default 40px). + padding: ($content-tablet-padding * 2); + // Rewrite shadows & borders because all blocks have offsets. + box-shadow: $box-shadow; + border-radius: $border-radius; + } + + // Only if blocks are siblings need bottom margin (homepage). + #posts > article + article { + .post-block { + margin-top: $content-tablet-padding; + } + } + + .comments { + margin-top: $content-tablet-padding; + padding: $content-tablet-padding ($content-tablet-padding * 2); + //padding: initial; + //padding-top: $content-tablet-padding; + } + + .pagination { + margin: $content-tablet-padding 0 0; + } + +} +// ================================================= +// < 767px +// ================================================= ++mobile() { + + // Posts in blocks. + .content-wrap { + padding: $content-mobile-padding; + } + .posts-expand { + margin: initial; + + // Components inside Posts. + .post-button { + margin: $sidebar-offset 0px; + } + img { + padding: initial !important; + } + } + + .post-block { + // Inside posts blocks content padding (default 40px). + padding: $sidebar-offset; + min-height: auto; + // Rewrite shadows & borders because all blocks have offsets. + box-shadow: $box-shadow; + border-radius: $border-radius; + } + + // Only if blocks are siblings need bottom margin (homepage). + #posts > article + article { + .post-block { + margin-top: $content-mobile-padding; + } + } + + .comments { + margin-top: $content-mobile-padding; + padding: 0 $sidebar-offset; + } + + .pagination { + margin: $content-mobile-padding 0 0; + } +} diff --git a/doc/themes/next/source/css/_schemes/Mist/_base.styl b/doc/themes/next/source/css/_schemes/Mist/_base.styl new file mode 100644 index 00000000..cf2f438f --- /dev/null +++ b/doc/themes/next/source/css/_schemes/Mist/_base.styl @@ -0,0 +1,9 @@ +// Tags +// -------------------------------------------------- + +a { border-bottom-color: $grey-light; } + +hr { + margin: 20px 0; + height: 2px; +} diff --git a/doc/themes/next/source/css/_schemes/Mist/_header.styl b/doc/themes/next/source/css/_schemes/Mist/_header.styl new file mode 100644 index 00000000..60b86c15 --- /dev/null +++ b/doc/themes/next/source/css/_schemes/Mist/_header.styl @@ -0,0 +1,65 @@ +// Header +// -------------------------------------------------- +.header { background: $whitesmoke; } +.header-inner { + clearfix(); + padding: 20px 0; + display: flex; + align-items: center; + justify-content: center; + + +mobile() { + show(); + width: auto; + padding: 10px; + } +} + +.site-meta { + float: left; + margin-left: -20px; + line-height: normal; + + +mobile() { + margin-left: 10px; + } + + .brand { + padding: 2px 1px; + background: none; + + +mobile() { display: block; } + } + + .logo { display: none; } + + .site-title { + font-size: 22px; + font-weight: bolder; + + +mobile() { line-height: 34px; } + } +} + +.logo-line-before, +.logo-line-after { + show(); + overflow: hidden; + margin: 0 auto; + width: 75%; + + +mobile() { display: none; } + + i { + position: relative; + show(); + height: 2px; + background: $black-deep; + +mobile() { height: 3px; } + } +} + +.use-motion { + .logo-line-before i { left: -100%; } + .logo-line-after i { right: -100%; } +} diff --git a/doc/themes/next/source/css/_schemes/Mist/_logo.styl b/doc/themes/next/source/css/_schemes/Mist/_logo.styl new file mode 100644 index 00000000..571b4070 --- /dev/null +++ b/doc/themes/next/source/css/_schemes/Mist/_logo.styl @@ -0,0 +1 @@ +.site-subtitle { display: none; } diff --git a/doc/themes/next/source/css/_schemes/Mist/_menu.styl b/doc/themes/next/source/css/_schemes/Mist/_menu.styl new file mode 100644 index 00000000..325d6099 --- /dev/null +++ b/doc/themes/next/source/css/_schemes/Mist/_menu.styl @@ -0,0 +1,83 @@ +// Menu +// -------------------------------------------------- +.site-brand-wrapper { + flex-shrink: 0; +} + +.site-nav-toggle { + position: static; + float: right; +} + +.site-nav { + flex-grow: 1; + +mobile() { + transform: translateY(10px); + } +} + +.menu-item-active a { + background: #e1e1e1; +} + +.menu { + //float: right; + margin: 0; + + +mobile() { + margin: 10px 0; + padding: 0; + } + + br { display: none; } + + .menu-item { + margin: 0; + +mobile() { + show(); + margin-top: 5px; + } + + .badge { + display: inline-block; + padding: 1px 4px; + margin-left: 5px; + font-weight: 700; + line-height: 1; + color: $black-light; + text-align: center; + white-space: nowrap; + background-color: #fff; + border-radius: 10px; + text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.1); + +mobile() { + float: right; + margin: 0.35em 0 0 0; + } + } + + a, span.exturl { + padding: 0 10px; + border: none; + border-radius: 2px; + transition-property: background; + + +mobile() { + text-align: left; + } + + &:hover { + @extend .menu-item-active a; + } + + disable-touch-hover(); + } + } + + a::before { + hide(); + +mobile() { display: block; } + } + + +mobile() { float: none; } +} diff --git a/doc/themes/next/source/css/_schemes/Mist/_posts-expanded.styl b/doc/themes/next/source/css/_schemes/Mist/_posts-expanded.styl new file mode 100644 index 00000000..b29873c8 --- /dev/null +++ b/doc/themes/next/source/css/_schemes/Mist/_posts-expanded.styl @@ -0,0 +1,66 @@ +// Post Expanded +// -------------------------------------------------- +.posts-expand { + padding-top: 0; + + .post-title, + .post-meta { + text-align: $site-meta-text-align; + +mobile() { text-align: center; } + } + .post-eof { display: none; } + + .post { margin-top: 120px; } + .post:first-child { margin-top: 0; } + + .post-meta { + margin-top: 5px; + margin-bottom: 20px; + } + + .post-title { + position: relative; + font-size: $font-size-headings-base; + font-weight: 400; + +mobile() { font-size: $font-size-headings-small; } + +desktop-large() { font-size: $font-size-headings-large; } + } + .post-title:hover:before { background: $black-deep; } + + .post-body { + +mobile() { font-size: $font-size-base; } + } + + .post-body img { margin: 0; } + + .post-tags { + text-align: left; + a { + padding: 1px 5px; + background: $whitesmoke; + border-bottom: none; + } + a:hover { background: $grey-light; } + } + .post-nav { margin-top: 40px; } +} + +.post-button { + margin-top: 20px; + text-align: left; + + a { + padding: 0; + font-size: $font-size-base; + //color: $grey-dim; + background: none; + border: none; + border-bottom: 2px solid $grey-dim; + transition-property: border; + + +mobile() { font-size: $font-size-small; } + +desktop-large() { font-size: $font-size-large; } + + &:hover { border-bottom-color: $black-deep; } + } +} diff --git a/doc/themes/next/source/css/_schemes/Mist/_search.styl b/doc/themes/next/source/css/_schemes/Mist/_search.styl new file mode 100644 index 00000000..06d2460d --- /dev/null +++ b/doc/themes/next/source/css/_schemes/Mist/_search.styl @@ -0,0 +1,5 @@ +// Search +// -------------------------------------------------- +.site-search form { + hide(); +} diff --git a/doc/themes/next/source/css/_schemes/Mist/index.styl b/doc/themes/next/source/css/_schemes/Mist/index.styl new file mode 100644 index 00000000..9729c943 --- /dev/null +++ b/doc/themes/next/source/css/_schemes/Mist/index.styl @@ -0,0 +1,86 @@ +// +// Mist scheme +// ================================================= + +@import "_base"; +@import "outline/outline"; +@import "_header"; +@import "_logo"; +@import "_menu"; +@import "_search.styl"; +@import "_posts-expanded"; +@import "sidebar/sidebar-blogroll"; + +// Components +// -------------------------------------------------- +.btn { + padding: 0 10px; + border-width: 2px; + border-radius: 0; +} + +.headband { display: none; } + +// Search +// -------------------------------------------------- +.site-search { + position: relative; + float: right; + margin-top: 5px; + padding-top: 3px; + + +mobile() { + float: none; + padding: 0 10px; + } +} + +// Page - Container +// -------------------------------------------------- +.container .main-inner { + +mobile() { width: auto; } +} + +// Page - Post details +// -------------------------------------------------- +.page-post-detail { + .post-title, + .post-meta { text-align: center; } + + .post-title:before { display: none; } + + .post-meta { margin-bottom: 60px; } +} + +// Pagination +// -------------------------------------------------- +.pagination { + margin: 120px 0 0; + text-align: left; + + +mobile() { + margin: 80px 10px 0; + text-align: center; + } +} + +// Footer +// -------------------------------------------------- +.footer { + margin-top: 80px; + padding: 10px 0; + background: $whitesmoke; + color: $grey-dim; +} +.footer-inner { + margin: 0 auto; + text-align: left; + + +mobile() { + width: auto; + text-align: center; + } +} + +// Helpers +// -------------------------------------------------- diff --git a/doc/themes/next/source/css/_schemes/Mist/outline/outline.styl b/doc/themes/next/source/css/_schemes/Mist/outline/outline.styl new file mode 100644 index 00000000..12c0bae2 --- /dev/null +++ b/doc/themes/next/source/css/_schemes/Mist/outline/outline.styl @@ -0,0 +1 @@ +.main-inner { margin-top: 80px; } diff --git a/doc/themes/next/source/css/_schemes/Mist/sidebar/sidebar-blogroll.styl b/doc/themes/next/source/css/_schemes/Mist/sidebar/sidebar-blogroll.styl new file mode 100644 index 00000000..6db1ed79 --- /dev/null +++ b/doc/themes/next/source/css/_schemes/Mist/sidebar/sidebar-blogroll.styl @@ -0,0 +1 @@ +.links-of-blogroll-inline .links-of-blogroll-item { display: inline-block; } diff --git a/doc/themes/next/source/css/_schemes/Muse/_layout.styl b/doc/themes/next/source/css/_schemes/Muse/_layout.styl new file mode 100644 index 00000000..88b43376 --- /dev/null +++ b/doc/themes/next/source/css/_schemes/Muse/_layout.styl @@ -0,0 +1,9 @@ +.header-inner, .container .main-inner, .footer-inner { + +mobile() { width: auto; } +} + +// embed tag +embed { + show(); + margin: 0px auto 25px auto; +} diff --git a/doc/themes/next/source/css/_schemes/Muse/_logo.styl b/doc/themes/next/source/css/_schemes/Muse/_logo.styl new file mode 100644 index 00000000..789311a7 --- /dev/null +++ b/doc/themes/next/source/css/_schemes/Muse/_logo.styl @@ -0,0 +1,25 @@ +.custom-logo { + .site-meta-headline { + text-align: center; + } + + .brand { + background: none; + } + + .site-title { + margin: 10px auto 0; + font-size: 24px; + color: $black-deep; + a { + border: none; + } + } +} + +.custom-logo-image { + margin: 0 auto; + padding: 5px; + max-width: 150px; + background: white; +} diff --git a/doc/themes/next/source/css/_schemes/Muse/_menu.styl b/doc/themes/next/source/css/_schemes/Muse/_menu.styl new file mode 100644 index 00000000..bf20188c --- /dev/null +++ b/doc/themes/next/source/css/_schemes/Muse/_menu.styl @@ -0,0 +1,78 @@ +.site-nav { + +mobile() { + position: absolute; + left: 0; + top: 52px; + margin: 0; + width: 100%; + padding: 0; + background: white; + border-bottom: 1px solid $gray-lighter; + z-index: $zindex-3; + } +} + +.menu { + +mobile() { text-align: left; } +} + +.menu-item-active a { + border-bottom-color: $menu-link-hover-border !important; + color: $black-deep; + + +mobile() { + border-bottom: 1px dotted $gray-lighter !important; + } +} + +.menu .menu-item { + +mobile() { + show(); + margin: 0 10px; + vertical-align: top; + } + + .badge { + display: inline-block; + padding: 1px 4px; + margin-left: 5px; + font-weight: 700; + line-height: 1; + text-align: center; + white-space: nowrap; + background-color: $gainsboro; + +mobile() { + float: right; + margin: 0.35em 0 0 0; + } + } + + br { + +mobile() { display: none; } + } + + a, span.exturl { + +mobile() { + padding: 5px 10px; + } + + &:hover { + @extend .menu-item-active a; + } + + // To prevent hover on external links with touch devices after click. + @media (hover:none) { + &:hover { + border-bottom-color: transparent !important; + } + } + } + .fa { + +tablet() { + width: 100%; + } + +desktop() { + width: 100%; + } + } +} diff --git a/doc/themes/next/source/css/_schemes/Muse/_search.styl b/doc/themes/next/source/css/_schemes/Muse/_search.styl new file mode 100644 index 00000000..06d2460d --- /dev/null +++ b/doc/themes/next/source/css/_schemes/Muse/_search.styl @@ -0,0 +1,5 @@ +// Search +// -------------------------------------------------- +.site-search form { + hide(); +} diff --git a/doc/themes/next/source/css/_schemes/Muse/index.styl b/doc/themes/next/source/css/_schemes/Muse/index.styl new file mode 100644 index 00000000..35effe87 --- /dev/null +++ b/doc/themes/next/source/css/_schemes/Muse/index.styl @@ -0,0 +1,5 @@ +@import "_layout.styl"; +@import "_logo.styl"; +@import "_menu.styl"; +@import "_search.styl"; +@import "sidebar/sidebar-blogroll"; diff --git a/doc/themes/next/source/css/_schemes/Muse/sidebar/sidebar-blogroll.styl b/doc/themes/next/source/css/_schemes/Muse/sidebar/sidebar-blogroll.styl new file mode 100644 index 00000000..6db1ed79 --- /dev/null +++ b/doc/themes/next/source/css/_schemes/Muse/sidebar/sidebar-blogroll.styl @@ -0,0 +1 @@ +.links-of-blogroll-inline .links-of-blogroll-item { display: inline-block; } diff --git a/doc/themes/next/source/css/_schemes/Pisces/_brand.styl b/doc/themes/next/source/css/_schemes/Pisces/_brand.styl new file mode 100644 index 00000000..9fc3a1f6 --- /dev/null +++ b/doc/themes/next/source/css/_schemes/Pisces/_brand.styl @@ -0,0 +1,38 @@ +.site-brand-wrapper { + position: relative; +} + +.site-meta { + padding: 20px 0; + color: white; + background: $black-deep; + + +tablet-mobile() { + box-shadow: 0 0 16px rgba(0, 0, 0, 0.5); + } +} + +.brand { + padding: 0; + background: none; + + &:hover { + color: white; + } +} + +.site-subtitle { + margin: 10px 10px 0; + font-weight: initial; +} + +.custom-logo-image { + margin-top: 20px; + +tablet-mobile() { + hide(); + } +} + +.site-search form { + hide(); +} diff --git a/doc/themes/next/source/css/_schemes/Pisces/_layout.styl b/doc/themes/next/source/css/_schemes/Pisces/_layout.styl new file mode 100644 index 00000000..d887d5be --- /dev/null +++ b/doc/themes/next/source/css/_schemes/Pisces/_layout.styl @@ -0,0 +1,105 @@ +.header { + position: relative; + margin: 0 auto; + width: $content-desktop; + + +desktop-large() { + width: $content-desktop-large; + } + +desktop-largest() { + width: $content-desktop-largest; + } + +tablet-mobile() { + width: auto; + } +} + +.header-inner { + position: absolute; + top: 0; + overflow: hidden; + padding: 0; + width: $sidebar-desktop; + background: white; + box-shadow: $box-shadow-inner; + border-radius: $border-radius-inner; + + +desktop-large() { + .container & { width: $sidebar-desktop; } + } + +tablet-mobile() { + position: relative; + width: auto; + border-radius: initial; + } +} + +.main { + clearfix(); +} + +.container .main-inner { + + +tablet-mobile() { + width: auto; + } +} + +.content-wrap { + float: right; + box-sizing: border-box; + padding: $content-desktop-padding; + width: $content-wrap; + background: white; + min-height: 700px; + box-shadow: $box-shadow-inner; + border-radius: $border-radius-inner; + + +tablet() { + width: 100%; + padding: 20px; + border-radius: initial; + } + +mobile() { + width: 100%; + padding: 20px; + min-height: auto; + border-radius: initial; + } +} + +.sidebar { + position: static; + float: left; + margin-left: -100%; + width: $sidebar-desktop; + background: $body-bg-color; + box-shadow: none; + + +tablet-mobile() { + hide(); + } +} + +.sidebar-toggle { display: none; } + +.footer-inner { + padding-left: 260px; + + +tablet-mobile() { + width: auto; + padding-left: 0 !important; + padding-right: 0 !important; + } +} + +.sidebar-position-right { + .header-inner { right: 0; } + .content-wrap { float: left; } + .sidebar { float: right; } + + .footer-inner { + padding-left: 0; + padding-right: 260px; + } +} diff --git a/doc/themes/next/source/css/_schemes/Pisces/_menu.styl b/doc/themes/next/source/css/_schemes/Pisces/_menu.styl new file mode 100644 index 00000000..b8ca1c3f --- /dev/null +++ b/doc/themes/next/source/css/_schemes/Pisces/_menu.styl @@ -0,0 +1,87 @@ +.site-nav { + border-top: none; + + +tablet() { + display: none !important; + } +} + +.site-nav-on { + +tablet() { + display: block !important; + } +} + +.menu-item-active a { + background: #f9f9f9; + border-bottom-color: white; + + badges = hexo-config('menu_settings.badges'); + if not badges { + &:after { + content: " "; + position: absolute; + top: 50%; + margin-top: -3px; + right: 15px; + width: 6px; + height: 6px; + background-color: $grey; + circle(); + } + } +} + +.menu .menu-item { + show(); + margin: 0; + + a, span.exturl { + position: relative; + box-sizing: border-box; + padding: 5px 20px; + text-align: left; + line-height: inherit; + transition-property: background-color; + the-transition(); + + &:hover { + @extend .menu-item-active a; + } + + disable-touch-hover(); + } + + .badge { + display: inline-block; + padding: 2px 5px; + font-weight: 700; + line-height: 1; + color: #fff; + text-align: center; + white-space: nowrap; + vertical-align: middle; + background-color: $grey-light; + border-radius: 10px; + float: right; + margin: 0.35em 0 0 0; + text-shadow: 1px 1px 0px rgba(0,0,0,0.1); + } + + br { display: none; } +} + +.btn-bar { + background-color: white; +} + +.site-nav-toggle { + left: 20px; + top: 50%; + + transform: translateY(-50%); + + +tablet() { + show(); + } +} diff --git a/doc/themes/next/source/css/_schemes/Pisces/_sidebar.styl b/doc/themes/next/source/css/_schemes/Pisces/_sidebar.styl new file mode 100644 index 00000000..cd302212 --- /dev/null +++ b/doc/themes/next/source/css/_schemes/Pisces/_sidebar.styl @@ -0,0 +1,121 @@ +.use-motion .sidebar .motion-element { opacity: 1; } + +.sidebar { + right: auto; + bottom: auto; + + // Do NOT delete this line + // or Affix (position: fixed) will not work in Google Chrome. + -webkit-transform: none; + + a, span.exturl { + color: $black-light; + + &:hover { + color: $black-deep; + border-bottom-color: $black-deep; + } + } +} + +.sidebar-inner { + //padding: 20px 10px 0; + box-sizing: border-box; + width: $sidebar-desktop; + color: $text-color; + background: white; + box-shadow: $box-shadow; + border-radius: $border-radius; + if (hexo-config('motion.enable') and hexo-config('motion.transition.sidebar')) { opacity: 0; } + + &.affix { + position: fixed; + top: $sidebar-offset; + } + + &.affix-bottom { + position: absolute; + } +} + +.site-overview { + //margin: 0 2px; + text-align: left; +} + +.site-author { + clearfix(); +} + +.site-state-item { + padding: 0 10px; +} + +.feed-link, .chat { + border-top: 1px dotted $grey-light; + border-bottom: 1px dotted $grey-light; + text-align: center; + a { + show(); + color: $orange; + border: none !important; + + &:hover { + background: none; + color: darken($orange, 20%); + + i { color: darken($orange, 20%); } + } + } +} + +.links-of-author { + //clearfix(); + display: flex; + flex-wrap: wrap; + justify-content: center; + + span.exturl { + font-size: 13px; + } +} + +.links-of-author-item { + sidebar-inline-links-item(); + a:before, span.exturl:before { display: none; } + a, span.exturl { + border-bottom: none; + text-decoration: underline; + } + + a, span.exturl { + show(); + text-decoration: none; + + &:hover { + border-radius: 4px; + background: $gainsboro; + } + } + + .fa { + margin-right: 2px; + font-size: 16px; + } + .fa-globe { font-size: 15px; } +} + +.links-of-blogroll { + text-align: center; + padding: 3px 0 0; +} +.links-of-blogroll-item { padding: 0; } +.links-of-blogroll-inline { + clearfix(); + + .links-of-blogroll-item { + sidebar-inline-links-item(); + display: inline-block; + if !hexo-config('social_icons.icons_only') { width: unset; } + } +} diff --git a/doc/themes/next/source/css/_schemes/Pisces/_sub-menu.styl b/doc/themes/next/source/css/_schemes/Pisces/_sub-menu.styl new file mode 100644 index 00000000..795e7b1b --- /dev/null +++ b/doc/themes/next/source/css/_schemes/Pisces/_sub-menu.styl @@ -0,0 +1,38 @@ +.sub-menu { + margin: 0; + padding: 6px 0; + background: #fff !important; + border-bottom: 1px solid $table-border-color; +} + +.sub-menu .menu-item { + display: inline-block !important; + + & a, span.exturl { + padding: initial !important; + margin: 5px 10px; + } + + & a:hover, span.exturl:hover { + background: initial !important; + color: $sidebar-highlight; + } +} + +.sub-menu .menu-item-active a { + background: #fff !important; + color: $sidebar-highlight; + border-bottom-color: $sidebar-highlight; + + &:hover { + background: #fff !important; + border-bottom-color: $sidebar-highlight; + } + + badges = hexo-config('menu_settings.badges'); + if not badges { + &:after { + content: initial; + } + } +} diff --git a/doc/themes/next/source/css/_schemes/Pisces/index.styl b/doc/themes/next/source/css/_schemes/Pisces/index.styl new file mode 100644 index 00000000..75b63c3f --- /dev/null +++ b/doc/themes/next/source/css/_schemes/Pisces/index.styl @@ -0,0 +1,5 @@ +@import "_layout"; +@import "_brand"; +@import "_menu"; +@import "_sub-menu"; +@import "_sidebar"; diff --git a/doc/themes/next/source/css/_variables/Gemini.styl b/doc/themes/next/source/css/_variables/Gemini.styl new file mode 100644 index 00000000..0bfa6c88 --- /dev/null +++ b/doc/themes/next/source/css/_variables/Gemini.styl @@ -0,0 +1,21 @@ +// Variables of Gemini scheme +// ================================================= + +@import "Pisces.styl"; + +// Settings for some of the most global styles. +// -------------------------------------------------- +$body-bg-color = #eee + +// Borders. +// -------------------------------------------------- +$box-shadow-inner = 0 2px 2px 0 rgba(0,0,0,.12), 0 3px 1px -2px rgba(0,0,0,.06), 0 1px 5px 0 rgba(0,0,0,.12) +$box-shadow = 0 2px 2px 0 rgba(0,0,0,.12), 0 3px 1px -2px rgba(0,0,0,.06), 0 1px 5px 0 rgba(0,0,0,.12), 0 -1px .5px 0 rgba(0,0,0,.09) + +$border-radius-inner = initial +$border-radius = initial +//$border-radius-inner = 0 0 3px 3px; +//$border-radius = 3px; + +// Back to top +$b2t-sidebar-bg-color = $body-bg-color diff --git a/doc/themes/next/source/css/_variables/Mist.styl b/doc/themes/next/source/css/_variables/Mist.styl new file mode 100644 index 00000000..8ead36ee --- /dev/null +++ b/doc/themes/next/source/css/_variables/Mist.styl @@ -0,0 +1,13 @@ +// Variables of Mist scheme +// ================================================= + +$font-size-headings-base = 26px + +$brand-color = $black-deep +$brand-hover-color = $brand-color + +$site-meta-text-align = left +$posts-collapse-left = 0 + +$btn-default-color = $link-color +$btn-default-bg = transparent diff --git a/doc/themes/next/source/css/_variables/Muse.styl b/doc/themes/next/source/css/_variables/Muse.styl new file mode 100644 index 00000000..e69de29b diff --git a/doc/themes/next/source/css/_variables/Pisces.styl b/doc/themes/next/source/css/_variables/Pisces.styl new file mode 100644 index 00000000..9a4aa178 --- /dev/null +++ b/doc/themes/next/source/css/_variables/Pisces.styl @@ -0,0 +1,79 @@ +// Variables of Pisces scheme +// ================================================= + +// Settings for some of the most global styles. +// -------------------------------------------------- +$body-bg-color = #f5f7f9 + +$sidebar-width = hexo-config('sidebar.width') is a 'unit' ? hexo-config('sidebar.width') : 240 +$sidebar-desktop = unit($sidebar-width, 'px') +$content-wrap = 'calc(100% - %s)' % unit($sidebar-width + $sidebar-offset, 'px') + +$content-desktop = 'calc(100% - %s)' % unit($content-desktop-padding / 2, 'px') +$content-desktop-large = 1160px +$content-desktop-largest = 73% + + +// Borders +// -------------------------------------------------- +$box-shadow-inner = initial; +$box-shadow = initial; + +$border-radius-inner = initial; +$border-radius = initial; + + +// Header +// -------------------------------------------------- +$subtitle-color = $gray-lighter + +// Sidebar +// -------------------------------------------------- +$sidebar-nav-hover-color = $orange +$sidebar-highlight = $orange + +$site-author-image-width = 120px +$site-author-image-border-width = 1px +$site-author-image-border-color = $gainsboro + +$site-author-name-margin = 0 +$site-author-name-color = $black-deep +$site-author-name-align = center +$site-author-name-weight = $font-weight-bold + +$site-description-font-size = 13px +$site-description-color = $grey-dark +$site-description-margin-top = 0 +$site-description-align = center + +$site-state-item-count-font-size = 16px +$site-state-item-name-font-size = 13px +$site-state-item-name-color = $grey-dark +$site-state-item-border-color = $gainsboro + +$toc-link-color = $grey-dim +$toc-link-border-color = $grey-light +$toc-link-hover-color = black +$toc-link-hover-border-color = black +$toc-link-active-color = $sidebar-highlight +$toc-link-active-border-color = $sidebar-highlight +$toc-link-active-current-color = $sidebar-highlight +$toc-link-active-current-border-color = $sidebar-highlight + + +// Components +// -------------------------------------------------- + +// Button +$btn-default-radius = 2px +$btn-default-bg = white +$btn-default-color = $text-color +$btn-default-border-color = $text-color +$btn-default-hover-color = white +$btn-default-hover-bg = $black-deep + +// Back to top +$b2t-opacity = .6 +$b2t-position-bottom = -100px +$b2t-position-bottom-on = 30px +$b2t-sidebar-bg-color = $body-bg-color diff --git a/doc/themes/next/source/css/_variables/base.styl b/doc/themes/next/source/css/_variables/base.styl new file mode 100644 index 00000000..97172350 --- /dev/null +++ b/doc/themes/next/source/css/_variables/base.styl @@ -0,0 +1,383 @@ +// +// Variables +// ================================================= + + +// Colors +// colors for use across theme. +// -------------------------------------------------- +$whitesmoke = #f5f5f5 +$gainsboro = #eee +$gray-lighter = #ddd +$grey-light = #ccc +$grey = #bbb +$grey-dark = #999 +$grey-dim = #666 +$black-light = #555 +$black-dim = #333 +$black-deep = #222 +$red = #ff2a2a +$blue-bright = #87daff +$blue = #0684bd +$blue-deep = #262a30 +$orange = #fc6423 + + +// Scaffolding +// Settings for some of the most global styles. +// -------------------------------------------------- +// Global text color on +$text-color = $black-light + +// Global link color. +$link-color = $black-light +$link-hover-color = $black-deep +$link-decoration-color = $grey-dark +$link-decoration-hover-color = $black-deep + +// Global border color. +$border-color = $grey-light + +// Background color for +$body-bg-color = white + +// Selection +$selection-bg = $blue-deep +$selection-color = white + + +// Typography +// Font, line-height, and elements colors. +// -------------------------------------------------- +get_font_family(config) { + custom_family = hexo-config('font.' + config + '.family') + return custom_family is a 'string' ? custom_family : null +} + +// Font families. +$font-family-chinese = "PingFang SC", "Microsoft YaHei" + +$font-family-base = $font-family-chinese, sans-serif +$font-family-base = get_font_family('global'), $font-family-chinese, sans-serif if get_font_family('global') + +$font-family-logo = $font-family-base +$font-family-logo = get_font_family('logo'), $font-family-base if get_font_family('logo') + +$font-family-headings = $font-family-base +$font-family-headings = get_font_family('headings'), $font-family-base if get_font_family('headings') + +$font-family-posts = $font-family-base +$font-family-posts = get_font_family('posts'), $font-family-base if get_font_family('posts') + +$font-family-monospace = consolas, Menlo, $font-family-chinese, monospace +$font-family-monospace = get_font_family('codes'), consolas, Menlo, $font-family-chinese, monospace if get_font_family('codes') + +$font-family-icons = 'FontAwesome' + + +// Font Weight +$font-weight-lighter = 200 +$font-weight-light = 300 +$font-weight-normal = 400 +$font-weight-bold = 600 +$font-weight-bolder = 700 + + +// Font size +$font-size-base = 14px +$font-size-base = unit(hexo-config('font.global.size'), px) if hexo-config('font.global.size') is a 'unit' +$font-size-small = $font-size-base - 2px +$font-size-smaller = $font-size-base - 4px +$font-size-large = $font-size-base + 2px +$font-size-larger = $font-size-base + 4px + + +// Headings font size +$font-size-headings-step = 2px +$font-size-headings-base = 24px +$font-size-headings-base = unit(hexo-config('font.headings.size'), px) if hexo-config('font.headings.size') is a 'unit' +$font-size-headings-small = $font-size-headings-base - $font-size-headings-step +$font-size-headings-smaller = $font-size-headings-small - $font-size-headings-step +$font-size-headings-large = $font-size-headings-base + $font-size-headings-step +$font-size-headings-larger = $font-size-headings-large + $font-size-headings-step + +// Global line height +$line-height-base = 2 +$line-height-code-block = 1.6 // Can't be less than 1.3 + + +// Z-index master list +// -------------------------------------------------- +$zindex-bottom = -1 +$zindex-1 = 1010 +$zindex-2 = 1020 +$zindex-3 = 1030 +$zindex-4 = 1040 +$zindex-5 = 1050 + + +// Table +// -------------------------------------------------- +$table-width = 100% +$table-border-color = $gray-lighter +$table-font-size = 14px +$table-content-alignment = left +$table-content-vertical = middle +$table-th-font-weight = 700 +$table-cell-padding = 8px +$table-cell-border-right-color = $gainsboro +$table-cell-border-bottom-color = $gray-lighter +$table-row-odd-bg-color = #f9f9f9 +$table-row-hover-bg-color = $whitesmoke + + +// Code & Code Blocks +// -------------------------------------------------- +$code-font-family = $font-family-monospace +$code-font-size = 14px +$code-font-size = unit(hexo-config('font.codes.size'), px) if hexo-config('font.codes.size') is a 'unit' +$code-border-radius = 3px +$code-foreground = $black-light +$code-background = $gainsboro + + +// Buttons +// -------------------------------------------------- +$btn-font-weight = normal + +$btn-default-radius = 0 +$btn-default-bg = $black-deep +$btn-default-color = white +$btn-default-font-size = 14px +$btn-default-border-width = 2px +$btn-default-border-color = $black-deep +$btn-default-hover-bg = white +$btn-default-hover-color = $black-deep +$btn-default-hover-border-color = $black-deep + + +// Pagination +// -------------------------------------------------- +$pagination-border = $gainsboro + +$pagination-link-bg = transparent +$pagination-link-color = $link-color +$pagination-link-border = $gainsboro + +$pagination-link-hover-bg = transparent +$pagination-link-hover-color = $link-color +$pagination-link-hover-border = $black-deep + +$pagination-active-bg = $grey-light +$pagination-active-color = white +$pagination-active-border = $grey-light + + +// Layout sizes +// -------------------------------------------------- +$content-desktop = 700px +$content-desktop-large = 800px +$content-desktop-largest = 900px + +$content-desktop-padding = 40px +$content-tablet-padding = 10px +$content-mobile-padding = 8px + + +// Headband +// -------------------------------------------------- +$headband-height = 3px +$headband-bg = $black-deep + + +// Section Header +// Variables for header section elements. +// -------------------------------------------------- +$head-bg = transparent + +// Site Meta +$site-meta-text-align = center +$brand-color = white +$brand-hover-color = white +$brand-bg = $black-deep + +$logo-font-size = 20px +$logo-font-size = unit(hexo-config('font.logo.size'), px) if hexo-config('font.logo.size') is a 'unit' + +$site-subtitle-color = $grey-dark +$subtitle-font-size = 13px +$subtitle-color = $grey-dark + +// Menu +$menu-link-border = transparent +$menu-link-hover-border = $black-deep + + +// Posts Expand +// -------------------------------------------------- +$posts-expand-title-font-weight = $font-weight-normal +$post-copyright = { + margin: 2em 0 0, + padding: .5em 1em, + bg: #f9f9f9, + border: { + width: 3px, + style: solid, + color: #ff1700 + } +} + + +// Posts Collpase +// -------------------------------------------------- +$posts-collapse-left = 55px +$posts-collapse-left-mobile = 5px + + +// Sidebar +// Variables for sidebar section elements. +// -------------------------------------------------- +$sidebar-offset = unit(hexo-config('sidebar.offset'), px) if hexo-config('sidebar.offset') is a 'unit' +$sidebar-nav-color = $black-light +$sidebar-nav-hover-color = $whitesmoke +$sidebar-highlight = $blue-bright + +$site-author-image-padding = 2px +$site-author-image-width = 96px +$site-author-image-height = auto +$site-author-image-border-width = 2px +$site-author-image-border-color = $black-dim + +$site-author-name-margin = 5px 0 0 +$site-author-name-color = $whitesmoke +$site-author-name-align = center +$site-author-name-weight = normal + +$site-description-font-size = 14px +$site-description-color = $grey-dark +$site-description-margin-top = 5px +$site-description-align = center + +$site-state-align = center +$site-state-item-count-font-size = 18px +$site-state-item-count-color = inherit +$site-state-item-name-font-size = 13px +$site-state-item-name-color = inherit +$site-state-item-border-color = $black-dim + +$toc-link-color = $grey-dark +$toc-link-border-color = $black-light +$toc-link-hover-color = $grey-light +$toc-link-hover-border-color = $grey-light +$toc-link-active-color = $sidebar-highlight +$toc-link-active-border-color = $sidebar-highlight +$toc-link-active-current-color = $sidebar-highlight +$toc-link-active-current-border-color = $sidebar-highlight + + +// Components +// -------------------------------------------------- +// Back to top +$b2t-opacity = 1 +$b2t-position-bottom = -100px +$b2t-position-bottom-on = 19px +$b2t-position-right = 30px +$b2t-font-size = 12px +$b2t-color = white +$b2t-bg-color = $black-deep +$b2t-sidebar-bg-color = $black-deep + +// .post-expand .post-eof +// In Muse scheme, margin above and below the post separator +$post-eof-margin-top = 80px // or 160px for more white space +$post-eof-margin-bottom = 60px // or 120px for less white space + + +// Iconography +// Icons SVG Base64 +// -------------------------------------------------- +// blockquote-center icon +$center-quote-left = '../images/quote-l.svg' +$center-quote-right = '../images/quote-r.svg' + + +// Note colors +// -------------------------------------------------- +// Read note light_bg_offset from NexT config and set in "lbg%" to use it as string variable. +hexo-config('note.light_bg_offset') is a 'unit' ? (lbg = unit(hexo-config('note.light_bg_offset'),"%")) : (lbg = 0) + +// Default +$note-default-border = #777 +$note-default-bg = lighten(spin($note-default-border, 0), 94% + lbg) +$note-default-text = $note-default-border +$note-default-icon = "\f0a9" + +$note-modern-default-border = #e1e1e1 +$note-modern-default-bg = lighten(spin($note-modern-default-border, 10), 60% + (lbg * 4)) +$note-modern-default-text = $grey-dim +$note-modern-default-hover = darken(spin($note-modern-default-text, -10), 32%) + +// Primary +$note-primary-border = #6f42c1 +$note-primary-bg = lighten(spin($note-primary-border, 10), 92% + lbg) +$note-primary-text = $note-primary-border +$note-primary-icon = "\f055" + +$note-modern-primary-border = #e1c2ff +$note-modern-primary-bg = lighten(spin($note-modern-primary-border, 10), 40% + (lbg * 4)) +$note-modern-primary-text = #6f42c1 +$note-modern-primary-hover = darken(spin($note-modern-primary-text, -10), 22%) + +// Info +$note-info-border = #428bca +$note-info-bg = lighten(spin($note-info-border, -10), 91% + lbg) +$note-info-text = $note-info-border +$note-info-icon = "\f05a" + +$note-modern-info-border = #b3e5ef +$note-modern-info-bg = lighten(spin($note-modern-info-border, 10), 50% + (lbg * 4)) +$note-modern-info-text = #31708f +$note-modern-info-hover = darken(spin($note-modern-info-text, -10), 32%) + +// Success +$note-success-border = #5cb85c +$note-success-bg = lighten(spin($note-success-border, 10), 90% + lbg) +$note-success-text = $note-success-border +$note-success-icon = "\f058" + +$note-modern-success-border = #d0e6be +$note-modern-success-bg = lighten(spin($note-modern-success-border, 10), 40% + (lbg * 4)) +$note-modern-success-text = #3c763d +$note-modern-success-hover = darken(spin($note-modern-success-text, -10), 27%) + +// Warning +$note-warning-border = #f0ad4e +$note-warning-bg = lighten(spin($note-warning-border, 10), 88% + lbg) +$note-warning-text = $note-warning-border +$note-warning-icon = "\f06a" + +$note-modern-warning-border = #fae4cd +$note-modern-warning-bg = lighten(spin($note-modern-warning-border, 10), 43% + (lbg * 4)) +$note-modern-warning-text = #8a6d3b +$note-modern-warning-hover = darken(spin($note-modern-warning-text, -10), 18%) + +// Danger +$note-danger-border = #d9534f +$note-danger-bg = lighten(spin($note-danger-border, -10), 92% + lbg) +$note-danger-text = $note-danger-border +$note-danger-icon = "\f056" + +$note-modern-danger-border = #ebcdd2 +$note-modern-danger-bg = lighten(spin($note-modern-danger-border, 10), 35% + (lbg * 4)) +$note-modern-danger-text = #a94442 +$note-modern-danger-hover = darken(spin($note-modern-danger-text, -10), 22%) + + +// Label colors +// -------------------------------------------------- +$label-default = lighten(spin($note-default-border, 0), 89% + lbg) +$label-primary = lighten(spin($note-primary-border, 10), 87% + lbg) +$label-info = lighten(spin($note-info-border, -10), 86% + lbg) +$label-success = lighten(spin($note-success-border, 10), 85% + lbg) +$label-warning = lighten(spin($note-warning-border, 10), 83% + lbg) +$label-danger = lighten(spin($note-danger-border, -10), 87% + lbg) diff --git a/doc/themes/next/source/css/_variables/custom.styl b/doc/themes/next/source/css/_variables/custom.styl new file mode 100644 index 00000000..314652d4 --- /dev/null +++ b/doc/themes/next/source/css/_variables/custom.styl @@ -0,0 +1,2 @@ +$headband-height = 0px +$black-deep = #f06632 \ No newline at end of file diff --git a/doc/themes/next/source/css/main.styl b/doc/themes/next/source/css/main.styl new file mode 100644 index 00000000..b0fd7802 --- /dev/null +++ b/doc/themes/next/source/css/main.styl @@ -0,0 +1,46 @@ +// CSS Style Guide: http://codeguide.co/#css + + +$scheme = hexo-config('scheme') ? hexo-config('scheme') : 'Muse'; + +$custom_styles = hexo-config('custom_file_path.styles') ? "../../../../../" + hexo-config('custom_file_path.styles') : custom; +$custom_mixins = hexo-config('custom_file_path.mixins') ? "../../../../../" + hexo-config('custom_file_path.mixins') : custom; +$custom_variables = hexo-config('custom_file_path.variables') ? "../../../../../" + hexo-config('custom_file_path.variables') : custom; + +$variables = base $scheme $custom_variables; +$mixins = base $scheme $custom_mixins; + + +// Variables Layer +// -------------------------------------------------- +for $variable in $variables + @import "_variables/" + $variable; + + +// Mixins Layer +// -------------------------------------------------- +for $mixin in $mixins + @import "_mixins/" + $mixin; + + +// Common Layer +// -------------------------------------------------- + +// Scaffolding +@import "_common/scaffolding"; + +// Layout +@import "_common/outline"; + +// Components +@import "_common/components"; + + +// Schemes Layer +// -------------------------------------------------- +@import "_schemes/" + $scheme; + + +// Custom Layer +// -------------------------------------------------- +@import "_custom/" + $custom_styles; diff --git a/doc/themes/next/source/fonts/.gitkeep b/doc/themes/next/source/fonts/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/doc/themes/next/source/images/algolia_logo.svg b/doc/themes/next/source/images/algolia_logo.svg new file mode 100644 index 00000000..47024234 --- /dev/null +++ b/doc/themes/next/source/images/algolia_logo.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/doc/themes/next/source/images/apple-touch-icon-HandyOrg.png b/doc/themes/next/source/images/apple-touch-icon-HandyOrg.png new file mode 100644 index 00000000..efe93546 Binary files /dev/null and b/doc/themes/next/source/images/apple-touch-icon-HandyOrg.png differ diff --git a/doc/themes/next/source/images/avatar.gif b/doc/themes/next/source/images/avatar.gif new file mode 100644 index 00000000..98990257 Binary files /dev/null and b/doc/themes/next/source/images/avatar.gif differ diff --git a/doc/themes/next/source/images/cc-by-nc-nd.svg b/doc/themes/next/source/images/cc-by-nc-nd.svg new file mode 100644 index 00000000..79a4f2e0 --- /dev/null +++ b/doc/themes/next/source/images/cc-by-nc-nd.svg @@ -0,0 +1,121 @@ + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + diff --git a/doc/themes/next/source/images/cc-by-nc-sa.svg b/doc/themes/next/source/images/cc-by-nc-sa.svg new file mode 100644 index 00000000..bf6bc26f --- /dev/null +++ b/doc/themes/next/source/images/cc-by-nc-sa.svg @@ -0,0 +1,121 @@ + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + diff --git a/doc/themes/next/source/images/cc-by-nc.svg b/doc/themes/next/source/images/cc-by-nc.svg new file mode 100644 index 00000000..36973490 --- /dev/null +++ b/doc/themes/next/source/images/cc-by-nc.svg @@ -0,0 +1,121 @@ + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + diff --git a/doc/themes/next/source/images/cc-by-nd.svg b/doc/themes/next/source/images/cc-by-nd.svg new file mode 100644 index 00000000..934c61e1 --- /dev/null +++ b/doc/themes/next/source/images/cc-by-nd.svg @@ -0,0 +1,117 @@ + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + diff --git a/doc/themes/next/source/images/cc-by-sa.svg b/doc/themes/next/source/images/cc-by-sa.svg new file mode 100644 index 00000000..463276a8 --- /dev/null +++ b/doc/themes/next/source/images/cc-by-sa.svg @@ -0,0 +1,121 @@ + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + diff --git a/doc/themes/next/source/images/cc-by.svg b/doc/themes/next/source/images/cc-by.svg new file mode 100644 index 00000000..4bccd14f --- /dev/null +++ b/doc/themes/next/source/images/cc-by.svg @@ -0,0 +1,121 @@ + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + diff --git a/doc/themes/next/source/images/cc-zero.svg b/doc/themes/next/source/images/cc-zero.svg new file mode 100644 index 00000000..0f866392 --- /dev/null +++ b/doc/themes/next/source/images/cc-zero.svg @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/themes/next/source/images/favicon-16x16-HandyOrg.png b/doc/themes/next/source/images/favicon-16x16-HandyOrg.png new file mode 100644 index 00000000..beabd0e8 Binary files /dev/null and b/doc/themes/next/source/images/favicon-16x16-HandyOrg.png differ diff --git a/doc/themes/next/source/images/favicon-32x32-HandyOrg.png b/doc/themes/next/source/images/favicon-32x32-HandyOrg.png new file mode 100644 index 00000000..9a2b3614 Binary files /dev/null and b/doc/themes/next/source/images/favicon-32x32-HandyOrg.png differ diff --git a/doc/themes/next/source/images/loading.gif b/doc/themes/next/source/images/loading.gif new file mode 100644 index 00000000..efb6768d Binary files /dev/null and b/doc/themes/next/source/images/loading.gif differ diff --git a/doc/themes/next/source/images/logo.svg b/doc/themes/next/source/images/logo.svg new file mode 100644 index 00000000..ad0fa686 --- /dev/null +++ b/doc/themes/next/source/images/logo.svg @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/doc/themes/next/source/images/placeholder.gif b/doc/themes/next/source/images/placeholder.gif new file mode 100644 index 00000000..efb6768d Binary files /dev/null and b/doc/themes/next/source/images/placeholder.gif differ diff --git a/doc/themes/next/source/images/quote-l.svg b/doc/themes/next/source/images/quote-l.svg new file mode 100644 index 00000000..6dd94a4a --- /dev/null +++ b/doc/themes/next/source/images/quote-l.svg @@ -0,0 +1,13 @@ + + + + + + + + diff --git a/doc/themes/next/source/images/quote-r.svg b/doc/themes/next/source/images/quote-r.svg new file mode 100644 index 00000000..312b64d7 --- /dev/null +++ b/doc/themes/next/source/images/quote-r.svg @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/doc/themes/next/source/images/searchicon.png b/doc/themes/next/source/images/searchicon.png new file mode 100644 index 00000000..14a16cad Binary files /dev/null and b/doc/themes/next/source/images/searchicon.png differ diff --git a/doc/themes/next/source/js/affix.js b/doc/themes/next/source/js/affix.js new file mode 100644 index 00000000..240e43a7 --- /dev/null +++ b/doc/themes/next/source/js/affix.js @@ -0,0 +1,168 @@ +/* ======================================================================== + * Bootstrap: affix.js v3.3.5 + * http://getbootstrap.com/javascript/#affix + * ======================================================================== + * Copyright 2011-2015 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ + +/** + * Customized by Ivan.Nginx + * + * - Refactored with eslint-config-theme-next style. + */ + +(function($) { + 'use strict'; + + // AFFIX CLASS DEFINITION + // ====================== + + var Affix = function(element, options) { + this.options = $.extend({}, Affix.DEFAULTS, options); + + this.$target = $(this.options.target) + .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this)) + .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this)); + + this.$element = $(element); + this.affixed = null; + this.unpin = null; + this.pinnedOffset = null; + + this.checkPosition(); + }; + + Affix.VERSION = '3.3.5'; + + Affix.RESET = 'affix affix-top affix-bottom'; + + Affix.DEFAULTS = { + offset: 0, + target: window + }; + + Affix.prototype.getState = function(scrollHeight, height, offsetTop, offsetBottom) { + var scrollTop = this.$target.scrollTop(); + var position = this.$element.offset(); + var targetHeight = this.$target.height(); + + if (offsetTop != null && this.affixed === 'top') return scrollTop < offsetTop ? 'top' : false; + + if (this.affixed === 'bottom') { + if (offsetTop != null) return scrollTop + this.unpin <= position.top ? false : 'bottom'; + return scrollTop + targetHeight <= scrollHeight - offsetBottom ? false : 'bottom'; + } + + var initializing = this.affixed == null; + var colliderTop = initializing ? scrollTop : position.top; + var colliderHeight = initializing ? targetHeight : height; + + if (offsetTop != null && scrollTop <= offsetTop) return 'top'; + if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom'; + + return false; + }; + + Affix.prototype.getPinnedOffset = function() { + if (this.pinnedOffset) return this.pinnedOffset; + this.$element.removeClass(Affix.RESET).addClass('affix'); + var scrollTop = this.$target.scrollTop(); + var position = this.$element.offset(); + return (this.pinnedOffset = position.top - scrollTop); + }; + + Affix.prototype.checkPositionWithEventLoop = function() { + setTimeout($.proxy(this.checkPosition, this), 1); + }; + + Affix.prototype.checkPosition = function() { + if (!this.$element.is(':visible')) return; + + var height = this.$element.height(); + var offset = this.options.offset; + var offsetTop = offset.top; + var offsetBottom = offset.bottom; + var scrollHeight = Math.max($(document).height(), $(document.body).height()); + + /* eslint-disable */ + if (typeof offset !== 'object') offsetBottom = offsetTop = offset; + if (typeof offsetTop === 'function') offsetTop = offset.top(this.$element); + if (typeof offsetBottom === 'function') offsetBottom = offset.bottom(this.$element); + /* eslint-enable */ + + var affix = this.getState(scrollHeight, height, offsetTop, offsetBottom); + + if (this.affixed !== affix) { + if (this.unpin != null) this.$element.css('top', ''); + + var affixType = 'affix' + (affix ? '-' + affix : ''); + var e = new $.Event(affixType + '.bs.affix'); + + this.$element.trigger(e); + + if (e.isDefaultPrevented()) return; + + this.affixed = affix; + this.unpin = affix === 'bottom' ? this.getPinnedOffset() : null; + + this.$element + .removeClass(Affix.RESET) + .addClass(affixType) + .trigger(affixType.replace('affix', 'affixed') + '.bs.affix'); + } + + if (affix === 'bottom') { + this.$element.offset({ + top: scrollHeight - height - offsetBottom + }); + } + }; + + // AFFIX PLUGIN DEFINITION + // ======================= + + function Plugin(option) { + return this.each(function() { + var $this = $(this); + var data = $this.data('bs.affix'); + var options = typeof option === 'object' && option; + + if (!data) $this.data('bs.affix', data = new Affix(this, options)); + if (typeof option === 'string') data[option](); + }); + } + + var old = $.fn.affix; + + $.fn.affix = Plugin; + $.fn.affix.Constructor = Affix; + + // AFFIX NO CONFLICT + // ================= + + $.fn.affix.noConflict = function() { + $.fn.affix = old; + return this; + }; + + // AFFIX DATA-API + // ============== + + $(window).on('load', function() { + $('[data-spy="affix"]').each(function() { + var $spy = $(this); + var data = $spy.data(); + + data.offset = data.offset || {}; + + /* eslint-disable */ + if (data.offsetBottom != null) data.offset.bottom = data.offsetBottom; + if (data.offsetTop != null) data.offset.top = data.offsetTop; + /* eslint-enable */ + + Plugin.call($spy, data); + }); + }); + +}(jQuery)); diff --git a/doc/themes/next/source/js/algolia-search.js b/doc/themes/next/source/js/algolia-search.js new file mode 100644 index 00000000..06decd8c --- /dev/null +++ b/doc/themes/next/source/js/algolia-search.js @@ -0,0 +1,114 @@ +/* global instantsearch, CONFIG */ + +$(document).ready(function() { + var algoliaSettings = CONFIG.algolia; + var isAlgoliaSettingsValid = algoliaSettings.applicationID + && algoliaSettings.apiKey + && algoliaSettings.indexName; + + if (!isAlgoliaSettingsValid) { + window.console.error('Algolia Settings are invalid.'); + return; + } + + var search = instantsearch({ + appId : algoliaSettings.applicationID, + apiKey : algoliaSettings.apiKey, + indexName : algoliaSettings.indexName, + searchFunction: function(helper) { + var searchInput = $('#algolia-search-input').find('input'); + + if (searchInput.val()) { + helper.search(); + } + } + }); + + // Registering Widgets + [ + instantsearch.widgets.searchBox({ + container : '#algolia-search-input', + placeholder: algoliaSettings.labels.input_placeholder + }), + + instantsearch.widgets.hits({ + container : '#algolia-hits', + hitsPerPage: algoliaSettings.hits.per_page || 10, + templates : { + item: function(data) { + var link = data.permalink ? data.permalink : CONFIG.root + data.path; + return ( + '' + + data._highlightResult.title.value + + '' + ); + }, + empty: function(data) { + return ( + '
    ' + + algoliaSettings.labels.hits_empty.replace(/\$\{query}/, data.query) + + '
    ' + ); + } + }, + cssClasses: { + item: 'algolia-hit-item' + } + }), + + instantsearch.widgets.stats({ + container: '#algolia-stats', + templates: { + body: function(data) { + var stats = algoliaSettings.labels.hits_stats + .replace(/\$\{hits}/, data.nbHits) + .replace(/\$\{time}/, data.processingTimeMS); + return ( + stats + + '' + + ' Algolia' + + '' + + '
    ' + ); + } + } + }), + + instantsearch.widgets.pagination({ + container : '#algolia-pagination', + scrollTo : false, + showFirstLast: false, + labels : { + first : '', + last : '', + previous: '', + next : '' + }, + cssClasses: { + root : 'pagination', + item : 'pagination-item', + link : 'page-number', + active : 'current', + disabled: 'disabled-item' + } + }) + ].forEach(search.addWidget, search); + + search.start(); + + $('.popup-trigger').on('click', function(e) { + e.stopPropagation(); + $('body') + .append('
    ') + .css('overflow', 'hidden'); + $('.popup').toggle(); + $('#algolia-search-input').find('input').focus(); + }); + + $('.popup-btn-close').click(function() { + $('.popup').hide(); + $('.algolia-pop-overlay').remove(); + $('body').css('overflow', ''); + }); + +}); diff --git a/doc/themes/next/source/js/exturl.js b/doc/themes/next/source/js/exturl.js new file mode 100644 index 00000000..806a29ef --- /dev/null +++ b/doc/themes/next/source/js/exturl.js @@ -0,0 +1,14 @@ +$(document).ready(function() { + + // Create Base64 Object + /* eslint-disable */ + var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(e){var t="";var n,r,i,s,o,u,a;var f=0;e=Base64._utf8_encode(e);while(f>2;o=(n&3)<<4|r>>4;u=(r&15)<<2|i>>6;a=i&63;if(isNaN(r)){u=a=64}else if(isNaN(i)){a=64}t=t+this._keyStr.charAt(s)+this._keyStr.charAt(o)+this._keyStr.charAt(u)+this._keyStr.charAt(a)}return t},decode:function(e){var t="";var n,r,i;var s,o,u,a;var f=0;e=e.replace(/[^A-Za-z0-9+/=]/g,"");while(f>4;r=(o&15)<<4|u>>2;i=(u&3)<<6|a;t=t+String.fromCharCode(n);if(u!=64){t=t+String.fromCharCode(r)}if(a!=64){t=t+String.fromCharCode(i)}}t=Base64._utf8_decode(t);return t},_utf8_encode:function(e){e=e.replace(/rn/g,"n");var t="";for(var n=0;n127&&r<2048){t+=String.fromCharCode(r>>6|192);t+=String.fromCharCode(r&63|128)}else{t+=String.fromCharCode(r>>12|224);t+=String.fromCharCode(r>>6&63|128);t+=String.fromCharCode(r&63|128)}}return t},_utf8_decode:function(e){var t="";var n=0;var r=c1=c2=0;while(n191&&r<224){c2=e.charCodeAt(n+1);t+=String.fromCharCode((r&31)<<6|c2&63);n+=2}else{c2=e.charCodeAt(n+1);c3=e.charCodeAt(n+2);t+=String.fromCharCode((r&15)<<12|(c2&63)<<6|c3&63);n+=3}}return t}}; + + $('.exturl').on('click', function() { + var $exturl = $(this).attr('data-url'); + var $decurl = Base64.decode($exturl); + window.open($decurl, '_blank'); + return false; + }); + +}); diff --git a/doc/themes/next/source/js/js.cookie.js b/doc/themes/next/source/js/js.cookie.js new file mode 100644 index 00000000..97b4fea1 --- /dev/null +++ b/doc/themes/next/source/js/js.cookie.js @@ -0,0 +1,166 @@ +/*! + * JavaScript Cookie v2.1.4 + * https://github.com/js-cookie/js-cookie + * + * Copyright 2006, 2015 Klaus Hartl & Fagner Brack + * Released under the MIT license + */ + +;(function (factory) { + var registeredInModuleLoader = false; + if (typeof define === 'function' && define.amd) { + define(factory); + registeredInModuleLoader = true; + } + if (typeof exports === 'object') { + module.exports = factory(); + registeredInModuleLoader = true; + } + if (!registeredInModuleLoader) { + var OldCookies = window.Cookies; + var api = window.Cookies = factory(); + api.noConflict = function () { + window.Cookies = OldCookies; + return api; + }; + } +}(function () { + function extend () { + var i = 0; + var result = {}; + for (; i < arguments.length; i++) { + var attributes = arguments[ i ]; + for (var key in attributes) { + result[key] = attributes[key]; + } + } + return result; + } + + function init (converter) { + function api (key, value, attributes) { + var result; + if (typeof document === 'undefined') { + return; + } + + // Write + + if (arguments.length > 1) { + attributes = extend({ + path: '/' + }, api.defaults, attributes); + + if (typeof attributes.expires === 'number') { + var expires = new Date(); + expires.setMilliseconds(expires.getMilliseconds() + attributes.expires * 864e+5); + attributes.expires = expires; + } + + // We're using "expires" because "max-age" is not supported by IE + attributes.expires = attributes.expires ? attributes.expires.toUTCString() : ''; + + try { + result = JSON.stringify(value); + if (/^[\{\[]/.test(result)) { + value = result; + } + } catch (e) {} + + if (!converter.write) { + value = encodeURIComponent(String(value)) + .replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent); + } else { + value = converter.write(value, key); + } + + key = encodeURIComponent(String(key)); + key = key.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent); + key = key.replace(/[\(\)]/g, escape); + + var stringifiedAttributes = ''; + + for (var attributeName in attributes) { + if (!attributes[attributeName]) { + continue; + } + stringifiedAttributes += '; ' + attributeName; + if (attributes[attributeName] === true) { + continue; + } + stringifiedAttributes += '=' + attributes[attributeName]; + } + return (document.cookie = key + '=' + value + stringifiedAttributes); + } + + // Read + + if (!key) { + result = {}; + } + + // To prevent the for loop in the first place assign an empty array + // in case there are no cookies at all. Also prevents odd result when + // calling "get()" + var cookies = document.cookie ? document.cookie.split('; ') : []; + var rdecode = /(%[0-9A-Z]{2})+/g; + var i = 0; + + for (; i < cookies.length; i++) { + var parts = cookies[i].split('='); + var cookie = parts.slice(1).join('='); + + if (cookie.charAt(0) === '"') { + cookie = cookie.slice(1, -1); + } + + try { + var name = parts[0].replace(rdecode, decodeURIComponent); + cookie = converter.read ? + converter.read(cookie, name) : converter(cookie, name) || + cookie.replace(rdecode, decodeURIComponent); + + if (this.json) { + try { + cookie = JSON.parse(cookie); + } catch (e) {} + } + + if (key === name) { + result = cookie; + break; + } + + if (!key) { + result[name] = cookie; + } + } catch (e) {} + } + + return result; + } + + api.set = api; + api.get = function (key) { + return api.call(api, key); + }; + api.getJSON = function () { + return api.apply({ + json: true + }, [].slice.call(arguments)); + }; + api.defaults = {}; + + api.remove = function (key, attributes) { + api(key, '', extend(attributes, { + expires: -1 + })); + }; + + api.withConverter = init; + + return api; + } + + return init(function () {}); +})); diff --git a/doc/themes/next/source/js/motion.js b/doc/themes/next/source/js/motion.js new file mode 100644 index 00000000..57a039ba --- /dev/null +++ b/doc/themes/next/source/js/motion.js @@ -0,0 +1,372 @@ +/* global NexT, CONFIG */ + +$(document).ready(function() { + NexT.motion = {}; + + var sidebarToggleLines = { + lines: [], + push : function(line) { + this.lines.push(line); + }, + init: function() { + this.lines.forEach(function(line) { + line.init(); + }); + }, + arrow: function() { + this.lines.forEach(function(line) { + line.arrow(); + }); + }, + close: function() { + this.lines.forEach(function(line) { + line.close(); + }); + } + }; + + function SidebarToggleLine(settings) { + this.el = $(settings.el); + this.status = $.extend({}, { + init: { + width : '100%', + opacity: 1, + left : 0, + rotateZ: 0, + top : 0 + } + }, settings.status); + } + + SidebarToggleLine.prototype.init = function() { + this.transform('init'); + }; + SidebarToggleLine.prototype.arrow = function() { + this.transform('arrow'); + }; + SidebarToggleLine.prototype.close = function() { + this.transform('close'); + }; + SidebarToggleLine.prototype.transform = function(status) { + this.el.velocity('stop').velocity(this.status[status]); + }; + + var sidebarToggleLine1st = new SidebarToggleLine({ + el : '.sidebar-toggle-line-first', + status: { + arrow: {width: '50%', rotateZ: '-45deg', top: '2px'}, + close: {width: '100%', rotateZ: '-45deg', top: '5px'} + } + }); + var sidebarToggleLine2nd = new SidebarToggleLine({ + el : '.sidebar-toggle-line-middle', + status: { + arrow: {width: '90%'}, + close: {opacity: 0} + } + }); + var sidebarToggleLine3rd = new SidebarToggleLine({ + el : '.sidebar-toggle-line-last', + status: { + arrow: {width: '50%', rotateZ: '45deg', top: '-2px'}, + close: {width: '100%', rotateZ: '45deg', top: '-5px'} + } + }); + + sidebarToggleLines.push(sidebarToggleLine1st); + sidebarToggleLines.push(sidebarToggleLine2nd); + sidebarToggleLines.push(sidebarToggleLine3rd); + + var SIDEBAR_WIDTH = CONFIG.sidebar.width ? CONFIG.sidebar.width : '320px'; + var SIDEBAR_DISPLAY_DURATION = 200; + var xPos, yPos; + + var sidebarToggleMotion = { + toggleEl : $('.sidebar-toggle'), + dimmerEl : $('#sidebar-dimmer'), + sidebarEl : $('.sidebar'), + isSidebarVisible: false, + init : function() { + this.toggleEl.on('click', this.clickHandler.bind(this)); + this.dimmerEl.on('click', this.clickHandler.bind(this)); + this.toggleEl.on('mouseenter', this.mouseEnterHandler.bind(this)); + this.toggleEl.on('mouseleave', this.mouseLeaveHandler.bind(this)); + this.sidebarEl.on('touchstart', this.touchstartHandler.bind(this)); + this.sidebarEl.on('touchend', this.touchendHandler.bind(this)); + this.sidebarEl.on('touchmove', function(e) { e.preventDefault(); }); + + $(document) + .on('sidebar.isShowing', function() { + NexT.utils.isDesktop() && $('body').velocity('stop').velocity( + {paddingRight: SIDEBAR_WIDTH}, + SIDEBAR_DISPLAY_DURATION + ); + }) + .on('sidebar.isHiding', function() { + }); + }, + clickHandler: function() { + this.isSidebarVisible ? this.hideSidebar() : this.showSidebar(); + this.isSidebarVisible = !this.isSidebarVisible; + }, + mouseEnterHandler: function() { + if (this.isSidebarVisible) { + return; + } + sidebarToggleLines.arrow(); + }, + mouseLeaveHandler: function() { + if (this.isSidebarVisible) { + return; + } + sidebarToggleLines.init(); + }, + touchstartHandler: function(e) { + xPos = e.originalEvent.touches[0].clientX; + yPos = e.originalEvent.touches[0].clientY; + }, + touchendHandler: function(e) { + var _xPos = e.originalEvent.changedTouches[0].clientX; + var _yPos = e.originalEvent.changedTouches[0].clientY; + if (_xPos - xPos > 30 && Math.abs(_yPos - yPos) < 20) { + this.clickHandler(); + } + }, + showSidebar: function() { + var self = this; + + sidebarToggleLines.close(); + + this.sidebarEl.velocity('stop').velocity({ + width: SIDEBAR_WIDTH + }, { + display : 'block', + duration: SIDEBAR_DISPLAY_DURATION, + begin : function() { + $('.sidebar .motion-element').not('.site-state').velocity( + 'transition.slideRightIn', { + stagger : 50, + drag : true, + complete: function() { + self.sidebarEl.trigger('sidebar.motion.complete'); + } + } + ); + $('.site-state').velocity( + 'transition.slideRightIn', { + stagger : 50, + drag : true, + display : 'flex' + } + ); + }, + complete: function() { + self.sidebarEl.addClass('sidebar-active'); + self.sidebarEl.trigger('sidebar.didShow'); + } + }); + + this.sidebarEl.trigger('sidebar.isShowing'); + }, + hideSidebar: function() { + NexT.utils.isDesktop() && $('body').velocity('stop').velocity({paddingRight: 0}); + this.sidebarEl.find('.motion-element').velocity('stop').css('display', 'none'); + this.sidebarEl.velocity('stop').velocity({width: 0}, {display: 'none'}); + + sidebarToggleLines.init(); + + this.sidebarEl.removeClass('sidebar-active'); + this.sidebarEl.trigger('sidebar.isHiding'); + + // Prevent adding TOC to Overview if Overview was selected when close & open sidebar. + if ($('.post-toc-wrap')) { + if ($('.site-overview-wrap').css('display') === 'block') { + $('.post-toc-wrap').removeClass('motion-element'); + } else { + $('.post-toc-wrap').addClass('motion-element'); + } + } + } + }; + sidebarToggleMotion.init(); + + NexT.motion.integrator = { + queue : [], + cursor: -1, + add : function(fn) { + this.queue.push(fn); + return this; + }, + next: function() { + this.cursor++; + var fn = this.queue[this.cursor]; + $.isFunction(fn) && fn(NexT.motion.integrator); + }, + bootstrap: function() { + this.next(); + } + }; + + NexT.motion.middleWares = { + logo: function(integrator) { + var sequence = []; + var $brand = $('.brand'); + var $image = $('.custom-logo-image'); + var $title = $('.site-title'); + var $subtitle = $('.site-subtitle'); + var $logoLineTop = $('.logo-line-before i'); + var $logoLineBottom = $('.logo-line-after i'); + + $brand.length > 0 && sequence.push({ + e: $brand, + p: {opacity: 1}, + o: {duration: 200} + }); + + /** + * Check if $elements exist. + * @param {jQuery|Array} $elements + * @returns {boolean} + */ + function hasElement($elements) { + $elements = Array.isArray($elements) ? $elements : [$elements]; + return $elements.every(function($element) { + return $element.length > 0; + }); + } + + function getMistLineSettings(element, translateX) { + return { + e: $(element), + p: {translateX: translateX}, + o: { + duration : 500, + sequenceQueue: false + } + }; + } + + function pushImageToSequence() { + sequence.push({ + e: $image, + p: {opacity: 1, top: 0}, + o: {duration: 200} + }); + } + + NexT.utils.isMist() && hasElement([$logoLineTop, $logoLineBottom]) + && sequence.push( + getMistLineSettings($logoLineTop, '100%'), + getMistLineSettings($logoLineBottom, '-100%') + ); + + NexT.utils.isMuse() && hasElement($image) && pushImageToSequence(); + + hasElement($title) && sequence.push({ + e: $title, + p: {opacity: 1, top: 0}, + o: {duration: 200} + }); + + hasElement($subtitle) && sequence.push({ + e: $subtitle, + p: {opacity: 1, top: 0}, + o: {duration: 200} + }); + + (NexT.utils.isPisces() || NexT.utils.isGemini()) && hasElement($image) && pushImageToSequence(); + + if (CONFIG.motion.async) { + integrator.next(); + } + + if (sequence.length > 0) { + sequence[sequence.length - 1].o.complete = function() { + integrator.next(); + }; + /* eslint-disable */ + $.Velocity.RunSequence(sequence); + /* eslint-enable */ + } else { + integrator.next(); + } + }, + + menu: function(integrator) { + + if (CONFIG.motion.async) { + integrator.next(); + } + + $('.menu-item').velocity('transition.slideDownIn', { + display : null, + duration: 200, + complete: function() { + integrator.next(); + } + }); + }, + + postList: function(integrator) { + + //var $post = $('.post'); + var $postBlock = $('.post-block, .pagination, .comments'); + var $postBlockTransition = CONFIG.motion.transition.post_block; + var $postHeader = $('.post-header'); + var $postHeaderTransition = CONFIG.motion.transition.post_header; + var $postBody = $('.post-body'); + var $postBodyTransition = CONFIG.motion.transition.post_body; + var $collHeader = $('.collection-title, .archive-year'); + var $collHeaderTransition = CONFIG.motion.transition.coll_header; + var $sidebarAffix = $('.sidebar-inner'); + var $sidebarAffixTransition = CONFIG.motion.transition.sidebar; + var hasPost = $postBlock.length > 0; + + function postMotion() { + var postMotionOptions = window.postMotionOptions || { + stagger: 100, + drag : true + }; + postMotionOptions.complete = function() { + // After motion complete need to remove transform from sidebar to let affix work on Pisces | Gemini. + if (CONFIG.motion.transition.sidebar && (NexT.utils.isPisces() || NexT.utils.isGemini())) { + $sidebarAffix.css({ 'transform': 'initial' }); + } + integrator.next(); + }; + + //$post.velocity('transition.slideDownIn', postMotionOptions); + if (CONFIG.motion.transition.post_block) { + $postBlock.velocity('transition.' + $postBlockTransition, postMotionOptions); + } + if (CONFIG.motion.transition.post_header) { + $postHeader.velocity('transition.' + $postHeaderTransition, postMotionOptions); + } + if (CONFIG.motion.transition.post_body) { + $postBody.velocity('transition.' + $postBodyTransition, postMotionOptions); + } + if (CONFIG.motion.transition.coll_header) { + $collHeader.velocity('transition.' + $collHeaderTransition, postMotionOptions); + } + // Only for Pisces | Gemini. + if (CONFIG.motion.transition.sidebar && (NexT.utils.isPisces() || NexT.utils.isGemini())) { + $sidebarAffix.velocity('transition.' + $sidebarAffixTransition, postMotionOptions); + } + } + + hasPost ? postMotion() : integrator.next(); + + if (CONFIG.motion.async) { + integrator.next(); + } + }, + + sidebar: function(integrator) { + if (CONFIG.sidebar.display === 'always') { + NexT.utils.displaySidebar(); + } + integrator.next(); + } + }; + +}); diff --git a/doc/themes/next/source/js/next-boot.js b/doc/themes/next/source/js/next-boot.js new file mode 100644 index 00000000..f9c02d32 --- /dev/null +++ b/doc/themes/next/source/js/next-boot.js @@ -0,0 +1,53 @@ +/* global NexT, CONFIG */ + +$(document).ready(function() { + + $(document).trigger('bootstrap:before'); + + /** + * Register JS handlers by condition option. + * Need to add config option in Front-End at 'layout/_partials/head.swig' file. + */ + CONFIG.fastclick && NexT.utils.isMobile() && window.FastClick.attach(document.body); + CONFIG.lazyload && NexT.utils.lazyLoadPostsImages(); + + NexT.utils.registerESCKeyEvent(); + + CONFIG.back2top && NexT.utils.registerBackToTop(); + + // Mobile top menu bar. + $('.site-nav-toggle button').on('click', function() { + var $siteNav = $('.site-nav'); + var ON_CLASS_NAME = 'site-nav-on'; + var isSiteNavOn = $siteNav.hasClass(ON_CLASS_NAME); + var animateAction = isSiteNavOn ? 'slideUp' : 'slideDown'; + var animateCallback = isSiteNavOn ? 'removeClass' : 'addClass'; + + $siteNav.stop()[animateAction]('fast', function() { + $siteNav[animateCallback](ON_CLASS_NAME); + }); + }); + + /** + * Register JS handlers by condition option. + * Need to add config option in Front-End at 'layout/_partials/head.swig' file. + */ + CONFIG.fancybox && NexT.utils.wrapImageWithFancyBox(); + CONFIG.tabs && NexT.utils.registerTabsTag(); + + NexT.utils.embeddedVideoTransformer(); + + // Define Motion Sequence. + NexT.motion.integrator + .add(NexT.motion.middleWares.logo) + .add(NexT.motion.middleWares.menu) + .add(NexT.motion.middleWares.postList) + .add(NexT.motion.middleWares.sidebar); + + $(document).trigger('motion:before'); + + // Bootstrap Motion. + CONFIG.motion.enable && NexT.motion.integrator.bootstrap(); + + $(document).trigger('bootstrap:after'); +}); diff --git a/doc/themes/next/source/js/post-details.js b/doc/themes/next/source/js/post-details.js new file mode 100644 index 00000000..e47f1bb5 --- /dev/null +++ b/doc/themes/next/source/js/post-details.js @@ -0,0 +1,104 @@ +/* global NexT, CONFIG */ + +$(document).ready(function() { + + function initScrollSpy() { + var tocSelector = '.post-toc'; + var $tocElement = $(tocSelector); + var activeCurrentSelector = '.active-current'; + + function removeCurrentActiveClass() { + $(tocSelector + ' ' + activeCurrentSelector) + .removeClass(activeCurrentSelector.substring(1)); + } + + $tocElement + .on('activate.bs.scrollspy', function() { + var $currentActiveElement = $(tocSelector + ' .active').last(); + + removeCurrentActiveClass(); + $currentActiveElement.addClass('active-current'); + + // Scrolling to center active TOC element if TOC content is taller then viewport. + $tocElement.scrollTop($currentActiveElement.offset().top - $tocElement.offset().top + $tocElement.scrollTop() - ($tocElement.height() / 2)); + }) + .on('clear.bs.scrollspy', removeCurrentActiveClass); + + $('body').scrollspy({ target: tocSelector }); + } + + initScrollSpy(); +}); + +$(document).ready(function() { + var html = $('html'); + var TAB_ANIMATE_DURATION = 200; + var hasVelocity = $.isFunction(html.velocity); + + $('.sidebar-nav li').on('click', function() { + var item = $(this); + var activeTabClassName = 'sidebar-nav-active'; + var activePanelClassName = 'sidebar-panel-active'; + if (item.hasClass(activeTabClassName)) { + return; + } + + var currentTarget = $('.' + activePanelClassName); + var target = $('.' + item.data('target')); + + hasVelocity + ? currentTarget.velocity('transition.slideUpOut', TAB_ANIMATE_DURATION, function() { + target + .velocity('stop') + .velocity('transition.slideDownIn', TAB_ANIMATE_DURATION) + .addClass(activePanelClassName); + }) + : currentTarget.animate({ opacity: 0 }, TAB_ANIMATE_DURATION, function() { + currentTarget.hide(); + target + .stop() + .css({'opacity': 0, 'display': 'block'}) + .animate({ opacity: 1 }, TAB_ANIMATE_DURATION, function() { + currentTarget.removeClass(activePanelClassName); + target.addClass(activePanelClassName); + }); + }); + + item.siblings().removeClass(activeTabClassName); + item.addClass(activeTabClassName); + }); + + // TOC item animation navigate & prevent #item selector in adress bar. + $('.post-toc a').on('click', function(e) { + e.preventDefault(); + var targetSelector = NexT.utils.escapeSelector(this.getAttribute('href')); + var offset = $(targetSelector).offset().top; + + hasVelocity + ? html.velocity('stop').velocity('scroll', { + offset : offset + 'px', + mobileHA: false + }) + : $('html, body').stop().animate({ + scrollTop: offset + }, 500); + }); + + // Expand sidebar on post detail page by default, when post has a toc. + var $tocContent = $('.post-toc-content'); + var display = CONFIG.page.sidebar; + if (typeof display !== 'boolean') { + // There's no definition sidebar in the page front-matter + var isSidebarCouldDisplay = CONFIG.sidebar.display === 'post' + || CONFIG.sidebar.display === 'always'; + var hasTOC = $tocContent.length > 0 && $tocContent.html().trim().length > 0; + display = isSidebarCouldDisplay && hasTOC; + } + if (display) { + CONFIG.motion.enable + ? NexT.motion.middleWares.sidebar = function() { + NexT.utils.displaySidebar(); + } + : NexT.utils.displaySidebar(); + } +}); diff --git a/doc/themes/next/source/js/schemes/muse.js b/doc/themes/next/source/js/schemes/muse.js new file mode 100644 index 00000000..a0e2c566 --- /dev/null +++ b/doc/themes/next/source/js/schemes/muse.js @@ -0,0 +1,9 @@ +$(document).ready(function() { + function updateFooterPosition() { + var containerHeight = $('#footer').attr('position') ? $('.container').height() + $('#footer').outerHeight(true) : $('.container').height(); + if (containerHeight < window.innerHeight) $('#footer').css({ 'position': 'fixed', 'bottom': 0, 'left': 0, 'right': 0 }).attr('position', 'fixed'); + else $('#footer').removeAttr('style position'); + } + updateFooterPosition(); + $(window).on('resize scroll', updateFooterPosition); +}); diff --git a/doc/themes/next/source/js/schemes/pisces.js b/doc/themes/next/source/js/schemes/pisces.js new file mode 100644 index 00000000..8c6e896f --- /dev/null +++ b/doc/themes/next/source/js/schemes/pisces.js @@ -0,0 +1,57 @@ +/* global NexT, CONFIG */ + +$(document).ready(function() { + + var sidebarInner = $('.sidebar-inner'); + var sidebarOffset = CONFIG.sidebar.offset || 12; + + function getHeaderOffset() { + return $('.header-inner').height() + sidebarOffset; + } + + function getFooterOffset() { + var footer = $('#footer'); + var footerInner = $('.footer-inner'); + var footerMargin = footer.outerHeight() - footerInner.outerHeight(); + var footerOffset = footer.outerHeight() + footerMargin; + return footerOffset; + } + + function initAffix() { + var headerOffset = getHeaderOffset(); + var footerOffset = getFooterOffset(); + var sidebarHeight = $('#sidebar').height() + NexT.utils.getSidebarb2tHeight(); + var contentHeight = $('#content').height(); + + // Not affix if sidebar taller than content (to prevent bottom jumping). + if (headerOffset + sidebarHeight < contentHeight) { + sidebarInner.affix({ + offset: { + top : headerOffset - sidebarOffset, + bottom: footerOffset + } + }); + sidebarInner.affix('checkPosition'); + } + + $('#sidebar').css({ 'margin-top': headerOffset, 'margin-left': 'auto' }); + } + + function recalculateAffixPosition() { + $(window).off('.affix'); + sidebarInner.removeData('bs.affix').removeClass('affix affix-top affix-bottom'); + initAffix(); + } + + function resizeListener() { + var mql = window.matchMedia('(min-width: 992px)'); + mql.addListener(function(e) { + if (e.matches) { + recalculateAffixPosition(); + } + }); + } + + initAffix(); + resizeListener(); +}); diff --git a/doc/themes/next/source/js/scroll-cookie.js b/doc/themes/next/source/js/scroll-cookie.js new file mode 100644 index 00000000..2db1f8af --- /dev/null +++ b/doc/themes/next/source/js/scroll-cookie.js @@ -0,0 +1,25 @@ +$(document).ready(function() { + + /* global Cookies */ + + // Set relative link path (without domain) + var rpath = window.location.href.replace(window.location.origin, ''); + + // Write position in cookie + var timeout; + $(window).on('scroll', function() { + clearTimeout(timeout); + timeout = setTimeout(function() { + Cookies.set('scroll-cookie', $(window).scrollTop() + '|' + rpath, { expires: 365, path: '' }); + }, 250); + }); + + // Read position from cookie + if (Cookies.get('scroll-cookie') !== undefined) { + var cvalues = Cookies.get('scroll-cookie').split('|'); + if (cvalues[1] === rpath) { + $(window).scrollTop(cvalues[0]); + } + } + +}); diff --git a/doc/themes/next/source/js/scrollspy.js b/doc/themes/next/source/js/scrollspy.js new file mode 100644 index 00000000..7efacace --- /dev/null +++ b/doc/themes/next/source/js/scrollspy.js @@ -0,0 +1,179 @@ +/* ======================================================================== +* Bootstrap: scrollspy.js v3.3.2 +* http://getbootstrap.com/javascript/#scrollspy +* ======================================================================== +* Copyright 2011-2015 Twitter, Inc. +* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) +* ======================================================================== */ + +/** + * Customized by iissnan & Ivan.Nginx + * + * - Add a `clear.bs.scrollspy` event. + * - Esacpe targets selector. + * - Refactored with eslint-config-theme-next style. + */ + +/* global NexT */ + +(function($) { + 'use strict'; + + // SCROLLSPY CLASS DEFINITION + // ========================== + function ScrollSpy(element, options) { + this.$body = $(document.body); + this.$scrollElement = $(element).is(document.body) ? $(window) : $(element); + this.options = $.extend({}, ScrollSpy.DEFAULTS, options); + this.selector = (this.options.target || '') + ' .nav li > a'; + this.offsets = []; + this.targets = []; + this.activeTarget = null; + this.scrollHeight = 0; + + this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this)); + this.refresh(); + this.process(); + } + + ScrollSpy.VERSION = '3.3.2'; + + ScrollSpy.DEFAULTS = { + offset: 10 + }; + + ScrollSpy.prototype.getScrollHeight = function() { + return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight); + }; + + ScrollSpy.prototype.refresh = function() { + var that = this; + var offsetMethod = 'offset'; + var offsetBase = 0; + + this.offsets = []; + this.targets = []; + this.scrollHeight = this.getScrollHeight(); + + if (!$.isWindow(this.$scrollElement[0])) { + offsetMethod = 'position'; + offsetBase = this.$scrollElement.scrollTop(); + } + + this.$body + .find(this.selector) + .map(function() { + var $el = $(this); + var href = $el.data('target') || $el.attr('href'); + var $href = /^#./.test(href) && $(NexT.utils.escapeSelector(href)); // Need to escape selector. + + return ($href + && $href.length + && $href.is(':visible') + && [[$href[offsetMethod]().top + offsetBase, href]]) || null; + }) + .sort(function(a, b) { + return a[0] - b[0]; + }) + .each(function() { + that.offsets.push(this[0]); + that.targets.push(this[1]); + }); + + + }; + + ScrollSpy.prototype.process = function() { + var scrollTop = this.$scrollElement.scrollTop() + this.options.offset; + var scrollHeight = this.getScrollHeight(); + var maxScroll = this.options.offset + scrollHeight - this.$scrollElement.height(); + var offsets = this.offsets; + var targets = this.targets; + var activeTarget = this.activeTarget; + var i; + + if (this.scrollHeight !== scrollHeight) { + this.refresh(); + } + + if (scrollTop >= maxScroll) { + return activeTarget !== (i = targets[targets.length - 1]) && this.activate(i); + } + + if (activeTarget && scrollTop < offsets[0]) { + $(this.selector).trigger('clear.bs.scrollspy'); // Add a custom event. + this.activeTarget = null; + return this.clear(); + } + + for (i = offsets.length; i--;) { + activeTarget !== targets[i] + && scrollTop >= offsets[i] + && (!offsets[i + 1] || scrollTop <= offsets[i + 1]) + && this.activate(targets[i]); + } + }; + + ScrollSpy.prototype.activate = function(target) { + this.activeTarget = target; + + this.clear(); + + var selector = this.selector + + '[data-target="' + target + '"],' + + this.selector + '[href="' + target + '"]'; + + var active = $(selector) + .parents('li') + .addClass('active'); + + if (active.parent('.dropdown-menu').length) { + active = active + .closest('li.dropdown') + .addClass('active'); + } + + active.trigger('activate.bs.scrollspy'); + }; + + ScrollSpy.prototype.clear = function() { + $(this.selector) + .parentsUntil(this.options.target, '.active') + .removeClass('active'); + }; + + // SCROLLSPY PLUGIN DEFINITION + // =========================== + function Plugin(option) { + return this.each(function() { + var $this = $(this); + var data = $this.data('bs.scrollspy'); + var options = typeof option === 'object' && option; + + if (!data) $this.data('bs.scrollspy', data = new ScrollSpy(this, options)); + if (typeof option === 'string') data[option](); + }); + } + + var old = $.fn.scrollspy; + + $.fn.scrollspy = Plugin; + $.fn.scrollspy.Constructor = ScrollSpy; + + // SCROLLSPY NO CONFLICT + // ===================== + $.fn.scrollspy.noConflict = function() { + $.fn.scrollspy = old; + return this; + }; + + // SCROLLSPY DATA-API + // ================== + $(window).on('load.bs.scrollspy.data-api', function() { + $('[data-spy="scroll"]').each(function() { + var $spy = $(this); + Plugin.call($spy, $spy.data()); + }); + }); + +}(jQuery)); diff --git a/doc/themes/next/source/js/utils.js b/doc/themes/next/source/js/utils.js new file mode 100644 index 00000000..c7f3de45 --- /dev/null +++ b/doc/themes/next/source/js/utils.js @@ -0,0 +1,340 @@ +/* global NexT, CONFIG */ + +NexT.utils = NexT.$u = { + + /** + * Wrap images with fancybox support. + */ + wrapImageWithFancyBox: function() { + $('.content img') + .not(':hidden') + .each(function() { + var $image = $(this); + var imageTitle = $image.attr('title') || $image.attr('alt'); + var $imageWrapLink = $image.parent('a'); + + if ($imageWrapLink.length < 1) { + var imageLink = $image.attr('data-original') || $image.attr('src'); + $imageWrapLink = $image.wrap('').parent('a'); + if ($image.is('.post-gallery img')) { + $imageWrapLink.addClass('post-gallery-img'); + $imageWrapLink.attr('data-fancybox', 'gallery').attr('rel', 'gallery'); + } + else if ($image.is('.group-picture img')) { + $imageWrapLink.attr('data-fancybox', 'group').attr('rel', 'group'); + } + else { + $imageWrapLink.attr('data-fancybox', 'default').attr('rel', 'default'); + } + } + + if (imageTitle) { + $imageWrapLink.append('

    ' + imageTitle + '

    '); + // Make sure img title tag will show correctly in fancybox + $imageWrapLink.attr('title', imageTitle).attr('data-caption', imageTitle); + } + }); + + $('.fancybox').fancybox({ + loop: true, + helpers: { + overlay: { + locked: false + } + } + }); + }, + + lazyLoadPostsImages: function() { + $('#posts').find('img').lazyload({ + //placeholder: '/images/loading.gif', + effect : 'fadeIn', + threshold: 0 + }); + }, + + /** + * Tabs tag listener (without twitter bootstrap). + */ + registerTabsTag: function() { + var tNav = '.tabs ul.nav-tabs '; + + // Binding `nav-tabs` & `tab-content` by real time permalink changing. + $(function() { + $(window).bind('hashchange', function() { + var tHash = location.hash; + if (tHash !== '' && !tHash.match(/%\S{2}/)) { + $(tNav + 'li:has(a[href="' + tHash + '"])').addClass('active').siblings().removeClass('active'); + $(tHash).addClass('active').siblings().removeClass('active'); + } + }).trigger('hashchange'); + }); + + $(tNav + '.tab').on('click', function(href) { + href.preventDefault(); + // Prevent selected tab to select again. + if (!$(this).hasClass('active')) { + + // Add & Remove active class on `nav-tabs` & `tab-content`. + $(this).addClass('active').siblings().removeClass('active'); + var tActive = $(this).find('a').attr('href'); + $(tActive).addClass('active').siblings().removeClass('active'); + + // Clear location hash in browser if #permalink exists. + if (location.hash !== '') { + history.pushState('', document.title, window.location.pathname + window.location.search); + } + } + }); + }, + + registerESCKeyEvent: function() { + $(document).on('keyup', function(event) { + var shouldDismissSearchPopup = event.which === 27 + && $('.search-popup').is(':visible'); + if (shouldDismissSearchPopup) { + $('.search-popup').hide(); + $('.search-popup-overlay').remove(); + $('body').css('overflow', ''); + } + }); + }, + + registerBackToTop: function() { + var THRESHOLD = 50; + var $top = $('.back-to-top'); + + function initBackToTop() { + $top.toggleClass('back-to-top-on', window.pageYOffset > THRESHOLD); + + var scrollTop = $(window).scrollTop(); + var contentVisibilityHeight = NexT.utils.getContentVisibilityHeight(); + var scrollPercent = scrollTop / contentVisibilityHeight; + var scrollPercentRounded = Math.round(scrollPercent * 100); + var scrollPercentMaxed = scrollPercentRounded > 100 ? 100 : scrollPercentRounded; + $('#scrollpercent>span').html(scrollPercentMaxed); + } + + // For init back to top in sidebar if page was scrolled after page refresh. + $(window).on('load', function() { + initBackToTop(); + }); + + $(window).on('scroll', function() { + initBackToTop(); + }); + + $top.on('click', function() { + $.isFunction($('html').velocity) ? $('body').velocity('scroll') : $('html, body').animate({ scrollTop: 0 }); + }); + }, + + /** + * Transform embedded video to support responsive layout. + * @see http://toddmotto.com/fluid-and-responsive-youtube-and-vimeo-videos-with-fluidvids-js/ + */ + embeddedVideoTransformer: function() { + var $iframes = $('iframe'); + + // Supported Players. Extend this if you need more players. + var SUPPORTED_PLAYERS = [ + 'www.youtube.com', + 'player.vimeo.com', + 'player.youku.com', + 'music.163.com', + 'www.tudou.com' + ]; + var pattern = new RegExp(SUPPORTED_PLAYERS.join('|')); + + function getDimension($element) { + return { + width : $element.width(), + height: $element.height() + }; + } + + function getAspectRadio(width, height) { + return height / width * 100; + } + + $iframes.each(function() { + var iframe = this; + var $iframe = $(this); + var oldDimension = getDimension($iframe); + var newDimension; + + if (this.src.search(pattern) > 0) { + + // Calculate the video ratio based on the iframe's w/h dimensions + var videoRatio = getAspectRadio(oldDimension.width, oldDimension.height); + + // Replace the iframe's dimensions and position the iframe absolute + // This is the trick to emulate the video ratio + $iframe.width('100%').height('100%') + .css({ + position: 'absolute', + top : '0', + left : '0' + }); + + // Wrap the iframe in a new
    which uses a dynamically fetched padding-top property + // based on the video's w/h dimensions + var wrap = document.createElement('div'); + wrap.className = 'fluid-vids'; + wrap.style.position = 'relative'; + wrap.style.marginBottom = '20px'; + wrap.style.width = '100%'; + wrap.style.paddingTop = videoRatio + '%'; + // Fix for appear inside tabs tag. + (wrap.style.paddingTop === '') && (wrap.style.paddingTop = '50%'); + + // Add the iframe inside our newly created
    + var iframeParent = iframe.parentNode; + iframeParent.insertBefore(wrap, iframe); + wrap.appendChild(iframe); + + // Additional adjustments for 163 Music + if (this.src.search('music.163.com') > 0) { + newDimension = getDimension($iframe); + var shouldRecalculateAspect = newDimension.width > oldDimension.width + || newDimension.height < oldDimension.height; + + // 163 Music Player has a fixed height, so we need to reset the aspect radio + if (shouldRecalculateAspect) { + wrap.style.paddingTop = getAspectRadio(newDimension.width, oldDimension.height) + '%'; + } + } + } + }); + + }, + + hasMobileUA: function() { + var nav = window.navigator; + var ua = nav.userAgent; + var pa = /iPad|iPhone|Android|Opera Mini|BlackBerry|webOS|UCWEB|Blazer|PSP|IEMobile|Symbian/g; + + return pa.test(ua); + }, + + isTablet: function() { + return window.screen.width < 992 && window.screen.width > 767 && this.hasMobileUA(); + }, + + isMobile: function() { + return window.screen.width < 767 && this.hasMobileUA(); + }, + + isDesktop: function() { + return !this.isTablet() && !this.isMobile(); + }, + + /** + * Escape meta symbols in jQuery selectors. + * + * @param selector + * @returns {string|void|XML|*} + */ + escapeSelector: function(selector) { + return selector.replace(/[!"$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g, '\\$&'); + }, + + displaySidebar: function() { + if (!this.isDesktop() || this.isPisces() || this.isGemini()) { + return; + } + $('.sidebar-toggle').trigger('click'); + }, + + isMuse: function() { + return CONFIG.scheme === 'Muse'; + }, + + isMist: function() { + return CONFIG.scheme === 'Mist'; + }, + + isPisces: function() { + return CONFIG.scheme === 'Pisces'; + }, + + isGemini: function() { + return CONFIG.scheme === 'Gemini'; + }, + + getScrollbarWidth: function() { + var $div = $('
    ').addClass('scrollbar-measure').prependTo('body'); + var div = $div[0]; + var scrollbarWidth = div.offsetWidth - div.clientWidth; + $div.remove(); + + return scrollbarWidth; + }, + + getContentVisibilityHeight: function() { + var docHeight = $('.container').height(); + var winHeight = $(window).height(); + var contentVisibilityHeight = docHeight > winHeight ? docHeight - winHeight : $(document).height() - winHeight; + return contentVisibilityHeight; + }, + + getSidebarb2tHeight: function() { + var sidebarb2tHeight = (CONFIG.back2top && CONFIG.back2top_sidebar) ? $('.back-to-top').height() : 0; + return sidebarb2tHeight; + }, + + getSidebarSchemePadding: function() { + var sidebarNavHeight = $('.sidebar-nav').css('display') === 'block' ? $('.sidebar-nav').outerHeight(true) : 0; + var sidebarInner = $('.sidebar-inner'); + var sidebarPadding = sidebarInner.innerWidth() - sidebarInner.width(); + var sidebarOffset = CONFIG.sidebar.offset ? CONFIG.sidebar.offset : 12; + var sidebarSchemePadding = this.isPisces() || this.isGemini() + ? (sidebarPadding * 2) + sidebarNavHeight + sidebarOffset + this.getSidebarb2tHeight() + : (sidebarPadding * 2) + (sidebarNavHeight / 2); + return sidebarSchemePadding; + } +}; + +$(document).ready(function() { + + function wrapTable() { + $('table').not('figure table').wrap('
    '); + } + + /** + * Init Sidebar & TOC inner dimensions on all pages and for all schemes. + * Need for Sidebar/TOC inner scrolling if content taller then viewport. + */ + function updateSidebarHeight(height) { + height = height || 'auto'; + $('.site-overview, .post-toc').css('max-height', height); + } + + function initSidebarDimension() { + var updateSidebarHeightTimer; + + $(window).on('resize', function() { + updateSidebarHeightTimer && clearTimeout(updateSidebarHeightTimer); + + updateSidebarHeightTimer = setTimeout(function() { + var sidebarWrapperHeight = document.body.clientHeight - NexT.utils.getSidebarSchemePadding(); + + updateSidebarHeight(sidebarWrapperHeight); + }, 0); + }); + + // Initialize Sidebar & TOC Width. + var scrollbarWidth = NexT.utils.getScrollbarWidth(); + if ($('.site-overview-wrap').height() > (document.body.clientHeight - NexT.utils.getSidebarSchemePadding())) { + $('.site-overview').css('width', 'calc(100% + ' + scrollbarWidth + 'px)'); + } + if ($('.post-toc-wrap').height() > (document.body.clientHeight - NexT.utils.getSidebarSchemePadding())) { + $('.post-toc').css('width', 'calc(100% + ' + scrollbarWidth + 'px)'); + } + + // Initialize Sidebar & TOC Height. + updateSidebarHeight(document.body.clientHeight - NexT.utils.getSidebarSchemePadding()); + } + initSidebarDimension(); + wrapTable(); +}); diff --git a/doc/themes/next/source/lib/jquery/index.js b/doc/themes/next/source/lib/jquery/index.js new file mode 100644 index 00000000..25714ed2 --- /dev/null +++ b/doc/themes/next/source/lib/jquery/index.js @@ -0,0 +1,4 @@ +/*! jQuery v2.1.3 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */ +!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l=a.document,m="2.1.3",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){return!n.isArray(a)&&a-parseFloat(a)+1>=0},isPlainObject:function(a){return"object"!==n.type(a)||a.nodeType||n.isWindow(a)?!1:a.constructor&&!j.call(a.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=l.createElement("script"),b.text=a,l.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:g.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(e=d.call(arguments,2),f=function(){return a.apply(b||this,e.concat(d.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:k}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=hb(),z=hb(),A=hb(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N=M.replace("w","w#"),O="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+L+"*\\]",P=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+O+")*)|.*)\\)|)",Q=new RegExp(L+"+","g"),R=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),S=new RegExp("^"+L+"*,"+L+"*"),T=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),U=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),V=new RegExp(P),W=new RegExp("^"+N+"$"),X={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+P),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),db=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},eb=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(fb){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function gb(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],k=b.nodeType,"string"!=typeof a||!a||1!==k&&9!==k&&11!==k)return d;if(!e&&p){if(11!==k&&(f=_.exec(a)))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return H.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName)return H.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=1!==k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(bb,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+rb(o[l]);w=ab.test(a)&&pb(b.parentNode)||b,x=o.join(",")}if(x)try{return H.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function hb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ib(a){return a[u]=!0,a}function jb(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function kb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function lb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function nb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function ob(a){return ib(function(b){return b=+b,ib(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function pb(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=gb.support={},f=gb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=gb.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=g.documentElement,e=g.defaultView,e&&e!==e.top&&(e.addEventListener?e.addEventListener("unload",eb,!1):e.attachEvent&&e.attachEvent("onunload",eb)),p=!f(g),c.attributes=jb(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=jb(function(a){return a.appendChild(g.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(g.getElementsByClassName),c.getById=jb(function(a){return o.appendChild(a).id=u,!g.getElementsByName||!g.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(g.querySelectorAll))&&(jb(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),jb(function(a){var b=g.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&jb(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",P)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===g||a.ownerDocument===v&&t(v,a)?-1:b===g||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,h=[a],i=[b];if(!e||!f)return a===g?-1:b===g?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return lb(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?lb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},g):n},gb.matches=function(a,b){return gb(a,null,null,b)},gb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return gb(b,n,null,[a]).length>0},gb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},gb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},gb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},gb.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=gb.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=gb.selectors={cacheLength:50,createPseudo:ib,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(cb,db),a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||gb.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&gb.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(cb,db).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=gb.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(Q," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||gb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ib(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ib(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?ib(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ib(function(a){return function(b){return gb(a,b).length>0}}),contains:ib(function(a){return a=a.replace(cb,db),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ib(function(a){return W.test(a||"")||gb.error("unsupported lang: "+a),a=a.replace(cb,db).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:ob(function(){return[0]}),last:ob(function(a,b){return[b-1]}),eq:ob(function(a,b,c){return[0>c?c+b:c]}),even:ob(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:ob(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:ob(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:ob(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function sb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function tb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ub(a,b,c){for(var d=0,e=b.length;e>d;d++)gb(a,b[d],c);return c}function vb(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function wb(a,b,c,d,e,f){return d&&!d[u]&&(d=wb(d)),e&&!e[u]&&(e=wb(e,f)),ib(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ub(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:vb(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=vb(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=vb(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function xb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=sb(function(a){return a===b},h,!0),l=sb(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[sb(tb(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return wb(i>1&&tb(m),i>1&&rb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&xb(a.slice(i,e)),f>e&&xb(a=a.slice(e)),f>e&&rb(a))}m.push(c)}return tb(m)}function yb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=F.call(i));s=vb(s)}H.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&gb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?ib(f):f}return h=gb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=xb(b[c]),f[u]?d.push(f):e.push(f);f=A(a,yb(e,d)),f.selector=a}return f},i=gb.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(cb,db),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(cb,db),ab.test(j[0].type)&&pb(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&rb(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&pb(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=jb(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),jb(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||kb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&jb(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||kb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),jb(function(a){return null==a.getAttribute("disabled")})||kb(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),gb}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return g.call(b,a)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:l,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}return d=l.getElementById(c[2]),d&&d.parentNode&&(this.length=1,this[0]=d),this.context=l,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};A.prototype=n.fn,y=n(l);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?g.call(n(a),this[0]):g.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(C[a]||n.unique(e),B.test(a)&&e.reverse()),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return n.each(a.match(E)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(b=a.memory&&l,c=!0,g=e||0,e=0,f=h.length,d=!0;h&&f>g;g++)if(h[g].apply(l[0],l[1])===!1&&a.stopOnFalse){b=!1;break}d=!1,h&&(i?i.length&&j(i.shift()):b?h=[]:k.disable())},k={add:function(){if(h){var c=h.length;!function g(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&g(c)})}(arguments),d?f=h.length:b&&(e=c,j(b))}return this},remove:function(){return h&&n.each(arguments,function(a,b){var c;while((c=n.inArray(b,h,c))>-1)h.splice(c,1),d&&(f>=c&&f--,g>=c&&g--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],f=0,this},disable:function(){return h=i=b=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,b||k.disable(),this},locked:function(){return!i},fireWith:function(a,b){return!h||c&&!i||(b=b||[],b=[a,b.slice?b.slice():b],d?i.push(b):j(b)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!c}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(H.resolveWith(l,[n]),n.fn.triggerHandler&&(n(l).triggerHandler("ready"),n(l).off("ready"))))}});function I(){l.removeEventListener("DOMContentLoaded",I,!1),a.removeEventListener("load",I,!1),n.ready()}n.ready.promise=function(b){return H||(H=n.Deferred(),"complete"===l.readyState?setTimeout(n.ready):(l.addEventListener("DOMContentLoaded",I,!1),a.addEventListener("load",I,!1))),H.promise(b)},n.ready.promise();var J=n.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)n.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f};n.acceptData=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function K(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=n.expando+K.uid++}K.uid=1,K.accepts=n.acceptData,K.prototype={key:function(a){if(!K.accepts(a))return 0;var b={},c=a[this.expando];if(!c){c=K.uid++;try{b[this.expando]={value:c},Object.defineProperties(a,b)}catch(d){b[this.expando]=c,n.extend(a,b)}}return this.cache[c]||(this.cache[c]={}),c},set:function(a,b,c){var d,e=this.key(a),f=this.cache[e];if("string"==typeof b)f[b]=c;else if(n.isEmptyObject(f))n.extend(this.cache[e],b);else for(d in b)f[d]=b[d];return f},get:function(a,b){var c=this.cache[this.key(a)];return void 0===b?c:c[b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=this.key(a),g=this.cache[f];if(void 0===b)this.cache[f]={};else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in g?d=[b,e]:(d=e,d=d in g?[d]:d.match(E)||[])),c=d.length;while(c--)delete g[d[c]]}},hasData:function(a){return!n.isEmptyObject(this.cache[a[this.expando]]||{})},discard:function(a){a[this.expando]&&delete this.cache[a[this.expando]]}};var L=new K,M=new K,N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(O,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}M.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return M.hasData(a)||L.hasData(a)},data:function(a,b,c){return M.access(a,b,c) +},removeData:function(a,b){M.remove(a,b)},_data:function(a,b,c){return L.access(a,b,c)},_removeData:function(a,b){L.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=M.get(f),1===f.nodeType&&!L.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));L.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){M.set(this,a)}):J(this,function(b){var c,d=n.camelCase(a);if(f&&void 0===b){if(c=M.get(f,a),void 0!==c)return c;if(c=M.get(f,d),void 0!==c)return c;if(c=P(f,d,void 0),void 0!==c)return c}else this.each(function(){var c=M.get(this,d);M.set(this,d,b),-1!==a.indexOf("-")&&void 0!==c&&M.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){M.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=L.get(a,b),c&&(!d||n.isArray(c)?d=L.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return L.get(a,c)||L.access(a,c,{empty:n.Callbacks("once memory").add(function(){L.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthx",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var U="undefined";k.focusinBubbles="onfocusin"in a;var V=/^key/,W=/^(?:mouse|pointer|contextmenu)|click/,X=/^(?:focusinfocus|focusoutblur)$/,Y=/^([^.]*)(?:\.(.+)|)$/;function Z(){return!0}function $(){return!1}function _(){try{return l.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return typeof n!==U&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(E)||[""],j=b.length;while(j--)h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g,!1)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.hasData(a)&&L.get(a);if(r&&(i=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&(delete r.handle,L.remove(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,m,o,p=[d||l],q=j.call(b,"type")?b.type:b,r=j.call(b,"namespace")?b.namespace.split("."):[];if(g=h=d=d||l,3!==d.nodeType&&8!==d.nodeType&&!X.test(q+n.event.triggered)&&(q.indexOf(".")>=0&&(r=q.split("."),q=r.shift(),r.sort()),k=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=r.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},e||!o.trigger||o.trigger.apply(d,c)!==!1)){if(!e&&!o.noBubble&&!n.isWindow(d)){for(i=o.delegateType||q,X.test(i+q)||(g=g.parentNode);g;g=g.parentNode)p.push(g),h=g;h===(d.ownerDocument||l)&&p.push(h.defaultView||h.parentWindow||a)}f=0;while((g=p[f++])&&!b.isPropagationStopped())b.type=f>1?i:o.bindType||q,m=(L.get(g,"events")||{})[b.type]&&L.get(g,"handle"),m&&m.apply(g,c),m=k&&g[k],m&&m.apply&&n.acceptData(g)&&(b.result=m.apply(g,c),b.result===!1&&b.preventDefault());return b.type=q,e||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!n.acceptData(d)||k&&n.isFunction(d[q])&&!n.isWindow(d)&&(h=d[k],h&&(d[k]=null),n.event.triggered=q,d[q](),n.event.triggered=void 0,h&&(d[k]=h)),b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(L.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(g.namespace))&&(a.handleObj=g,a.data=g.data,e=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(a.result=e)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!==this;i=i.parentNode||this)if(i.disabled!==!0||"click"!==a.type){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>=0:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h]*)\/>/gi,bb=/<([\w:]+)/,cb=/<|&#?\w+;/,db=/<(?:script|style|link)/i,eb=/checked\s*(?:[^=]|=\s*.checked.)/i,fb=/^$|\/(?:java|ecma)script/i,gb=/^true\/(.*)/,hb=/^\s*\s*$/g,ib={option:[1,""],thead:[1,"","
    "],col:[2,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],_default:[0,"",""]};ib.optgroup=ib.option,ib.tbody=ib.tfoot=ib.colgroup=ib.caption=ib.thead,ib.th=ib.td;function jb(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function kb(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function lb(a){var b=gb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function mb(a,b){for(var c=0,d=a.length;d>c;c++)L.set(a[c],"globalEval",!b||L.get(b[c],"globalEval"))}function nb(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(L.hasData(a)&&(f=L.access(a),g=L.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}M.hasData(a)&&(h=M.access(a),i=n.extend({},h),M.set(b,i))}}function ob(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function pb(a,b){var c=b.nodeName.toLowerCase();"input"===c&&T.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}n.extend({clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=ob(h),f=ob(a),d=0,e=f.length;e>d;d++)pb(f[d],g[d]);if(b)if(c)for(f=f||ob(a),g=g||ob(h),d=0,e=f.length;e>d;d++)nb(f[d],g[d]);else nb(a,h);return g=ob(h,"script"),g.length>0&&mb(g,!i&&ob(a,"script")),h},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k=b.createDocumentFragment(),l=[],m=0,o=a.length;o>m;m++)if(e=a[m],e||0===e)if("object"===n.type(e))n.merge(l,e.nodeType?[e]:e);else if(cb.test(e)){f=f||k.appendChild(b.createElement("div")),g=(bb.exec(e)||["",""])[1].toLowerCase(),h=ib[g]||ib._default,f.innerHTML=h[1]+e.replace(ab,"<$1>")+h[2],j=h[0];while(j--)f=f.lastChild;n.merge(l,f.childNodes),f=k.firstChild,f.textContent=""}else l.push(b.createTextNode(e));k.textContent="",m=0;while(e=l[m++])if((!d||-1===n.inArray(e,d))&&(i=n.contains(e.ownerDocument,e),f=ob(k.appendChild(e),"script"),i&&mb(f),c)){j=0;while(e=f[j++])fb.test(e.type||"")&&c.push(e)}return k},cleanData:function(a){for(var b,c,d,e,f=n.event.special,g=0;void 0!==(c=a[g]);g++){if(n.acceptData(c)&&(e=c[L.expando],e&&(b=L.cache[e]))){if(b.events)for(d in b.events)f[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);L.cache[e]&&delete L.cache[e]}delete M.cache[c[M.expando]]}}}),n.fn.extend({text:function(a){return J(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=jb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=jb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(ob(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&mb(ob(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(ob(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return J(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!db.test(a)&&!ib[(bb.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(ab,"<$1>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(ob(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(ob(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,m=this,o=l-1,p=a[0],q=n.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&eb.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(c=n.buildFragment(a,this[0].ownerDocument,!1,this),d=c.firstChild,1===c.childNodes.length&&(c=d),d)){for(f=n.map(ob(c,"script"),kb),g=f.length;l>j;j++)h=c,j!==o&&(h=n.clone(h,!0,!0),g&&n.merge(f,ob(h,"script"))),b.call(this[j],h,j);if(g)for(i=f[f.length-1].ownerDocument,n.map(f,lb),j=0;g>j;j++)h=f[j],fb.test(h.type||"")&&!L.access(h,"globalEval")&&n.contains(i,h)&&(h.src?n._evalUrl&&n._evalUrl(h.src):n.globalEval(h.textContent.replace(hb,"")))}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),g=e.length-1,h=0;g>=h;h++)c=h===g?this:this.clone(!0),n(e[h])[b](c),f.apply(d,c.get());return this.pushStack(d)}});var qb,rb={};function sb(b,c){var d,e=n(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:n.css(e[0],"display");return e.detach(),f}function tb(a){var b=l,c=rb[a];return c||(c=sb(a,b),"none"!==c&&c||(qb=(qb||n("