publify_core 10.0.3 → 11.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +249 -53
- data/app/assets/javascripts/publify.js +0 -1
- data/app/assets/javascripts/publify_admin.js +10 -9
- data/app/assets/stylesheets/accounts.css.scss +0 -2
- data/app/assets/stylesheets/administration_structure.css.scss +0 -4
- data/app/assets/stylesheets/publify.css.scss +0 -1
- data/app/assets/stylesheets/publify_admin.css.scss +0 -2
- data/app/assets/stylesheets/sidebar_admin.css.scss +0 -6
- data/app/controllers/admin/articles_controller.rb +1 -1
- data/app/controllers/admin/base_controller.rb +2 -2
- data/app/controllers/admin/redirects_controller.rb +2 -2
- data/app/controllers/admin/resources_controller.rb +1 -1
- data/app/controllers/admin/seo_controller.rb +2 -2
- data/app/controllers/admin/settings_controller.rb +2 -2
- data/app/controllers/admin/tags_controller.rb +1 -1
- data/app/controllers/admin/users_controller.rb +2 -2
- data/app/controllers/articles_controller.rb +2 -5
- data/app/controllers/authors_controller.rb +0 -2
- data/app/controllers/comments_controller.rb +5 -2
- data/app/controllers/content_controller.rb +0 -4
- data/app/controllers/notes_controller.rb +1 -6
- data/app/controllers/setup_controller.rb +1 -1
- data/app/controllers/tags_controller.rb +0 -1
- data/app/controllers/users/registrations_controller.rb +1 -0
- data/app/helpers/admin/base_helper.rb +20 -13
- data/app/helpers/admin/feedback_helper.rb +4 -4
- data/app/helpers/base_helper.rb +10 -6
- data/app/helpers/xml_helper.rb +4 -0
- data/app/models/article.rb +7 -7
- data/app/models/blog.rb +3 -3
- data/app/models/comment.rb +1 -1
- data/app/models/config_manager.rb +1 -3
- data/app/models/content.rb +4 -5
- data/app/models/content_base.rb +4 -3
- data/app/models/feedback.rb +1 -1
- data/app/models/note.rb +74 -8
- data/app/models/page.rb +1 -1
- data/app/models/redirect.rb +0 -4
- data/app/models/resource.rb +1 -0
- data/app/models/sidebar.rb +6 -14
- data/app/models/tag.rb +2 -2
- data/app/models/text_filter.rb +2 -2
- data/app/models/trigger.rb +1 -1
- data/app/models/user.rb +12 -21
- data/app/uploaders/resource_uploader.rb +11 -4
- data/app/views/admin/articles/_form.html.erb +99 -105
- data/app/views/admin/articles/index.html.erb +15 -23
- data/app/views/admin/dashboard/_comment.html.erb +1 -1
- data/app/views/admin/dashboard/_comments.html.erb +4 -6
- data/app/views/admin/dashboard/_drafts.html.erb +4 -6
- data/app/views/admin/dashboard/_overview.html.erb +2 -5
- data/app/views/admin/dashboard/_welcome.html.erb +19 -19
- data/app/views/admin/dashboard/index.html.erb +3 -3
- data/app/views/admin/feedback/_button.html.erb +7 -13
- data/app/views/admin/feedback/article.html.erb +17 -17
- data/app/views/admin/feedback/edit.html.erb +17 -21
- data/app/views/admin/feedback/index.html.erb +8 -8
- data/app/views/admin/notes/_form.html.erb +5 -5
- data/app/views/admin/notes/_list.html.erb +1 -1
- data/app/views/admin/notes/_note.html.erb +1 -1
- data/app/views/admin/notes/edit.html.erb +1 -1
- data/app/views/admin/notes/index.html.erb +1 -1
- data/app/views/admin/pages/_form.html.erb +23 -27
- data/app/views/admin/post_types/_index_and_form.html.erb +5 -5
- data/app/views/admin/redirects/_index_and_form.html.erb +2 -2
- data/app/views/admin/resources/index.html.erb +20 -8
- data/app/views/admin/seo/_general.html.erb +36 -36
- data/app/views/admin/seo/_permalinks.html.erb +22 -14
- data/app/views/admin/seo/_titles.html.erb +63 -63
- data/app/views/admin/settings/display.html.erb +23 -23
- data/app/views/admin/settings/feedback.html.erb +29 -29
- data/app/views/admin/settings/index.html.erb +21 -21
- data/app/views/admin/settings/write.html.erb +18 -18
- data/app/views/admin/shared/_flash.html.erb +6 -0
- data/app/views/admin/shared/_menu.html.erb +56 -68
- data/app/views/admin/sidebar/_config.html.erb +15 -19
- data/app/views/admin/sidebar/_target.html.erb +3 -3
- data/app/views/admin/sidebar/_target_sidebar.html.erb +14 -13
- data/app/views/admin/sidebar/index.html.erb +2 -2
- data/app/views/admin/tags/_index_and_form.html.erb +3 -3
- data/app/views/admin/themes/index.html.erb +21 -19
- data/app/views/admin/users/_form.html.erb +79 -79
- data/app/views/articles/search.html.erb +1 -1
- data/app/views/layouts/accounts.html.erb +7 -9
- data/app/views/layouts/administration.html.erb +2 -2
- data/app/views/notes/show.html.erb +15 -0
- data/app/views/setup/index.html.erb +1 -1
- data/app/views/shared/_atom_item_article.atom.builder +1 -3
- data/app/views/shared/_rss_item_article.rss.builder +1 -2
- data/config/i18n-tasks.yml +0 -1
- data/config/locales/ar.yml +3 -2
- data/config/locales/da.yml +3 -2
- data/config/locales/de.yml +3 -2
- data/config/locales/en.yml +3 -2
- data/config/locales/es-MX.yml +3 -2
- data/config/locales/fr.yml +3 -2
- data/config/locales/he.yml +3 -2
- data/config/locales/it.yml +3 -2
- data/config/locales/ja.yml +3 -2
- data/config/locales/lt.yml +3 -2
- data/config/locales/nb.yml +3 -2
- data/config/locales/nl.yml +3 -2
- data/config/locales/pl.yml +3 -2
- data/config/locales/pt-BR.yml +3 -2
- data/config/locales/ro.yml +3 -2
- data/config/locales/ru.yml +3 -2
- data/config/locales/zh-CN.yml +3 -2
- data/config/locales/zh-TW.yml +3 -2
- data/config/routes.rb +0 -11
- data/db/migrate/114_fixes_buggy_articles_and_notes.rb +2 -2
- data/db/migrate/20150807134129_simplify_redirect_relations.rb +1 -1
- data/db/migrate/20160605154632_remove_profiles.rb +1 -1
- data/db/migrate/20190208152646_move_text_filter_to_name.rb +2 -2
- data/lib/format.rb +2 -2
- data/lib/publify_core/engine.rb +10 -0
- data/lib/publify_core/string_ext.rb +1 -13
- data/lib/publify_core/testing_support/fixtures/like_plain.html +2 -0
- data/lib/publify_core/text_filter/markdown.rb +5 -1
- data/lib/publify_core/text_filter/markdown_smartquotes.rb +6 -1
- data/lib/publify_core/version.rb +1 -1
- data/lib/publify_core.rb +2 -2
- data/lib/text_filter_plugin.rb +20 -22
- data/lib/theme.rb +56 -37
- metadata +101 -397
- data/app/assets/javascripts/bootstrap/affix.js +0 -164
- data/app/assets/javascripts/bootstrap/alert.js +0 -95
- data/app/assets/javascripts/bootstrap/button.js +0 -125
- data/app/assets/javascripts/bootstrap/collapse.js +0 -212
- data/app/assets/javascripts/bootstrap/dropdown.js +0 -165
- data/app/assets/javascripts/bootstrap/modal.js +0 -358
- data/app/assets/javascripts/bootstrap/tab.js +0 -155
- data/app/assets/javascripts/bootstrap/transition.js +0 -59
- data/app/assets/javascripts/bootstrap-sprockets.js +0 -8
- data/app/assets/javascripts/lightbox.js +0 -350
- data/app/assets/stylesheets/_bootstrap-compass.scss +0 -9
- data/app/assets/stylesheets/_bootstrap-mincer.scss +0 -19
- data/app/assets/stylesheets/_bootstrap-sprockets.scss +0 -9
- data/app/assets/stylesheets/_bootstrap.scss +0 -42
- data/app/assets/stylesheets/bootstrap/_alerts.scss +0 -73
- data/app/assets/stylesheets/bootstrap/_button-groups.scss +0 -242
- data/app/assets/stylesheets/bootstrap/_buttons.scss +0 -168
- data/app/assets/stylesheets/bootstrap/_close.scss +0 -37
- data/app/assets/stylesheets/bootstrap/_code.scss +0 -69
- data/app/assets/stylesheets/bootstrap/_component-animations.scss +0 -38
- data/app/assets/stylesheets/bootstrap/_dropdowns.scss +0 -213
- data/app/assets/stylesheets/bootstrap/_forms.scss +0 -586
- data/app/assets/stylesheets/bootstrap/_grid.scss +0 -94
- data/app/assets/stylesheets/bootstrap/_labels.scss +0 -66
- data/app/assets/stylesheets/bootstrap/_media.scss +0 -66
- data/app/assets/stylesheets/bootstrap/_mixins.scss +0 -37
- data/app/assets/stylesheets/bootstrap/_modals.scss +0 -150
- data/app/assets/stylesheets/bootstrap/_navbar.scss +0 -479
- data/app/assets/stylesheets/bootstrap/_navs.scss +0 -242
- data/app/assets/stylesheets/bootstrap/_normalize.scss +0 -427
- data/app/assets/stylesheets/bootstrap/_pagination.scss +0 -86
- data/app/assets/stylesheets/bootstrap/_panels.scss +0 -222
- data/app/assets/stylesheets/bootstrap/_print.scss +0 -99
- data/app/assets/stylesheets/bootstrap/_scaffolding.scss +0 -160
- data/app/assets/stylesheets/bootstrap/_tables.scss +0 -234
- data/app/assets/stylesheets/bootstrap/_theme.scss +0 -224
- data/app/assets/stylesheets/bootstrap/_type.scss +0 -296
- data/app/assets/stylesheets/bootstrap/_utilities.scss +0 -55
- data/app/assets/stylesheets/bootstrap/_variables.scss +0 -638
- data/app/assets/stylesheets/bootstrap/_wells.scss +0 -29
- data/app/assets/stylesheets/bootstrap/mixins/_alerts.scss +0 -15
- data/app/assets/stylesheets/bootstrap/mixins/_background-variant.scss +0 -12
- data/app/assets/stylesheets/bootstrap/mixins/_border-radius.scss +0 -18
- data/app/assets/stylesheets/bootstrap/mixins/_buttons.scss +0 -56
- data/app/assets/stylesheets/bootstrap/mixins/_center-block.scss +0 -7
- data/app/assets/stylesheets/bootstrap/mixins/_clearfix.scss +0 -22
- data/app/assets/stylesheets/bootstrap/mixins/_forms.scss +0 -82
- data/app/assets/stylesheets/bootstrap/mixins/_gradients.scss +0 -56
- data/app/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +0 -81
- data/app/assets/stylesheets/bootstrap/mixins/_grid.scss +0 -122
- data/app/assets/stylesheets/bootstrap/mixins/_hide-text.scss +0 -21
- data/app/assets/stylesheets/bootstrap/mixins/_image.scss +0 -28
- data/app/assets/stylesheets/bootstrap/mixins/_labels.scss +0 -12
- data/app/assets/stylesheets/bootstrap/mixins/_nav-divider.scss +0 -10
- data/app/assets/stylesheets/bootstrap/mixins/_nav-vertical-align.scss +0 -9
- data/app/assets/stylesheets/bootstrap/mixins/_opacity.scss +0 -7
- data/app/assets/stylesheets/bootstrap/mixins/_pagination.scss +0 -24
- data/app/assets/stylesheets/bootstrap/mixins/_panels.scss +0 -20
- data/app/assets/stylesheets/bootstrap/mixins/_reset-filter.scss +0 -8
- data/app/assets/stylesheets/bootstrap/mixins/_resize.scss +0 -6
- data/app/assets/stylesheets/bootstrap/mixins/_responsive-visibility.scss +0 -17
- data/app/assets/stylesheets/bootstrap/mixins/_size.scss +0 -10
- data/app/assets/stylesheets/bootstrap/mixins/_tab-focus.scss +0 -9
- data/app/assets/stylesheets/bootstrap/mixins/_table-row.scss +0 -28
- data/app/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +0 -12
- data/app/assets/stylesheets/bootstrap/mixins/_text-overflow.scss +0 -8
- data/app/assets/stylesheets/bootstrap/mixins/_vendor-prefixes.scss +0 -222
- data/app/assets/stylesheets/lightbox.css +0 -63
- data/app/controllers/theme_controller.rb +0 -63
- data/app/views/notes/show_in_reply.html.erb +0 -18
- data/app/views/theme/static_view_test.html.erb +0 -1
- data/lib/publify_core/text_filter/twitterfilter.rb +0 -55
- data/lib/tasks/manifest.rake +0 -30
- /data/app/views/layouts/{default.html.erb → application.html.erb} +0 -0
- /data/themes/plain/javascripts/{theme.js → plain/theme.js} +0 -0
- /data/themes/plain/stylesheets/{theme.css → plain/theme.css} +0 -0
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
/* ========================================================================
|
|
2
|
-
* Bootstrap: dropdown.js v3.4.1
|
|
3
|
-
* https://getbootstrap.com/docs/3.4/javascript/#dropdowns
|
|
4
|
-
* ========================================================================
|
|
5
|
-
* Copyright 2011-2019 Twitter, Inc.
|
|
6
|
-
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
|
7
|
-
* ======================================================================== */
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
+function ($) {
|
|
11
|
-
'use strict';
|
|
12
|
-
|
|
13
|
-
// DROPDOWN CLASS DEFINITION
|
|
14
|
-
// =========================
|
|
15
|
-
|
|
16
|
-
var backdrop = '.dropdown-backdrop'
|
|
17
|
-
var toggle = '[data-toggle="dropdown"]'
|
|
18
|
-
var Dropdown = function (element) {
|
|
19
|
-
$(element).on('click.bs.dropdown', this.toggle)
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
Dropdown.VERSION = '3.4.1'
|
|
23
|
-
|
|
24
|
-
function getParent($this) {
|
|
25
|
-
var selector = $this.attr('data-target')
|
|
26
|
-
|
|
27
|
-
if (!selector) {
|
|
28
|
-
selector = $this.attr('href')
|
|
29
|
-
selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
var $parent = selector !== '#' ? $(document).find(selector) : null
|
|
33
|
-
|
|
34
|
-
return $parent && $parent.length ? $parent : $this.parent()
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function clearMenus(e) {
|
|
38
|
-
if (e && e.which === 3) return
|
|
39
|
-
$(backdrop).remove()
|
|
40
|
-
$(toggle).each(function () {
|
|
41
|
-
var $this = $(this)
|
|
42
|
-
var $parent = getParent($this)
|
|
43
|
-
var relatedTarget = { relatedTarget: this }
|
|
44
|
-
|
|
45
|
-
if (!$parent.hasClass('open')) return
|
|
46
|
-
|
|
47
|
-
if (e && e.type == 'click' && /input|textarea/i.test(e.target.tagName) && $.contains($parent[0], e.target)) return
|
|
48
|
-
|
|
49
|
-
$parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
|
|
50
|
-
|
|
51
|
-
if (e.isDefaultPrevented()) return
|
|
52
|
-
|
|
53
|
-
$this.attr('aria-expanded', 'false')
|
|
54
|
-
$parent.removeClass('open').trigger($.Event('hidden.bs.dropdown', relatedTarget))
|
|
55
|
-
})
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
Dropdown.prototype.toggle = function (e) {
|
|
59
|
-
var $this = $(this)
|
|
60
|
-
|
|
61
|
-
if ($this.is('.disabled, :disabled')) return
|
|
62
|
-
|
|
63
|
-
var $parent = getParent($this)
|
|
64
|
-
var isActive = $parent.hasClass('open')
|
|
65
|
-
|
|
66
|
-
clearMenus()
|
|
67
|
-
|
|
68
|
-
if (!isActive) {
|
|
69
|
-
if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
|
|
70
|
-
// if mobile we use a backdrop because click events don't delegate
|
|
71
|
-
$(document.createElement('div'))
|
|
72
|
-
.addClass('dropdown-backdrop')
|
|
73
|
-
.insertAfter($(this))
|
|
74
|
-
.on('click', clearMenus)
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
var relatedTarget = { relatedTarget: this }
|
|
78
|
-
$parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))
|
|
79
|
-
|
|
80
|
-
if (e.isDefaultPrevented()) return
|
|
81
|
-
|
|
82
|
-
$this
|
|
83
|
-
.trigger('focus')
|
|
84
|
-
.attr('aria-expanded', 'true')
|
|
85
|
-
|
|
86
|
-
$parent
|
|
87
|
-
.toggleClass('open')
|
|
88
|
-
.trigger($.Event('shown.bs.dropdown', relatedTarget))
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
return false
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
Dropdown.prototype.keydown = function (e) {
|
|
95
|
-
if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return
|
|
96
|
-
|
|
97
|
-
var $this = $(this)
|
|
98
|
-
|
|
99
|
-
e.preventDefault()
|
|
100
|
-
e.stopPropagation()
|
|
101
|
-
|
|
102
|
-
if ($this.is('.disabled, :disabled')) return
|
|
103
|
-
|
|
104
|
-
var $parent = getParent($this)
|
|
105
|
-
var isActive = $parent.hasClass('open')
|
|
106
|
-
|
|
107
|
-
if (!isActive && e.which != 27 || isActive && e.which == 27) {
|
|
108
|
-
if (e.which == 27) $parent.find(toggle).trigger('focus')
|
|
109
|
-
return $this.trigger('click')
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
var desc = ' li:not(.disabled):visible a'
|
|
113
|
-
var $items = $parent.find('.dropdown-menu' + desc)
|
|
114
|
-
|
|
115
|
-
if (!$items.length) return
|
|
116
|
-
|
|
117
|
-
var index = $items.index(e.target)
|
|
118
|
-
|
|
119
|
-
if (e.which == 38 && index > 0) index-- // up
|
|
120
|
-
if (e.which == 40 && index < $items.length - 1) index++ // down
|
|
121
|
-
if (!~index) index = 0
|
|
122
|
-
|
|
123
|
-
$items.eq(index).trigger('focus')
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
// DROPDOWN PLUGIN DEFINITION
|
|
128
|
-
// ==========================
|
|
129
|
-
|
|
130
|
-
function Plugin(option) {
|
|
131
|
-
return this.each(function () {
|
|
132
|
-
var $this = $(this)
|
|
133
|
-
var data = $this.data('bs.dropdown')
|
|
134
|
-
|
|
135
|
-
if (!data) $this.data('bs.dropdown', (data = new Dropdown(this)))
|
|
136
|
-
if (typeof option == 'string') data[option].call($this)
|
|
137
|
-
})
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
var old = $.fn.dropdown
|
|
141
|
-
|
|
142
|
-
$.fn.dropdown = Plugin
|
|
143
|
-
$.fn.dropdown.Constructor = Dropdown
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
// DROPDOWN NO CONFLICT
|
|
147
|
-
// ====================
|
|
148
|
-
|
|
149
|
-
$.fn.dropdown.noConflict = function () {
|
|
150
|
-
$.fn.dropdown = old
|
|
151
|
-
return this
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
// APPLY TO STANDARD DROPDOWN ELEMENTS
|
|
156
|
-
// ===================================
|
|
157
|
-
|
|
158
|
-
$(document)
|
|
159
|
-
.on('click.bs.dropdown.data-api', clearMenus)
|
|
160
|
-
.on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
|
|
161
|
-
.on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
|
|
162
|
-
.on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown)
|
|
163
|
-
.on('keydown.bs.dropdown.data-api', '.dropdown-menu', Dropdown.prototype.keydown)
|
|
164
|
-
|
|
165
|
-
}(jQuery);
|
|
@@ -1,358 +0,0 @@
|
|
|
1
|
-
/* ========================================================================
|
|
2
|
-
* Bootstrap: modal.js v3.4.1
|
|
3
|
-
* https://getbootstrap.com/docs/3.4/javascript/#modals
|
|
4
|
-
* ========================================================================
|
|
5
|
-
* Copyright 2011-2019 Twitter, Inc.
|
|
6
|
-
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
|
7
|
-
* ======================================================================== */
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
+function ($) {
|
|
11
|
-
'use strict';
|
|
12
|
-
|
|
13
|
-
// MODAL CLASS DEFINITION
|
|
14
|
-
// ======================
|
|
15
|
-
|
|
16
|
-
var Modal = function (element, options) {
|
|
17
|
-
this.options = options
|
|
18
|
-
this.$body = $(document.body)
|
|
19
|
-
this.$element = $(element)
|
|
20
|
-
this.$dialog = this.$element.find('.modal-dialog')
|
|
21
|
-
this.$backdrop = null
|
|
22
|
-
this.isShown = null
|
|
23
|
-
this.originalBodyPad = null
|
|
24
|
-
this.scrollbarWidth = 0
|
|
25
|
-
this.ignoreBackdropClick = false
|
|
26
|
-
this.fixedContent = '.navbar-fixed-top, .navbar-fixed-bottom'
|
|
27
|
-
|
|
28
|
-
if (this.options.remote) {
|
|
29
|
-
this.$element
|
|
30
|
-
.find('.modal-content')
|
|
31
|
-
.load(this.options.remote, $.proxy(function () {
|
|
32
|
-
this.$element.trigger('loaded.bs.modal')
|
|
33
|
-
}, this))
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
Modal.VERSION = '3.4.1'
|
|
38
|
-
|
|
39
|
-
Modal.TRANSITION_DURATION = 300
|
|
40
|
-
Modal.BACKDROP_TRANSITION_DURATION = 150
|
|
41
|
-
|
|
42
|
-
Modal.DEFAULTS = {
|
|
43
|
-
backdrop: true,
|
|
44
|
-
keyboard: true,
|
|
45
|
-
show: true
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
Modal.prototype.toggle = function (_relatedTarget) {
|
|
49
|
-
return this.isShown ? this.hide() : this.show(_relatedTarget)
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
Modal.prototype.show = function (_relatedTarget) {
|
|
53
|
-
var that = this
|
|
54
|
-
var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
|
|
55
|
-
|
|
56
|
-
this.$element.trigger(e)
|
|
57
|
-
|
|
58
|
-
if (this.isShown || e.isDefaultPrevented()) return
|
|
59
|
-
|
|
60
|
-
this.isShown = true
|
|
61
|
-
|
|
62
|
-
this.checkScrollbar()
|
|
63
|
-
this.setScrollbar()
|
|
64
|
-
this.$body.addClass('modal-open')
|
|
65
|
-
|
|
66
|
-
this.escape()
|
|
67
|
-
this.resize()
|
|
68
|
-
|
|
69
|
-
this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
|
|
70
|
-
|
|
71
|
-
this.$dialog.on('mousedown.dismiss.bs.modal', function () {
|
|
72
|
-
that.$element.one('mouseup.dismiss.bs.modal', function (e) {
|
|
73
|
-
if ($(e.target).is(that.$element)) that.ignoreBackdropClick = true
|
|
74
|
-
})
|
|
75
|
-
})
|
|
76
|
-
|
|
77
|
-
this.backdrop(function () {
|
|
78
|
-
var transition = $.support.transition && that.$element.hasClass('fade')
|
|
79
|
-
|
|
80
|
-
if (!that.$element.parent().length) {
|
|
81
|
-
that.$element.appendTo(that.$body) // don't move modals dom position
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
that.$element
|
|
85
|
-
.show()
|
|
86
|
-
.scrollTop(0)
|
|
87
|
-
|
|
88
|
-
that.adjustDialog()
|
|
89
|
-
|
|
90
|
-
if (transition) {
|
|
91
|
-
that.$element[0].offsetWidth // force reflow
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
that.$element.addClass('in')
|
|
95
|
-
|
|
96
|
-
that.enforceFocus()
|
|
97
|
-
|
|
98
|
-
var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
|
|
99
|
-
|
|
100
|
-
transition ?
|
|
101
|
-
that.$dialog // wait for modal to slide in
|
|
102
|
-
.one('bsTransitionEnd', function () {
|
|
103
|
-
that.$element.trigger('focus').trigger(e)
|
|
104
|
-
})
|
|
105
|
-
.emulateTransitionEnd(Modal.TRANSITION_DURATION) :
|
|
106
|
-
that.$element.trigger('focus').trigger(e)
|
|
107
|
-
})
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
Modal.prototype.hide = function (e) {
|
|
111
|
-
if (e) e.preventDefault()
|
|
112
|
-
|
|
113
|
-
e = $.Event('hide.bs.modal')
|
|
114
|
-
|
|
115
|
-
this.$element.trigger(e)
|
|
116
|
-
|
|
117
|
-
if (!this.isShown || e.isDefaultPrevented()) return
|
|
118
|
-
|
|
119
|
-
this.isShown = false
|
|
120
|
-
|
|
121
|
-
this.escape()
|
|
122
|
-
this.resize()
|
|
123
|
-
|
|
124
|
-
$(document).off('focusin.bs.modal')
|
|
125
|
-
|
|
126
|
-
this.$element
|
|
127
|
-
.removeClass('in')
|
|
128
|
-
.off('click.dismiss.bs.modal')
|
|
129
|
-
.off('mouseup.dismiss.bs.modal')
|
|
130
|
-
|
|
131
|
-
this.$dialog.off('mousedown.dismiss.bs.modal')
|
|
132
|
-
|
|
133
|
-
$.support.transition && this.$element.hasClass('fade') ?
|
|
134
|
-
this.$element
|
|
135
|
-
.one('bsTransitionEnd', $.proxy(this.hideModal, this))
|
|
136
|
-
.emulateTransitionEnd(Modal.TRANSITION_DURATION) :
|
|
137
|
-
this.hideModal()
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
Modal.prototype.enforceFocus = function () {
|
|
141
|
-
$(document)
|
|
142
|
-
.off('focusin.bs.modal') // guard against infinite focus loop
|
|
143
|
-
.on('focusin.bs.modal', $.proxy(function (e) {
|
|
144
|
-
if (document !== e.target &&
|
|
145
|
-
this.$element[0] !== e.target &&
|
|
146
|
-
!this.$element.has(e.target).length) {
|
|
147
|
-
this.$element.trigger('focus')
|
|
148
|
-
}
|
|
149
|
-
}, this))
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
Modal.prototype.escape = function () {
|
|
153
|
-
if (this.isShown && this.options.keyboard) {
|
|
154
|
-
this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e) {
|
|
155
|
-
e.which == 27 && this.hide()
|
|
156
|
-
}, this))
|
|
157
|
-
} else if (!this.isShown) {
|
|
158
|
-
this.$element.off('keydown.dismiss.bs.modal')
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
Modal.prototype.resize = function () {
|
|
163
|
-
if (this.isShown) {
|
|
164
|
-
$(window).on('resize.bs.modal', $.proxy(this.handleUpdate, this))
|
|
165
|
-
} else {
|
|
166
|
-
$(window).off('resize.bs.modal')
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
Modal.prototype.hideModal = function () {
|
|
171
|
-
var that = this
|
|
172
|
-
this.$element.hide()
|
|
173
|
-
this.backdrop(function () {
|
|
174
|
-
that.$body.removeClass('modal-open')
|
|
175
|
-
that.resetAdjustments()
|
|
176
|
-
that.resetScrollbar()
|
|
177
|
-
that.$element.trigger('hidden.bs.modal')
|
|
178
|
-
})
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
Modal.prototype.removeBackdrop = function () {
|
|
182
|
-
this.$backdrop && this.$backdrop.remove()
|
|
183
|
-
this.$backdrop = null
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
Modal.prototype.backdrop = function (callback) {
|
|
187
|
-
var that = this
|
|
188
|
-
var animate = this.$element.hasClass('fade') ? 'fade' : ''
|
|
189
|
-
|
|
190
|
-
if (this.isShown && this.options.backdrop) {
|
|
191
|
-
var doAnimate = $.support.transition && animate
|
|
192
|
-
|
|
193
|
-
this.$backdrop = $(document.createElement('div'))
|
|
194
|
-
.addClass('modal-backdrop ' + animate)
|
|
195
|
-
.appendTo(this.$body)
|
|
196
|
-
|
|
197
|
-
this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
|
|
198
|
-
if (this.ignoreBackdropClick) {
|
|
199
|
-
this.ignoreBackdropClick = false
|
|
200
|
-
return
|
|
201
|
-
}
|
|
202
|
-
if (e.target !== e.currentTarget) return
|
|
203
|
-
this.options.backdrop == 'static'
|
|
204
|
-
? this.$element[0].focus()
|
|
205
|
-
: this.hide()
|
|
206
|
-
}, this))
|
|
207
|
-
|
|
208
|
-
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
|
|
209
|
-
|
|
210
|
-
this.$backdrop.addClass('in')
|
|
211
|
-
|
|
212
|
-
if (!callback) return
|
|
213
|
-
|
|
214
|
-
doAnimate ?
|
|
215
|
-
this.$backdrop
|
|
216
|
-
.one('bsTransitionEnd', callback)
|
|
217
|
-
.emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
|
|
218
|
-
callback()
|
|
219
|
-
|
|
220
|
-
} else if (!this.isShown && this.$backdrop) {
|
|
221
|
-
this.$backdrop.removeClass('in')
|
|
222
|
-
|
|
223
|
-
var callbackRemove = function () {
|
|
224
|
-
that.removeBackdrop()
|
|
225
|
-
callback && callback()
|
|
226
|
-
}
|
|
227
|
-
$.support.transition && this.$element.hasClass('fade') ?
|
|
228
|
-
this.$backdrop
|
|
229
|
-
.one('bsTransitionEnd', callbackRemove)
|
|
230
|
-
.emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
|
|
231
|
-
callbackRemove()
|
|
232
|
-
|
|
233
|
-
} else if (callback) {
|
|
234
|
-
callback()
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
// these following methods are used to handle overflowing modals
|
|
239
|
-
|
|
240
|
-
Modal.prototype.handleUpdate = function () {
|
|
241
|
-
this.adjustDialog()
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
Modal.prototype.adjustDialog = function () {
|
|
245
|
-
var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight
|
|
246
|
-
|
|
247
|
-
this.$element.css({
|
|
248
|
-
paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '',
|
|
249
|
-
paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : ''
|
|
250
|
-
})
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
Modal.prototype.resetAdjustments = function () {
|
|
254
|
-
this.$element.css({
|
|
255
|
-
paddingLeft: '',
|
|
256
|
-
paddingRight: ''
|
|
257
|
-
})
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
Modal.prototype.checkScrollbar = function () {
|
|
261
|
-
var fullWindowWidth = window.innerWidth
|
|
262
|
-
if (!fullWindowWidth) { // workaround for missing window.innerWidth in IE8
|
|
263
|
-
var documentElementRect = document.documentElement.getBoundingClientRect()
|
|
264
|
-
fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left)
|
|
265
|
-
}
|
|
266
|
-
this.bodyIsOverflowing = document.body.clientWidth < fullWindowWidth
|
|
267
|
-
this.scrollbarWidth = this.measureScrollbar()
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
Modal.prototype.setScrollbar = function () {
|
|
271
|
-
var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10)
|
|
272
|
-
this.originalBodyPad = document.body.style.paddingRight || ''
|
|
273
|
-
var scrollbarWidth = this.scrollbarWidth
|
|
274
|
-
if (this.bodyIsOverflowing) {
|
|
275
|
-
this.$body.css('padding-right', bodyPad + scrollbarWidth)
|
|
276
|
-
$(this.fixedContent).each(function (index, element) {
|
|
277
|
-
var actualPadding = element.style.paddingRight
|
|
278
|
-
var calculatedPadding = $(element).css('padding-right')
|
|
279
|
-
$(element)
|
|
280
|
-
.data('padding-right', actualPadding)
|
|
281
|
-
.css('padding-right', parseFloat(calculatedPadding) + scrollbarWidth + 'px')
|
|
282
|
-
})
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
Modal.prototype.resetScrollbar = function () {
|
|
287
|
-
this.$body.css('padding-right', this.originalBodyPad)
|
|
288
|
-
$(this.fixedContent).each(function (index, element) {
|
|
289
|
-
var padding = $(element).data('padding-right')
|
|
290
|
-
$(element).removeData('padding-right')
|
|
291
|
-
element.style.paddingRight = padding ? padding : ''
|
|
292
|
-
})
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
Modal.prototype.measureScrollbar = function () { // thx walsh
|
|
296
|
-
var scrollDiv = document.createElement('div')
|
|
297
|
-
scrollDiv.className = 'modal-scrollbar-measure'
|
|
298
|
-
this.$body.append(scrollDiv)
|
|
299
|
-
var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth
|
|
300
|
-
this.$body[0].removeChild(scrollDiv)
|
|
301
|
-
return scrollbarWidth
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
// MODAL PLUGIN DEFINITION
|
|
306
|
-
// =======================
|
|
307
|
-
|
|
308
|
-
function Plugin(option, _relatedTarget) {
|
|
309
|
-
return this.each(function () {
|
|
310
|
-
var $this = $(this)
|
|
311
|
-
var data = $this.data('bs.modal')
|
|
312
|
-
var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
|
|
313
|
-
|
|
314
|
-
if (!data) $this.data('bs.modal', (data = new Modal(this, options)))
|
|
315
|
-
if (typeof option == 'string') data[option](_relatedTarget)
|
|
316
|
-
else if (options.show) data.show(_relatedTarget)
|
|
317
|
-
})
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
var old = $.fn.modal
|
|
321
|
-
|
|
322
|
-
$.fn.modal = Plugin
|
|
323
|
-
$.fn.modal.Constructor = Modal
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
// MODAL NO CONFLICT
|
|
327
|
-
// =================
|
|
328
|
-
|
|
329
|
-
$.fn.modal.noConflict = function () {
|
|
330
|
-
$.fn.modal = old
|
|
331
|
-
return this
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
// MODAL DATA-API
|
|
336
|
-
// ==============
|
|
337
|
-
|
|
338
|
-
$(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
|
|
339
|
-
var $this = $(this)
|
|
340
|
-
var href = $this.attr('href')
|
|
341
|
-
var target = $this.attr('data-target') ||
|
|
342
|
-
(href && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7
|
|
343
|
-
|
|
344
|
-
var $target = $(document).find(target)
|
|
345
|
-
var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
|
|
346
|
-
|
|
347
|
-
if ($this.is('a')) e.preventDefault()
|
|
348
|
-
|
|
349
|
-
$target.one('show.bs.modal', function (showEvent) {
|
|
350
|
-
if (showEvent.isDefaultPrevented()) return // only register focus restorer if modal will actually get shown
|
|
351
|
-
$target.one('hidden.bs.modal', function () {
|
|
352
|
-
$this.is(':visible') && $this.trigger('focus')
|
|
353
|
-
})
|
|
354
|
-
})
|
|
355
|
-
Plugin.call($target, option, this)
|
|
356
|
-
})
|
|
357
|
-
|
|
358
|
-
}(jQuery);
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
/* ========================================================================
|
|
2
|
-
* Bootstrap: tab.js v3.4.1
|
|
3
|
-
* https://getbootstrap.com/docs/3.4/javascript/#tabs
|
|
4
|
-
* ========================================================================
|
|
5
|
-
* Copyright 2011-2019 Twitter, Inc.
|
|
6
|
-
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
|
7
|
-
* ======================================================================== */
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
+function ($) {
|
|
11
|
-
'use strict';
|
|
12
|
-
|
|
13
|
-
// TAB CLASS DEFINITION
|
|
14
|
-
// ====================
|
|
15
|
-
|
|
16
|
-
var Tab = function (element) {
|
|
17
|
-
// jscs:disable requireDollarBeforejQueryAssignment
|
|
18
|
-
this.element = $(element)
|
|
19
|
-
// jscs:enable requireDollarBeforejQueryAssignment
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
Tab.VERSION = '3.4.1'
|
|
23
|
-
|
|
24
|
-
Tab.TRANSITION_DURATION = 150
|
|
25
|
-
|
|
26
|
-
Tab.prototype.show = function () {
|
|
27
|
-
var $this = this.element
|
|
28
|
-
var $ul = $this.closest('ul:not(.dropdown-menu)')
|
|
29
|
-
var selector = $this.data('target')
|
|
30
|
-
|
|
31
|
-
if (!selector) {
|
|
32
|
-
selector = $this.attr('href')
|
|
33
|
-
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
if ($this.parent('li').hasClass('active')) return
|
|
37
|
-
|
|
38
|
-
var $previous = $ul.find('.active:last a')
|
|
39
|
-
var hideEvent = $.Event('hide.bs.tab', {
|
|
40
|
-
relatedTarget: $this[0]
|
|
41
|
-
})
|
|
42
|
-
var showEvent = $.Event('show.bs.tab', {
|
|
43
|
-
relatedTarget: $previous[0]
|
|
44
|
-
})
|
|
45
|
-
|
|
46
|
-
$previous.trigger(hideEvent)
|
|
47
|
-
$this.trigger(showEvent)
|
|
48
|
-
|
|
49
|
-
if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) return
|
|
50
|
-
|
|
51
|
-
var $target = $(document).find(selector)
|
|
52
|
-
|
|
53
|
-
this.activate($this.closest('li'), $ul)
|
|
54
|
-
this.activate($target, $target.parent(), function () {
|
|
55
|
-
$previous.trigger({
|
|
56
|
-
type: 'hidden.bs.tab',
|
|
57
|
-
relatedTarget: $this[0]
|
|
58
|
-
})
|
|
59
|
-
$this.trigger({
|
|
60
|
-
type: 'shown.bs.tab',
|
|
61
|
-
relatedTarget: $previous[0]
|
|
62
|
-
})
|
|
63
|
-
})
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
Tab.prototype.activate = function (element, container, callback) {
|
|
67
|
-
var $active = container.find('> .active')
|
|
68
|
-
var transition = callback
|
|
69
|
-
&& $.support.transition
|
|
70
|
-
&& ($active.length && $active.hasClass('fade') || !!container.find('> .fade').length)
|
|
71
|
-
|
|
72
|
-
function next() {
|
|
73
|
-
$active
|
|
74
|
-
.removeClass('active')
|
|
75
|
-
.find('> .dropdown-menu > .active')
|
|
76
|
-
.removeClass('active')
|
|
77
|
-
.end()
|
|
78
|
-
.find('[data-toggle="tab"]')
|
|
79
|
-
.attr('aria-expanded', false)
|
|
80
|
-
|
|
81
|
-
element
|
|
82
|
-
.addClass('active')
|
|
83
|
-
.find('[data-toggle="tab"]')
|
|
84
|
-
.attr('aria-expanded', true)
|
|
85
|
-
|
|
86
|
-
if (transition) {
|
|
87
|
-
element[0].offsetWidth // reflow for transition
|
|
88
|
-
element.addClass('in')
|
|
89
|
-
} else {
|
|
90
|
-
element.removeClass('fade')
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
if (element.parent('.dropdown-menu').length) {
|
|
94
|
-
element
|
|
95
|
-
.closest('li.dropdown')
|
|
96
|
-
.addClass('active')
|
|
97
|
-
.end()
|
|
98
|
-
.find('[data-toggle="tab"]')
|
|
99
|
-
.attr('aria-expanded', true)
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
callback && callback()
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
$active.length && transition ?
|
|
106
|
-
$active
|
|
107
|
-
.one('bsTransitionEnd', next)
|
|
108
|
-
.emulateTransitionEnd(Tab.TRANSITION_DURATION) :
|
|
109
|
-
next()
|
|
110
|
-
|
|
111
|
-
$active.removeClass('in')
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
// TAB PLUGIN DEFINITION
|
|
116
|
-
// =====================
|
|
117
|
-
|
|
118
|
-
function Plugin(option) {
|
|
119
|
-
return this.each(function () {
|
|
120
|
-
var $this = $(this)
|
|
121
|
-
var data = $this.data('bs.tab')
|
|
122
|
-
|
|
123
|
-
if (!data) $this.data('bs.tab', (data = new Tab(this)))
|
|
124
|
-
if (typeof option == 'string') data[option]()
|
|
125
|
-
})
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
var old = $.fn.tab
|
|
129
|
-
|
|
130
|
-
$.fn.tab = Plugin
|
|
131
|
-
$.fn.tab.Constructor = Tab
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
// TAB NO CONFLICT
|
|
135
|
-
// ===============
|
|
136
|
-
|
|
137
|
-
$.fn.tab.noConflict = function () {
|
|
138
|
-
$.fn.tab = old
|
|
139
|
-
return this
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
// TAB DATA-API
|
|
144
|
-
// ============
|
|
145
|
-
|
|
146
|
-
var clickHandler = function (e) {
|
|
147
|
-
e.preventDefault()
|
|
148
|
-
Plugin.call($(this), 'show')
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
$(document)
|
|
152
|
-
.on('click.bs.tab.data-api', '[data-toggle="tab"]', clickHandler)
|
|
153
|
-
.on('click.bs.tab.data-api', '[data-toggle="pill"]', clickHandler)
|
|
154
|
-
|
|
155
|
-
}(jQuery);
|