aerogel-pages 1.4.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +14 -0
- data/Rakefile +1 -0
- data/aerogel-pages.gemspec +26 -0
- data/app/helpers/README.md +7 -0
- data/app/helpers/decorators.rb +74 -0
- data/app/helpers/pages.rb +32 -0
- data/app/routes/admin-pages.rb +150 -0
- data/app/routes/pages.rb +16 -0
- data/assets/javascripts/admin-pages/pages-widget.js.coffee +83 -0
- data/assets/javascripts/admin-pages/pane-preview.js.coffee +37 -0
- data/assets/javascripts/admin-pages/pane-tree.js.coffee +105 -0
- data/assets/javascripts/admin-pages-edit/admin-modal-select.js.coffee +63 -0
- data/assets/javascripts/admin-pages-edit/datetime-picker-field.js.coffee +36 -0
- data/assets/javascripts/admin-pages-edit/page-blocks.js.coffee +71 -0
- data/assets/javascripts/admin-pages-edit/page-content-tabs.js.coffee +40 -0
- data/assets/javascripts/admin-pages-utils/attached-footer.js.coffee +62 -0
- data/assets/javascripts/admin-pages-utils/autofixed-height.js.coffee +15 -0
- data/assets/javascripts/admin-pages-utils/two-pane-widget.js.coffee +78 -0
- data/assets/javascripts/aerogel-pages.js.coffee +3 -0
- data/assets/javascripts/controllers/admin-pages-edit.js.coffee +33 -0
- data/assets/javascripts/controllers/admin-pages.js.coffee +17 -0
- data/assets/stylesheets/admin-pages/_admin-pages-alert.css.scss +14 -0
- data/assets/stylesheets/admin-pages/_pages-widget.css.scss +113 -0
- data/assets/stylesheets/admin-pages/_pane-tree.css.scss +15 -0
- data/assets/stylesheets/admin-pages/_preview.css.scss +35 -0
- data/assets/stylesheets/admin-pages/_two-pane-widget.css.scss +103 -0
- data/assets/stylesheets/admin-pages-common/_admin-modals-select.css.scss +34 -0
- data/assets/stylesheets/admin-pages-common/_form-details.css.scss +11 -0
- data/assets/stylesheets/admin-pages-common/_nav-tabs.css.scss +6 -0
- data/assets/stylesheets/admin-pages-common/_page-blocks.css.scss +18 -0
- data/assets/stylesheets/admin-pages-common/_panels.css.scss +11 -0
- data/assets/stylesheets/admin-pages-common/_publication-states.css.scss +11 -0
- data/assets/stylesheets/admin-pages-common/_smart-links.css.scss +9 -0
- data/assets/stylesheets/admin-pages-common/_smart-tree-table-icons.css.scss +42 -0
- data/assets/stylesheets/admin-pages-edit/breadcrumbs.css.scss +11 -0
- data/assets/stylesheets/admin-pages-edit/form.css.scss +23 -0
- data/assets/stylesheets/admin-pages-edit/page-blocks.css.scss +88 -0
- data/assets/stylesheets/admin-pages-edit/page-footer.css.scss +21 -0
- data/assets/stylesheets/admin-pages-edit/page-header.css.scss +15 -0
- data/assets/stylesheets/admin-pages-edit/page.css.scss +30 -0
- data/assets/stylesheets/admin-pages-edit/tabs.css.scss +20 -0
- data/assets/stylesheets/aerogel-pages.css.scss +20 -0
- data/assets/stylesheets/controllers/admin-pages-edit.css.scss +7 -0
- data/assets/stylesheets/controllers/admin-pages.css.scss +5 -0
- data/assets/stylesheets/pages/_body.css.scss +3 -0
- data/assets/stylesheets/pages/_footer.css.scss +13 -0
- data/assets/stylesheets/pages/_header.css.scss +5 -0
- data/assets/stylesheets/pages/_image.css.scss +18 -0
- data/assets/stylesheets/pages/_layout-sticky-footer.css.scss +27 -0
- data/assets/stylesheets/pages/_menu.css.scss +45 -0
- data/assets/stylesheets/pages/_page-content.css.scss +3 -0
- data/assets/vendor/jquery.history.js +1 -0
- data/assets/vendor/smart-links.js.coffee +42 -0
- data/config/README.md +3 -0
- data/config/development/.keep +0 -0
- data/config/production/.keep +0 -0
- data/db/model/page.rb +137 -0
- data/db/model/page_node.rb +43 -0
- data/db/model/page_type.rb +15 -0
- data/db/model/pages/block.rb +38 -0
- data/db/model/pages/blocks/hr.rb +9 -0
- data/db/model/pages/blocks/image.rb +16 -0
- data/db/model/pages/blocks/pages_list.rb +41 -0
- data/db/model/pages/blocks/text.rb +9 -0
- data/db/seed/development/.keep +0 -0
- data/db/seed/development/01_page_types.seed +8 -0
- data/db/seed/development/02_root_page_node.seed +8 -0
- data/db/seed/development/03_root_pages.seed +10 -0
- data/db/seed/development/04_news_page_node.seed +15 -0
- data/db/seed/development/05_news_pages.seed +10 -0
- data/db/seed/production/.keep +0 -0
- data/db/seed/production/01_page_types.seed +8 -0
- data/db/seed/production/02_root_page_node.seed +8 -0
- data/db/seed/production/03_root_pages.seed +10 -0
- data/db/seed/seed.template +42 -0
- data/lib/aerogel/pages/core.rb +37 -0
- data/lib/aerogel/pages/traversal.rb +30 -0
- data/lib/aerogel/pages/version.rb +5 -0
- data/lib/aerogel/pages.rb +19 -0
- data/locales/actions.en.yml +11 -0
- data/locales/actions.ru.yml +11 -0
- data/locales/admin.en.yml +11 -0
- data/locales/admin.ru.yml +11 -0
- data/locales/models.en.yml +18 -0
- data/locales/models.ru.yml +19 -0
- data/locales/views.en.yml +38 -0
- data/locales/views.ru.yml +39 -0
- data/public/README.md +1 -0
- data/rake/README.md +3 -0
- data/views/admin/pages/_edit_form.html.erb +23 -0
- data/views/admin/pages/_page-DISABLED.html.erb +5 -0
- data/views/admin/pages/append.html.erb +4 -0
- data/views/admin/pages/delete.html.erb +28 -0
- data/views/admin/pages/edit/_block.html.erb +16 -0
- data/views/admin/pages/edit/_block_header.html.erb +66 -0
- data/views/admin/pages/edit/_breadcrumbs.html.erb +13 -0
- data/views/admin/pages/edit/_page.html.erb +63 -0
- data/views/admin/pages/edit/_page_footer.html.erb +55 -0
- data/views/admin/pages/edit/_page_header.html.erb +65 -0
- data/views/admin/pages/edit/_page_node.html.erb +79 -0
- data/views/admin/pages/edit/block/_default.html.erb +3 -0
- data/views/admin/pages/edit/block/_hr.html.erb +5 -0
- data/views/admin/pages/edit/block/_image.html.erb +20 -0
- data/views/admin/pages/edit/block/_pages_list.html.erb +53 -0
- data/views/admin/pages/edit/block/_text.html.erb +3 -0
- data/views/admin/pages/edit/select_page.html.erb +59 -0
- data/views/admin/pages/edit/select_template.html.erb +50 -0
- data/views/admin/pages/edit.html.erb +4 -0
- data/views/admin/pages/index/_pane_preview.html.erb +23 -0
- data/views/admin/pages/index/_pane_tree.html.erb +50 -0
- data/views/admin/pages/index/_pane_tree_tabs.html.erb +26 -0
- data/views/admin/pages/index.html.erb +26 -0
- data/views/admin/pages/insert.html.erb +4 -0
- data/views/admin/pages/preview/_block.html.erb +7 -0
- data/views/admin/pages/preview/_breadcrumbs.html.erb +11 -0
- data/views/admin/pages/preview/block/_default.html.erb +5 -0
- data/views/admin/pages/preview/block/_hr.html.erb +1 -0
- data/views/admin/pages/preview/block/_image.html.erb +8 -0
- data/views/admin/pages/preview/block/_pages_list.html.erb +14 -0
- data/views/admin/pages/preview/block/_text.html.erb +1 -0
- data/views/admin/pages/preview.html.erb +30 -0
- data/views/admin/table_builder/smart-list-table/_table_column.html.erb +3 -0
- data/views/admin/table_builder/smart-list-table/_table_row.html.erb +9 -0
- data/views/admin/table_builder/smart-list-table/table.html.erb +10 -0
- data/views/admin/table_builder/smart-tree-table/_table_column.html.erb +3 -0
- data/views/admin/table_builder/smart-tree-table/_table_row.html.erb +14 -0
- data/views/admin/table_builder/smart-tree-table/table.html.erb +10 -0
- data/views/admin/tabs_builder/pages-tree-tabs/_tab.html.erb +5 -0
- data/views/admin/tabs_builder/pages-tree-tabs/tabs.html.erb +3 -0
- data/views/form_builder/admin-pages-edit/field.erb +31 -0
- data/views/form_builder/admin-pages-edit/field_datetime.erb +19 -0
- data/views/form_builder/admin-pages-edit/field_default.erb +5 -0
- data/views/form_builder/admin-pages-edit/field_radio_buttons.erb +22 -0
- data/views/form_builder/admin-pages-edit/field_text_addon.erb +17 -0
- data/views/form_builder/admin-pages-edit/field_textarea.erb +28 -0
- data/views/form_builder/admin-pages-edit/field_title.erb +5 -0
- data/views/form_builder/admin-pages-edit/fieldset.erb +4 -0
- data/views/form_builder/admin-pages-edit-block/field.erb +31 -0
- data/views/form_builder/admin-pages-edit-block/field_default.erb +5 -0
- data/views/form_builder/admin-pages-edit-block/field_media-file.erb +60 -0
- data/views/form_builder/admin-pages-edit-block/field_media-image.erb +67 -0
- data/views/form_builder/admin-pages-edit-block/field_radio_buttons.erb +22 -0
- data/views/form_builder/admin-pages-edit-block/field_select_page.erb +34 -0
- data/views/form_builder/admin-pages-edit-block/field_select_template.erb +32 -0
- data/views/form_builder/admin-pages-edit-block/field_text_inline.erb +5 -0
- data/views/form_builder/admin-pages-edit-block/field_textarea.erb +2 -0
- data/views/form_builder/admin-pages-edit-block/fieldset.erb +4 -0
- data/views/layouts/admin/pages/preview.html.erb +9 -0
- data/views/layouts/application.html.erb +62 -0
- data/views/layouts/pages/_breadcrumbs.html.erb +20 -0
- data/views/layouts/pages/_flashes.html.erb +9 -0
- data/views/layouts/pages/_menu.html.erb +37 -0
- data/views/layouts/pages/_menu_item.html.erb +15 -0
- data/views/layouts/pages/_menu_user.html.erb +8 -0
- data/views/pages/_block.html.erb +7 -0
- data/views/pages/block/_default.html.erb +5 -0
- data/views/pages/block/_hr.html.erb +1 -0
- data/views/pages/block/_image.html.erb +8 -0
- data/views/pages/block/_pages_list.html.erb +13 -0
- data/views/pages/block/_text.html.erb +1 -0
- data/views/pages/list/_default.html.erb +7 -0
- data/views/pages/list/_table.html.erb +12 -0
- data/views/pages/list/_ul.html.erb +7 -0
- data/views/pages/view.html.erb +4 -0
- metadata +267 -0
@@ -0,0 +1,18 @@
|
|
1
|
+
@mixin page-block-expandable( $header-height ) {
|
2
|
+
position: relative;
|
3
|
+
// margin-bottom: 15px;
|
4
|
+
padding: 0;
|
5
|
+
margin: 0;
|
6
|
+
.header {
|
7
|
+
height: $header-height;
|
8
|
+
line-height: $header-height;
|
9
|
+
position: relative;
|
10
|
+
|
11
|
+
i { width: 16px; }
|
12
|
+
|
13
|
+
.header-label {
|
14
|
+
text-transform: uppercase;
|
15
|
+
}
|
16
|
+
}
|
17
|
+
}
|
18
|
+
|
@@ -0,0 +1,42 @@
|
|
1
|
+
.smart-tree-table {
|
2
|
+
td {
|
3
|
+
.prefix-expanded {
|
4
|
+
width: 12px;
|
5
|
+
margin-left: -12px;
|
6
|
+
}
|
7
|
+
.prefix-collapsed {
|
8
|
+
width: 9px;
|
9
|
+
margin-left: -9px;
|
10
|
+
}
|
11
|
+
}
|
12
|
+
tr:not(:hover) .drag-handle {
|
13
|
+
display: none;
|
14
|
+
}
|
15
|
+
|
16
|
+
// drag-n-drop disabled by default
|
17
|
+
tr .drag-handle {
|
18
|
+
display: none;
|
19
|
+
}
|
20
|
+
|
21
|
+
.drop-target-overlay i {
|
22
|
+
display: inline-block;
|
23
|
+
margin: auto;
|
24
|
+
position: absolute;
|
25
|
+
top: 0;
|
26
|
+
bottom: 0;
|
27
|
+
|
28
|
+
width: 16px;
|
29
|
+
height: 16px;
|
30
|
+
}
|
31
|
+
.drop-target-overlay.before i {
|
32
|
+
left: 10px;
|
33
|
+
}
|
34
|
+
.drop-target-overlay.into i {
|
35
|
+
left: 7px;
|
36
|
+
}
|
37
|
+
.drop-target-overlay.after i {
|
38
|
+
left: 10px;
|
39
|
+
}
|
40
|
+
|
41
|
+
|
42
|
+
}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
.page-edit-form {
|
2
|
+
.form {
|
3
|
+
}
|
4
|
+
|
5
|
+
.form-buttons:not(.floating) {
|
6
|
+
.container {
|
7
|
+
width: 100%;
|
8
|
+
padding: 0;
|
9
|
+
}
|
10
|
+
}
|
11
|
+
.form-buttons.floating {
|
12
|
+
background: rgba( 0,0,0, 0.3 );
|
13
|
+
padding-top: 15px;
|
14
|
+
padding-bottom: 15px;
|
15
|
+
width: 100%;
|
16
|
+
left: 0;
|
17
|
+
z-index: 100;
|
18
|
+
}
|
19
|
+
|
20
|
+
.form-group .smart-file-input {
|
21
|
+
margin-left: 13px;
|
22
|
+
}
|
23
|
+
}
|
@@ -0,0 +1,88 @@
|
|
1
|
+
|
2
|
+
.page-blocks fieldset:first-child {
|
3
|
+
&:hover {
|
4
|
+
border-top: 1px solid #ccc;
|
5
|
+
}
|
6
|
+
}
|
7
|
+
|
8
|
+
fieldset.page_block {
|
9
|
+
@include page-block-expandable( 30px );
|
10
|
+
box-sizing: content-box;
|
11
|
+
margin-top: -1px;
|
12
|
+
border-top: 1px dashed #ddd;
|
13
|
+
border-bottom: 1px dashed #ddd;
|
14
|
+
&:hover {
|
15
|
+
z-index: 1;
|
16
|
+
border-top: 1px solid #ccc;
|
17
|
+
border-bottom: 1px solid #ccc;
|
18
|
+
}
|
19
|
+
|
20
|
+
.header {
|
21
|
+
color: $link-js-color;
|
22
|
+
|
23
|
+
.btn-block-delete {
|
24
|
+
position: absolute;
|
25
|
+
right: 0;
|
26
|
+
border: none;
|
27
|
+
background: inherit;
|
28
|
+
color: $link-js-color;
|
29
|
+
padding-right: 0;
|
30
|
+
&:hover {
|
31
|
+
text-decoration: none;
|
32
|
+
color: $link-js-hover-color;
|
33
|
+
}
|
34
|
+
}
|
35
|
+
|
36
|
+
.header-label {
|
37
|
+
display: inline-block;
|
38
|
+
}
|
39
|
+
}
|
40
|
+
|
41
|
+
.content {
|
42
|
+
margin-bottom: 5px;
|
43
|
+
.form-group {
|
44
|
+
margin-bottom: 5px;
|
45
|
+
}
|
46
|
+
}
|
47
|
+
|
48
|
+
.details {
|
49
|
+
@include panel-info;
|
50
|
+
@include form-details;
|
51
|
+
}
|
52
|
+
|
53
|
+
&:not(:hover) {
|
54
|
+
.header.open {
|
55
|
+
visibility: hidden;
|
56
|
+
}
|
57
|
+
.content {
|
58
|
+
// hide inputs in .content, not in .details
|
59
|
+
.btn {
|
60
|
+
visibility: hidden;
|
61
|
+
}
|
62
|
+
textarea, input {
|
63
|
+
&:not(:hover):not(:focus) {
|
64
|
+
border: 1px solid white;
|
65
|
+
box-shadow: none;
|
66
|
+
}
|
67
|
+
}
|
68
|
+
}
|
69
|
+
|
70
|
+
}
|
71
|
+
|
72
|
+
&.ui-sortable-helper {
|
73
|
+
padding: 3px;
|
74
|
+
background: white;
|
75
|
+
border: 1px solid #ddd;
|
76
|
+
opacity: 0.7;
|
77
|
+
box-shadow: 5px 5px 5px rgba( 0, 0, 0, 0.5 );
|
78
|
+
}
|
79
|
+
}
|
80
|
+
|
81
|
+
// sortable placehoder
|
82
|
+
.page-block-sortable-placeholder {
|
83
|
+
height: 30px;
|
84
|
+
// border: 1px solid green;
|
85
|
+
background: #93e08a;
|
86
|
+
border-top: 1px dashed #ddd;
|
87
|
+
border-bottom: 1px dashed #ddd;
|
88
|
+
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
|
2
|
+
.page-footer {
|
3
|
+
@include page-block-expandable( 30px );
|
4
|
+
margin-bottom: 15px;
|
5
|
+
|
6
|
+
.content {
|
7
|
+
@include panel-info();
|
8
|
+
|
9
|
+
.block-creators {
|
10
|
+
margin: 0;
|
11
|
+
padding: 0;
|
12
|
+
li {
|
13
|
+
display: inline-block;
|
14
|
+
margin-right: 15px;
|
15
|
+
.block-creator-label {
|
16
|
+
text-transform: uppercase;
|
17
|
+
}
|
18
|
+
}
|
19
|
+
}
|
20
|
+
}
|
21
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
|
2
|
+
$block-content-fields-spacing: 10px;
|
3
|
+
.page-header {
|
4
|
+
@include page-block-expandable( 30px );
|
5
|
+
|
6
|
+
.content {
|
7
|
+
@include panel-info;
|
8
|
+
.row, .form-group {
|
9
|
+
margin-bottom: $block-content-fields-spacing;
|
10
|
+
}
|
11
|
+
div:last-child {
|
12
|
+
margin-bottom: 0;
|
13
|
+
}
|
14
|
+
}
|
15
|
+
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
.page {
|
2
|
+
.title {
|
3
|
+
.form-group {
|
4
|
+
margin: 15px 0 0px 0;
|
5
|
+
}
|
6
|
+
.input-title {
|
7
|
+
margin: 0;
|
8
|
+
font-size: 1.5em;
|
9
|
+
&:not(:hover):not(:focus) {
|
10
|
+
border: 1px solid white;
|
11
|
+
box-shadow: none;
|
12
|
+
}
|
13
|
+
}
|
14
|
+
}
|
15
|
+
}
|
16
|
+
|
17
|
+
.page-empty {
|
18
|
+
margin: 100px 0;
|
19
|
+
.message {
|
20
|
+
margin: 50px 0 15px 0;
|
21
|
+
text-align: center;
|
22
|
+
font-style: italic;
|
23
|
+
color: $item-nodata-fg;
|
24
|
+
}
|
25
|
+
.button {
|
26
|
+
margin: 15px 0 30px 0;
|
27
|
+
text-align: center;
|
28
|
+
}
|
29
|
+
|
30
|
+
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
.page-edit-form {
|
2
|
+
.nav-tabs {
|
3
|
+
padding: 5px 5px 0 5px;
|
4
|
+
margin-bottom: 5px;
|
5
|
+
a {
|
6
|
+
padding: 5px 15px;
|
7
|
+
color: black;
|
8
|
+
}
|
9
|
+
.present {
|
10
|
+
font-weight: bold;
|
11
|
+
}
|
12
|
+
.empty {
|
13
|
+
color: gray;
|
14
|
+
}
|
15
|
+
.has-error {
|
16
|
+
color: $item-with-error-fg;
|
17
|
+
}
|
18
|
+
}
|
19
|
+
}
|
20
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
//= require bootstrap
|
2
|
+
//= require aerogel-media
|
3
|
+
//= require font-awesome
|
4
|
+
@import "aerogel-icons";
|
5
|
+
|
6
|
+
$header-height: 0;
|
7
|
+
$footer-height: 35px;
|
8
|
+
|
9
|
+
$footer-bg: white; // #fafafa;
|
10
|
+
$footer-fg: #ccc;
|
11
|
+
$footer-link-color: #999;
|
12
|
+
|
13
|
+
$border-color: #eee;
|
14
|
+
$border-radius: 5px;
|
15
|
+
|
16
|
+
$image-margin: 5px;
|
17
|
+
|
18
|
+
$text-color: #555;
|
19
|
+
|
20
|
+
@import "./pages/*";
|
@@ -0,0 +1,13 @@
|
|
1
|
+
.footer {
|
2
|
+
padding-left: 15px;
|
3
|
+
padding-right: 15px;
|
4
|
+
color: $footer-fg;
|
5
|
+
background-color: $footer-bg;
|
6
|
+
border-radius: $border-radius $border-radius 0 0;
|
7
|
+
border: 1px solid $border-color;
|
8
|
+
height: $footer-height;
|
9
|
+
line-height: $footer-height;
|
10
|
+
A {
|
11
|
+
color: $footer-link-color;
|
12
|
+
}
|
13
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
.image {
|
2
|
+
&.left {
|
3
|
+
float: left;
|
4
|
+
margin: $image-margin $image-margin $image-margin 0;
|
5
|
+
}
|
6
|
+
&.middle {
|
7
|
+
margin: $image-margin;
|
8
|
+
text-align: center;
|
9
|
+
img {
|
10
|
+
margin-left: auto;
|
11
|
+
margin-right: auto;
|
12
|
+
}
|
13
|
+
}
|
14
|
+
&.right {
|
15
|
+
float: right;
|
16
|
+
margin: $image-margin 0px $image-margin $image-margin;
|
17
|
+
}
|
18
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
/* Sticky footer styles
|
2
|
+
-------------------------------------------------- */
|
3
|
+
|
4
|
+
|
5
|
+
html,
|
6
|
+
body {min-height:100%; padding:0; margin:0;}
|
7
|
+
body {
|
8
|
+
padding: $header-height 0 $footer-height 0;
|
9
|
+
position:absolute;
|
10
|
+
top:0; bottom:0; left:0; right:0;
|
11
|
+
}
|
12
|
+
|
13
|
+
#page-header-and-content {
|
14
|
+
min-height:100%;
|
15
|
+
}
|
16
|
+
|
17
|
+
|
18
|
+
#page-footer {
|
19
|
+
margin-bottom: -$footer-height;
|
20
|
+
height: $footer-height;
|
21
|
+
width: 100%;
|
22
|
+
#footer-content {
|
23
|
+
vertical-align: middle;
|
24
|
+
line-height: $footer-height;
|
25
|
+
}
|
26
|
+
}
|
27
|
+
|
@@ -0,0 +1,45 @@
|
|
1
|
+
ul.menu {
|
2
|
+
$border: 1px solid $border-color;
|
3
|
+
border-left: $border;
|
4
|
+
border-right: $border;
|
5
|
+
border-bottom: $border;
|
6
|
+
|
7
|
+
|
8
|
+
padding: 5px 15px;
|
9
|
+
border-radius: 0 0 $border-radius $border-radius;
|
10
|
+
list-style-type: none;
|
11
|
+
|
12
|
+
.menu {
|
13
|
+
border-right: none;
|
14
|
+
padding-left: 20px;
|
15
|
+
border-radius: 0 0 0 0;
|
16
|
+
background: inherit;
|
17
|
+
}
|
18
|
+
|
19
|
+
li.divider {
|
20
|
+
height: 6px;
|
21
|
+
border-bottom: $border;
|
22
|
+
margin-bottom: 6px;
|
23
|
+
}
|
24
|
+
&.open {
|
25
|
+
background: #fafafa;
|
26
|
+
display: none;
|
27
|
+
|
28
|
+
li.active:before {
|
29
|
+
content: "\00BB";
|
30
|
+
}
|
31
|
+
}
|
32
|
+
&.closed {
|
33
|
+
background: white;
|
34
|
+
li {
|
35
|
+
margin-right: 15px;
|
36
|
+
display: inline-block;
|
37
|
+
}
|
38
|
+
li.active {
|
39
|
+
color: $text-color;
|
40
|
+
A { color: $text-color; }
|
41
|
+
}
|
42
|
+
}
|
43
|
+
}
|
44
|
+
|
45
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
(function(e,t){"use strict";var n=e.History=e.History||{},r=e.jQuery;if(typeof n.Adapter!="undefined")throw new Error("History.js Adapter has already been loaded...");n.Adapter={bind:function(e,t,n){r(e).bind(t,n)},trigger:function(e,t,n){r(e).trigger(t,n)},extractEventData:function(e,n,r){var i=n&&n.originalEvent&&n.originalEvent[e]||r&&r[e]||t;return i},onDomLoad:function(e){r(e)}},typeof n.init!="undefined"&&n.init()})(window),function(e,t){"use strict";var n=e.console||t,r=e.document,i=e.navigator,s=!1,o=e.setTimeout,u=e.clearTimeout,a=e.setInterval,f=e.clearInterval,l=e.JSON,c=e.alert,h=e.History=e.History||{},p=e.history;try{s=e.sessionStorage,s.setItem("TEST","1"),s.removeItem("TEST")}catch(d){s=!1}l.stringify=l.stringify||l.encode,l.parse=l.parse||l.decode;if(typeof h.init!="undefined")throw new Error("History.js Core has already been loaded...");h.init=function(e){return typeof h.Adapter=="undefined"?!1:(typeof h.initCore!="undefined"&&h.initCore(),typeof h.initHtml4!="undefined"&&h.initHtml4(),!0)},h.initCore=function(d){if(typeof h.initCore.initialized!="undefined")return!1;h.initCore.initialized=!0,h.options=h.options||{},h.options.hashChangeInterval=h.options.hashChangeInterval||100,h.options.safariPollInterval=h.options.safariPollInterval||500,h.options.doubleCheckInterval=h.options.doubleCheckInterval||500,h.options.disableSuid=h.options.disableSuid||!1,h.options.storeInterval=h.options.storeInterval||1e3,h.options.busyDelay=h.options.busyDelay||250,h.options.debug=h.options.debug||!1,h.options.initialTitle=h.options.initialTitle||r.title,h.options.html4Mode=h.options.html4Mode||!1,h.options.delayInit=h.options.delayInit||!1,h.intervalList=[],h.clearAllIntervals=function(){var e,t=h.intervalList;if(typeof t!="undefined"&&t!==null){for(e=0;e<t.length;e++)f(t[e]);h.intervalList=null}},h.debug=function(){(h.options.debug||!1)&&h.log.apply(h,arguments)},h.log=function(){var e=typeof n!="undefined"&&typeof n.log!="undefined"&&typeof n.log.apply!="undefined",t=r.getElementById("log"),i,s,o,u,a;e?(u=Array.prototype.slice.call(arguments),i=u.shift(),typeof n.debug!="undefined"?n.debug.apply(n,[i,u]):n.log.apply(n,[i,u])):i="\n"+arguments[0]+"\n";for(s=1,o=arguments.length;s<o;++s){a=arguments[s];if(typeof a=="object"&&typeof l!="undefined")try{a=l.stringify(a)}catch(f){}i+="\n"+a+"\n"}return t?(t.value+=i+"\n-----\n",t.scrollTop=t.scrollHeight-t.clientHeight):e||c(i),!0},h.getInternetExplorerMajorVersion=function(){var e=h.getInternetExplorerMajorVersion.cached=typeof h.getInternetExplorerMajorVersion.cached!="undefined"?h.getInternetExplorerMajorVersion.cached:function(){var e=3,t=r.createElement("div"),n=t.getElementsByTagName("i");while((t.innerHTML="<!--[if gt IE "+ ++e+"]><i></i><![endif]-->")&&n[0]);return e>4?e:!1}();return e},h.isInternetExplorer=function(){var e=h.isInternetExplorer.cached=typeof h.isInternetExplorer.cached!="undefined"?h.isInternetExplorer.cached:Boolean(h.getInternetExplorerMajorVersion());return e},h.options.html4Mode?h.emulated={pushState:!0,hashChange:!0}:h.emulated={pushState:!Boolean(e.history&&e.history.pushState&&e.history.replaceState&&!/ Mobile\/([1-7][a-z]|(8([abcde]|f(1[0-8]))))/i.test(i.userAgent)&&!/AppleWebKit\/5([0-2]|3[0-2])/i.test(i.userAgent)),hashChange:Boolean(!("onhashchange"in e||"onhashchange"in r)||h.isInternetExplorer()&&h.getInternetExplorerMajorVersion()<8)},h.enabled=!h.emulated.pushState,h.bugs={setHash:Boolean(!h.emulated.pushState&&i.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(i.userAgent)),safariPoll:Boolean(!h.emulated.pushState&&i.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(i.userAgent)),ieDoubleCheck:Boolean(h.isInternetExplorer()&&h.getInternetExplorerMajorVersion()<8),hashEscape:Boolean(h.isInternetExplorer()&&h.getInternetExplorerMajorVersion()<7)},h.isEmptyObject=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},h.cloneObject=function(e){var t,n;return e?(t=l.stringify(e),n=l.parse(t)):n={},n},h.getRootUrl=function(){var e=r.location.protocol+"//"+(r.location.hostname||r.location.host);if(r.location.port||!1)e+=":"+r.location.port;return e+="/",e},h.getBaseHref=function(){var e=r.getElementsByTagName("base"),t=null,n="";return e.length===1&&(t=e[0],n=t.href.replace(/[^\/]+$/,"")),n=n.replace(/\/+$/,""),n&&(n+="/"),n},h.getBaseUrl=function(){var e=h.getBaseHref()||h.getBasePageUrl()||h.getRootUrl();return e},h.getPageUrl=function(){var e=h.getState(!1,!1),t=(e||{}).url||h.getLocationHref(),n;return n=t.replace(/\/+$/,"").replace(/[^\/]+$/,function(e,t,n){return/\./.test(e)?e:e+"/"}),n},h.getBasePageUrl=function(){var e=h.getLocationHref().replace(/[#\?].*/,"").replace(/[^\/]+$/,function(e,t,n){return/[^\/]$/.test(e)?"":e}).replace(/\/+$/,"")+"/";return e},h.getFullUrl=function(e,t){var n=e,r=e.substring(0,1);return t=typeof t=="undefined"?!0:t,/[a-z]+\:\/\//.test(e)||(r==="/"?n=h.getRootUrl()+e.replace(/^\/+/,""):r==="#"?n=h.getPageUrl().replace(/#.*/,"")+e:r==="?"?n=h.getPageUrl().replace(/[\?#].*/,"")+e:t?n=h.getBaseUrl()+e.replace(/^(\.\/)+/,""):n=h.getBasePageUrl()+e.replace(/^(\.\/)+/,"")),n.replace(/\#$/,"")},h.getShortUrl=function(e){var t=e,n=h.getBaseUrl(),r=h.getRootUrl();return h.emulated.pushState&&(t=t.replace(n,"")),t=t.replace(r,"/"),h.isTraditionalAnchor(t)&&(t="./"+t),t=t.replace(/^(\.\/)+/g,"./").replace(/\#$/,""),t},h.getLocationHref=function(e){return e=e||r,e.URL===e.location.href?e.location.href:e.location.href===decodeURIComponent(e.URL)?e.URL:e.location.hash&&decodeURIComponent(e.location.href.replace(/^[^#]+/,""))===e.location.hash?e.location.href:e.URL.indexOf("#")==-1&&e.location.href.indexOf("#")!=-1?e.location.href:e.URL||e.location.href},h.store={},h.idToState=h.idToState||{},h.stateToId=h.stateToId||{},h.urlToId=h.urlToId||{},h.storedStates=h.storedStates||[],h.savedStates=h.savedStates||[],h.normalizeStore=function(){h.store.idToState=h.store.idToState||{},h.store.urlToId=h.store.urlToId||{},h.store.stateToId=h.store.stateToId||{}},h.getState=function(e,t){typeof e=="undefined"&&(e=!0),typeof t=="undefined"&&(t=!0);var n=h.getLastSavedState();return!n&&t&&(n=h.createStateObject()),e&&(n=h.cloneObject(n),n.url=n.cleanUrl||n.url),n},h.getIdByState=function(e){var t=h.extractId(e.url),n;if(!t){n=h.getStateString(e);if(typeof h.stateToId[n]!="undefined")t=h.stateToId[n];else if(typeof h.store.stateToId[n]!="undefined")t=h.store.stateToId[n];else{for(;;){t=(new Date).getTime()+String(Math.random()).replace(/\D/g,"");if(typeof h.idToState[t]=="undefined"&&typeof h.store.idToState[t]=="undefined")break}h.stateToId[n]=t,h.idToState[t]=e}}return t},h.normalizeState=function(e){var t,n;if(!e||typeof e!="object")e={};if(typeof e.normalized!="undefined")return e;if(!e.data||typeof e.data!="object")e.data={};return t={},t.normalized=!0,t.title=e.title||"",t.url=h.getFullUrl(e.url?e.url:h.getLocationHref()),t.hash=h.getShortUrl(t.url),t.data=h.cloneObject(e.data),t.id=h.getIdByState(t),t.cleanUrl=t.url.replace(/\??\&_suid.*/,""),t.url=t.cleanUrl,n=!h.isEmptyObject(t.data),(t.title||n)&&h.options.disableSuid!==!0&&(t.hash=h.getShortUrl(t.url).replace(/\??\&_suid.*/,""),/\?/.test(t.hash)||(t.hash+="?"),t.hash+="&_suid="+t.id),t.hashedUrl=h.getFullUrl(t.hash),(h.emulated.pushState||h.bugs.safariPoll)&&h.hasUrlDuplicate(t)&&(t.url=t.hashedUrl),t},h.createStateObject=function(e,t,n){var r={data:e,title:t,url:n};return r=h.normalizeState(r),r},h.getStateById=function(e){e=String(e);var n=h.idToState[e]||h.store.idToState[e]||t;return n},h.getStateString=function(e){var t,n,r;return t=h.normalizeState(e),n={data:t.data,title:e.title,url:e.url},r=l.stringify(n),r},h.getStateId=function(e){var t,n;return t=h.normalizeState(e),n=t.id,n},h.getHashByState=function(e){var t,n;return t=h.normalizeState(e),n=t.hash,n},h.extractId=function(e){var t,n,r,i;return e.indexOf("#")!=-1?i=e.split("#")[0]:i=e,n=/(.*)\&_suid=([0-9]+)$/.exec(i),r=n?n[1]||e:e,t=n?String(n[2]||""):"",t||!1},h.isTraditionalAnchor=function(e){var t=!/[\/\?\.]/.test(e);return t},h.extractState=function(e,t){var n=null,r,i;return t=t||!1,r=h.extractId(e),r&&(n=h.getStateById(r)),n||(i=h.getFullUrl(e),r=h.getIdByUrl(i)||!1,r&&(n=h.getStateById(r)),!n&&t&&!h.isTraditionalAnchor(e)&&(n=h.createStateObject(null,null,i))),n},h.getIdByUrl=function(e){var n=h.urlToId[e]||h.store.urlToId[e]||t;return n},h.getLastSavedState=function(){return h.savedStates[h.savedStates.length-1]||t},h.getLastStoredState=function(){return h.storedStates[h.storedStates.length-1]||t},h.hasUrlDuplicate=function(e){var t=!1,n;return n=h.extractState(e.url),t=n&&n.id!==e.id,t},h.storeState=function(e){return h.urlToId[e.url]=e.id,h.storedStates.push(h.cloneObject(e)),e},h.isLastSavedState=function(e){var t=!1,n,r,i;return h.savedStates.length&&(n=e.id,r=h.getLastSavedState(),i=r.id,t=n===i),t},h.saveState=function(e){return h.isLastSavedState(e)?!1:(h.savedStates.push(h.cloneObject(e)),!0)},h.getStateByIndex=function(e){var t=null;return typeof e=="undefined"?t=h.savedStates[h.savedStates.length-1]:e<0?t=h.savedStates[h.savedStates.length+e]:t=h.savedStates[e],t},h.getCurrentIndex=function(){var e=null;return h.savedStates.length<1?e=0:e=h.savedStates.length-1,e},h.getHash=function(e){var t=h.getLocationHref(e),n;return n=h.getHashByUrl(t),n},h.unescapeHash=function(e){var t=h.normalizeHash(e);return t=decodeURIComponent(t),t},h.normalizeHash=function(e){var t=e.replace(/[^#]*#/,"").replace(/#.*/,"");return t},h.setHash=function(e,t){var n,i;return t!==!1&&h.busy()?(h.pushQueue({scope:h,callback:h.setHash,args:arguments,queue:t}),!1):(h.busy(!0),n=h.extractState(e,!0),n&&!h.emulated.pushState?h.pushState(n.data,n.title,n.url,!1):h.getHash()!==e&&(h.bugs.setHash?(i=h.getPageUrl(),h.pushState(null,null,i+"#"+e,!1)):r.location.hash=e),h)},h.escapeHash=function(t){var n=h.normalizeHash(t);return n=e.encodeURIComponent(n),h.bugs.hashEscape||(n=n.replace(/\%21/g,"!").replace(/\%26/g,"&").replace(/\%3D/g,"=").replace(/\%3F/g,"?")),n},h.getHashByUrl=function(e){var t=String(e).replace(/([^#]*)#?([^#]*)#?(.*)/,"$2");return t=h.unescapeHash(t),t},h.setTitle=function(e){var t=e.title,n;t||(n=h.getStateByIndex(0),n&&n.url===e.url&&(t=n.title||h.options.initialTitle));try{r.getElementsByTagName("title")[0].innerHTML=t.replace("<","<").replace(">",">").replace(" & "," & ")}catch(i){}return r.title=t,h},h.queues=[],h.busy=function(e){typeof e!="undefined"?h.busy.flag=e:typeof h.busy.flag=="undefined"&&(h.busy.flag=!1);if(!h.busy.flag){u(h.busy.timeout);var t=function(){var e,n,r;if(h.busy.flag)return;for(e=h.queues.length-1;e>=0;--e){n=h.queues[e];if(n.length===0)continue;r=n.shift(),h.fireQueueItem(r),h.busy.timeout=o(t,h.options.busyDelay)}};h.busy.timeout=o(t,h.options.busyDelay)}return h.busy.flag},h.busy.flag=!1,h.fireQueueItem=function(e){return e.callback.apply(e.scope||h,e.args||[])},h.pushQueue=function(e){return h.queues[e.queue||0]=h.queues[e.queue||0]||[],h.queues[e.queue||0].push(e),h},h.queue=function(e,t){return typeof e=="function"&&(e={callback:e}),typeof t!="undefined"&&(e.queue=t),h.busy()?h.pushQueue(e):h.fireQueueItem(e),h},h.clearQueue=function(){return h.busy.flag=!1,h.queues=[],h},h.stateChanged=!1,h.doubleChecker=!1,h.doubleCheckComplete=function(){return h.stateChanged=!0,h.doubleCheckClear(),h},h.doubleCheckClear=function(){return h.doubleChecker&&(u(h.doubleChecker),h.doubleChecker=!1),h},h.doubleCheck=function(e){return h.stateChanged=!1,h.doubleCheckClear(),h.bugs.ieDoubleCheck&&(h.doubleChecker=o(function(){return h.doubleCheckClear(),h.stateChanged||e(),!0},h.options.doubleCheckInterval)),h},h.safariStatePoll=function(){var t=h.extractState(h.getLocationHref()),n;if(!h.isLastSavedState(t))return n=t,n||(n=h.createStateObject()),h.Adapter.trigger(e,"popstate"),h;return},h.back=function(e){return e!==!1&&h.busy()?(h.pushQueue({scope:h,callback:h.back,args:arguments,queue:e}),!1):(h.busy(!0),h.doubleCheck(function(){h.back(!1)}),p.go(-1),!0)},h.forward=function(e){return e!==!1&&h.busy()?(h.pushQueue({scope:h,callback:h.forward,args:arguments,queue:e}),!1):(h.busy(!0),h.doubleCheck(function(){h.forward(!1)}),p.go(1),!0)},h.go=function(e,t){var n;if(e>0)for(n=1;n<=e;++n)h.forward(t);else{if(!(e<0))throw new Error("History.go: History.go requires a positive or negative integer passed.");for(n=-1;n>=e;--n)h.back(t)}return h};if(h.emulated.pushState){var v=function(){};h.pushState=h.pushState||v,h.replaceState=h.replaceState||v}else h.onPopState=function(t,n){var r=!1,i=!1,s,o;return h.doubleCheckComplete(),s=h.getHash(),s?(o=h.extractState(s||h.getLocationHref(),!0),o?h.replaceState(o.data,o.title,o.url,!1):(h.Adapter.trigger(e,"anchorchange"),h.busy(!1)),h.expectedStateId=!1,!1):(r=h.Adapter.extractEventData("state",t,n)||!1,r?i=h.getStateById(r):h.expectedStateId?i=h.getStateById(h.expectedStateId):i=h.extractState(h.getLocationHref()),i||(i=h.createStateObject(null,null,h.getLocationHref())),h.expectedStateId=!1,h.isLastSavedState(i)?(h.busy(!1),!1):(h.storeState(i),h.saveState(i),h.setTitle(i),h.Adapter.trigger(e,"statechange"),h.busy(!1),!0))},h.Adapter.bind(e,"popstate",h.onPopState),h.pushState=function(t,n,r,i){if(h.getHashByUrl(r)&&h.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(i!==!1&&h.busy())return h.pushQueue({scope:h,callback:h.pushState,args:arguments,queue:i}),!1;h.busy(!0);var s=h.createStateObject(t,n,r);return h.isLastSavedState(s)?h.busy(!1):(h.storeState(s),h.expectedStateId=s.id,p.pushState(s.id,s.title,s.url),h.Adapter.trigger(e,"popstate")),!0},h.replaceState=function(t,n,r,i){if(h.getHashByUrl(r)&&h.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(i!==!1&&h.busy())return h.pushQueue({scope:h,callback:h.replaceState,args:arguments,queue:i}),!1;h.busy(!0);var s=h.createStateObject(t,n,r);return h.isLastSavedState(s)?h.busy(!1):(h.storeState(s),h.expectedStateId=s.id,p.replaceState(s.id,s.title,s.url),h.Adapter.trigger(e,"popstate")),!0};if(s){try{h.store=l.parse(s.getItem("History.store"))||{}}catch(m){h.store={}}h.normalizeStore()}else h.store={},h.normalizeStore();h.Adapter.bind(e,"unload",h.clearAllIntervals),h.saveState(h.storeState(h.extractState(h.getLocationHref(),!0))),s&&(h.onUnload=function(){var e,t,n;try{e=l.parse(s.getItem("History.store"))||{}}catch(r){e={}}e.idToState=e.idToState||{},e.urlToId=e.urlToId||{},e.stateToId=e.stateToId||{};for(t in h.idToState){if(!h.idToState.hasOwnProperty(t))continue;e.idToState[t]=h.idToState[t]}for(t in h.urlToId){if(!h.urlToId.hasOwnProperty(t))continue;e.urlToId[t]=h.urlToId[t]}for(t in h.stateToId){if(!h.stateToId.hasOwnProperty(t))continue;e.stateToId[t]=h.stateToId[t]}h.store=e,h.normalizeStore(),n=l.stringify(e);try{s.setItem("History.store",n)}catch(i){if(i.code!==DOMException.QUOTA_EXCEEDED_ERR)throw i;s.length&&(s.removeItem("History.store"),s.setItem("History.store",n))}},h.intervalList.push(a(h.onUnload,h.options.storeInterval)),h.Adapter.bind(e,"beforeunload",h.onUnload),h.Adapter.bind(e,"unload",h.onUnload));if(!h.emulated.pushState){h.bugs.safariPoll&&h.intervalList.push(a(h.safariStatePoll,h.options.safariPollInterval));if(i.vendor==="Apple Computer, Inc."||(i.appCodeName||"")==="Mozilla")h.Adapter.bind(e,"hashchange",function(){h.Adapter.trigger(e,"popstate")}),h.getHash()&&h.Adapter.onDomLoad(function(){h.Adapter.trigger(e,"hashchange")})}},(!h.options||!h.options.delayInit)&&h.init()}(window)
|
@@ -0,0 +1,42 @@
|
|
1
|
+
smart_link_effect_duration = 100
|
2
|
+
|
3
|
+
|
4
|
+
smart_link_effect_hide = (target, effect, fn) ->
|
5
|
+
opts = { duration: smart_link_effect_duration, complete: fn }
|
6
|
+
console.log "smart_link_effect_hide: #{effect}"
|
7
|
+
switch effect
|
8
|
+
when 'show'
|
9
|
+
target.hide()
|
10
|
+
fn()
|
11
|
+
when 'fade'
|
12
|
+
target.fadeOut opts
|
13
|
+
when 'slide'
|
14
|
+
target.slideUp opts
|
15
|
+
|
16
|
+
smart_link_effect_show = (target, effect) ->
|
17
|
+
opts = { duration: smart_link_effect_duration }
|
18
|
+
console.log "smart_link_effect_show: #{effect}"
|
19
|
+
switch effect
|
20
|
+
when 'show'
|
21
|
+
target.show()
|
22
|
+
when 'fade'
|
23
|
+
target.fadeIn opts
|
24
|
+
when 'slide'
|
25
|
+
target.slideDown opts
|
26
|
+
|
27
|
+
smart_link_click = (e) ->
|
28
|
+
console?.log "smart link clicked: #{e}"
|
29
|
+
el = $(e.currentTarget)
|
30
|
+
show_id = el.attr 'data-show-id'
|
31
|
+
hide_id = el.attr 'data-hide-id'
|
32
|
+
effect = (el.attr 'data-effect') || 'show'
|
33
|
+
if hide_id?
|
34
|
+
smart_link_effect_hide $(hide_id), effect, ->
|
35
|
+
smart_link_effect_show $(show_id), effect
|
36
|
+
else
|
37
|
+
smart_link_effect_show $(show_id), effect
|
38
|
+
e.preventDefault()
|
39
|
+
false
|
40
|
+
|
41
|
+
$ ->
|
42
|
+
$('body').on 'click', '.smart-link', smart_link_click
|
data/config/README.md
ADDED
File without changes
|
File without changes
|