Skip to content

Commit

Permalink
Unbundle JS libraries from Ace theme files
Browse files Browse the repository at this point in the history
+ Add typeahead.js library
+ Organize js/css libraries used in readme.txt

Fixes #22256
  • Loading branch information
syncguru authored and vboctor committed Feb 4, 2017
1 parent e17a89f commit bd73abd
Show file tree
Hide file tree
Showing 21 changed files with 1,023 additions and 19,216 deletions.
4 changes: 4 additions & 0 deletions core/constant_inc.php
Expand Up @@ -628,6 +628,10 @@
define( 'CHARTJS_HASH', 'sha256-Emd9qupGNNjtRpaQjhpA4hn+PWAETkO2GB3gzBL3thM=' );
define( 'CHARTJSBUNDLE_HASH', 'sha256-OBi9RJU9sFk/2JEV23eSQSqe/eUK4km5NxGgo/XMiqY=' );

# Tyeahead JS
define( 'TYPEAHEAD_VERSION', '1.1.1' );
define( 'TYPEAHEAD_HASH', 'sha256-qZIhMVBV4/crmcmYXNq5ZE5gPRiiPPMKVYbapf5HDBs=' );

# List JS
define( 'LISTJS_VERSION', '1.4.1' );
define( 'LISTJS_HASH', 'sha256-lFOz0Sg8djWQPKOfRce9A9EcYSWhFMsYo+ulRYVnjrw=' );
Expand Down
12 changes: 8 additions & 4 deletions core/layout_api.php
Expand Up @@ -320,7 +320,10 @@ function layout_body_javascript() {
# moment & datetimepicker
html_javascript_cdn_link( 'https://cdnjs.cloudflare.com/ajax/libs/moment.js/' . MOMENT_VERSION . '/moment-with-locales.min.js', MOMENT_HASH );
html_javascript_cdn_link( 'https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/' . DATETIME_PICKER_VERSION . '/js/bootstrap-datetimepicker.min.js', DATETIME_PICKER_HASH );


# typeahead.js
html_javascript_cdn_link( 'https://cdnjs.cloudflare.com/ajax/libs/corejs-typeahead/' . TYPEAHEAD_VERSION . '/typeahead.jquery.min.js', TYPEAHEAD_HASH );

# listjs
html_javascript_cdn_link( 'https://cdnjs.cloudflare.com/ajax/libs/list.js/' . LISTJS_VERSION . '/list.min.js', LISTJS_HASH );
} else {
Expand All @@ -331,13 +334,14 @@ function layout_body_javascript() {
html_javascript_link( 'moment-with-locales-' . MOMENT_VERSION . '.min.js' );
html_javascript_link( 'bootstrap-datetimepicker-' . DATETIME_PICKER_VERSION . '.min.js' );

# typeahead.js
html_javascript_link( 'typeahead.jquery-' . TYPEAHEAD_VERSION . '.min.js' );

# listjs
html_javascript_link( 'list-' . LISTJS_VERSION . '.min.js' );
}

# theme scripts
html_javascript_link( 'ace-extra.min.js' );
html_javascript_link( 'ace-elements.min.js' );
# ace theme scripts
html_javascript_link( 'ace.min.js' );
}

Expand Down
44 changes: 44 additions & 0 deletions css/ace-mantis.css
Expand Up @@ -323,6 +323,50 @@ i.datetimepicker {
margin: 6px 10px;
}

/* typeahaed styling */
input.typeahead, input.tt-query, input.tt-hint {
border: 1px solid #ccc;
border-radius: 0;
font-size: 16px;
line-height: 24px;
min-width: 175px;
outline: medium none;
}
input.tt-hint, .form-group input.tt-hint {
background-color: #fff !important;
color: #b0b0b0 !important;
}
.tt-menu {
background-color: #fff;
border: 1px solid rgba(0, 0, 0, 0.15);
border-radius: 0;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
left: 0 !important;
margin-top: 2px;
min-width: 175px;
padding: 8px 0;
position: absolute;
right: 0 !important;
text-align: left;
}
.tt-suggestion {
font-size: 16px;
line-height: 24px;
padding: 3px 12px 4px;
}
.tt-suggestion.tt-selectable:hover, .tt-suggestion.tt-cursor {
background-color: #4f99c6;
color: #fff;
cursor: pointer;
}
.tt-suggestion p {
margin: 0;
}
input.typeahead.scrollable ~ .tt-menu {
max-height: 200px;
overflow-y: auto;
}

/* Small devices (tablets, 768px and up) */
@media (min-width: 768px) {
.page-content {
Expand Down

0 comments on commit bd73abd

Please sign in to comment.