Skip to content

Commit

Permalink
Upgrade dropzone css & add CDN support
Browse files Browse the repository at this point in the history
 + Now JS & CSS are at v4.3.0

Fixes #22273

Signed-off-by: Damien Regad <dregad@mantisbt.org>

Rebased on master, and squashed the dropzone border commit.
  • Loading branch information
syncguru authored and dregad committed Feb 5, 2017
1 parent 8037db4 commit 1703efe
Show file tree
Hide file tree
Showing 8 changed files with 2,274 additions and 322 deletions.
3 changes: 3 additions & 0 deletions core/constant_inc.php
Expand Up @@ -636,6 +636,9 @@
define( 'LISTJS_VERSION', '1.4.1' );
define( 'LISTJS_HASH', 'sha256-lFOz0Sg8djWQPKOfRce9A9EcYSWhFMsYo+ulRYVnjrw=' );

# Dropzone JS
define( 'DROPZONE_VERSION', '4.3.0' );
define( 'DROPZONE_HASH', 'sha256-p2l8VeL3iL1J0NxcXbEVtoyYSC+VbEbre5KHbzq1fq8=' );

# Byte Order Markers
define( 'UTF8_BOM', "\xEF\xBB\xBF" );
Expand Down
16 changes: 14 additions & 2 deletions core/html_api.php
Expand Up @@ -223,7 +223,12 @@ function html_css() {
html_css_link( $t_stylesheet_path );
}

html_css_link( 'dropzone.css' );
# dropzone css
if ( config_get_global( 'cdn_enabled' ) == ON ) {
html_css_cdn_link( 'https://cdnjs.cloudflare.com/ajax/libs/dropzone/' . DROPZONE_VERSION . '/min/dropzone.min.css' );
} else {
html_css_link( 'dropzone-' . DROPZONE_VERSION . '.min.css' );
}
}

/**
Expand Down Expand Up @@ -302,14 +307,21 @@ function html_head_javascript() {
echo "\t" . '<script type="text/javascript" src="' . helper_mantis_url( 'javascript_translations.php' ) . '"></script>' . "\n";

if ( config_get_global( 'cdn_enabled' ) == ON ) {
# JQuery
html_javascript_cdn_link( 'https://ajax.googleapis.com/ajax/libs/jquery/' . JQUERY_VERSION . '/jquery.min.js', JQUERY_HASH );
html_javascript_cdn_link( 'https://ajax.googleapis.com/ajax/libs/jqueryui/' . JQUERY_UI_VERSION . '/jquery-ui.min.js', JQUERY_UI_HASH );

# Dropzone
html_javascript_cdn_link( 'https://cdnjs.cloudflare.com/ajax/libs/dropzone/' . DROPZONE_VERSION . '/min/dropzone.min.js', DROPZONE_HASH );
} else {
# JQuery
html_javascript_link( 'jquery-' . JQUERY_VERSION . '.min.js' );
html_javascript_link( 'jquery-ui-' . JQUERY_UI_VERSION . '.min.js' );

# Dropzone
html_javascript_link( 'dropzone-' . DROPZONE_VERSION . '.min.js' );
}

html_javascript_link( 'dropzone.min.js');
html_javascript_link( 'common.js' );
foreach ( $g_scripts_included as $t_script_path ) {
html_javascript_link( $t_script_path );
Expand Down
102 changes: 102 additions & 0 deletions css/ace-mantis.css
Expand Up @@ -367,6 +367,108 @@ input.typeahead.scrollable ~ .tt-menu {
overflow-y: auto;
}

/* dropzone styling */
.dropzone {
background: rgba(0, 0, 0, 0.03) none repeat scroll 0 0;
border: 1px solid rgba(0, 0, 0, 0.03);
min-height: 60px;
}

.dropzone .dz-preview, .dropzone-previews .dz-preview {
box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.16);
font-size: 14px;
}

.dropzone .dz-preview, .dropzone-previews .dz-preview {
background: rgba(255, 255, 255, 0.8) none repeat scroll 0 0;
border: 1px solid #acacac;
display: inline-block;
margin: 17px;
padding: 6px;
position: relative;
vertical-align: top;
}

.dropzone .dz-preview .dz-details, .dropzone-previews .dz-preview .dz-details {
background: #ebebeb none repeat scroll 0 0;
height: 100px;
margin-bottom: 22px;
padding: 5px;
position: relative;
width: 100px;
}

.dropzone .dz-preview .dz-details .dz-filename:not(:hover) {
overflow: hidden;
text-overflow: ellipsis;
}

.dropzone .dz-preview .dz-details .dz-size, .dropzone-previews .dz-preview .dz-details .dz-size {
font-size: 14px;
bottom: -38px;
height: 28px;
left: 3px;
line-height: 28px;
position: absolute;
}

.dropzone .dz-preview .dz-details img, .dropzone-previews .dz-preview .dz-details img {
height: 100px;
left: 0;
position: absolute;
top: 0;
width: 100px;
}

.dropzone a.dz-remove, .dropzone-previews a.dz-remove {
background: #d15b47 none repeat scroll 0 0;
border: medium none;
border-radius: 0;
color: #fff;
cursor: pointer;
font-size: 12px !important;
}

.dropzone a.dz-remove:hover, .dropzone-previews a.dz-remove:hover {
background: #b74635 none repeat scroll 0 0;
color: #fff;
text-decoration: none !important;
}

.dropzone .dz-preview .dz-success-mark, .dropzone-previews .dz-preview .dz-success-mark, .dropzone .dz-preview .dz-error-mark, .dropzone-previews .dz-preview .dz-error-mark {
display: none;
font-size: 30px;
height: 40px;
position: absolute;
right: -10px;
text-align: center;
top: -10px;
width: 40px;
}

.dropzone .dz-preview .dz-error-mark, .dropzone-previews .dz-preview .dz-error-mark {
background-position: -268px -123px;
color: #ee162d;
}

.dropzone .dz-preview .dz-error-message, .dropzone-previews .dz-preview .dz-error-message {
background: rgba(245, 245, 245, 0.8) none repeat scroll 0 0;
color: #800;
display: none;
left: -20px;
max-width: 500px;
min-width: 140px;
padding: 8px 10px;
position: absolute;
top: -5px;
z-index: 500;
}

.dropzone .progress {
margin-bottom: 10px;
}


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

0 comments on commit 1703efe

Please sign in to comment.