Skip to content

Commit

Permalink
Merge pull request #2749 from FinalAngel/develop
Browse files Browse the repository at this point in the history
Crossbrowser fixes
  • Loading branch information
Angelo Dini committed Feb 28, 2014
2 parents 3a09d5c + f9fb759 commit c83ea12
Show file tree
Hide file tree
Showing 13 changed files with 49 additions and 34 deletions.
15 changes: 15 additions & 0 deletions CONTRIBUTING.rst
Expand Up @@ -90,6 +90,9 @@ We try to conform to `PEP8`_ as much as possible. A few highlights:
is "it should look good in a terminal-base editor" (eg vim), but we try not be
[Godwin's law] about it.

It is worth to mention that we use **tabs** within HTML, SASS/SCSS and JavaScript.
Please refrain from using spaces anywhere except if it helps code readability.


Process
=======
Expand Down Expand Up @@ -189,6 +192,18 @@ contribute. All changes there will be automatically sent to the project.
<img border="0" src="https://www.transifex.com/projects/p/django-cms/resource/core/chart/image_png"/>


********
Frontend
********


We are using `SASS/Compass <compass-style.org>`_ for our styles. The files
are located within ``cms/static/cms/sass`` and can be compiled using the compass
command ``compass watch cms/static/cms/`` from within the django-cms root.

This will invoke the **config.rb** within ``cms/static/cms/`` using the predefined
settings.


.. _security@django-cms.org: mailto:security@django-cms.org
.. _fork: http://github.com/divio/django-cms
Expand Down
12 changes: 6 additions & 6 deletions cms/static/cms/css/cms.base.css

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions cms/static/cms/js/plugins/cms.modal.js
Expand Up @@ -373,8 +373,6 @@ $(document).ready(function () {
'top': modalTop + mvY
});
});

console.log($(window).scrollTop());
},

_endResize: function () {
Expand Down Expand Up @@ -509,14 +507,18 @@ $(document).ready(function () {
// after iframe is loaded append css
contents.find('head').append($('<link rel="stylesheet" type="text/css" href="' + that.config.urls.static + that.options.urls.css_modal + '" />'));

// set modal buttons
that._setButtons($(this));

// when an error occurs, reset the saved status so the form can be checked and validated again
if(iframe.contents().find('.errornote').length || iframe.contents().find('.errorlist').length) {
that.saved = false;
}

// when the window has been changed pressing the blue or red button, we need to run a reload check
if(that.saved) {
that.reloadBrowser(false, false, true);
iframe.hide();
that.reloadBrowser(window.location.href, false, true);
} else {
// set title of not provided
var innerTitle = iframe.contents().find('#content h1:eq(0)');
Expand Down
4 changes: 3 additions & 1 deletion cms/static/cms/js/plugins/cms.plugins.js
Expand Up @@ -544,7 +544,9 @@ $(document).ready(function () {
// calculate subnav bounds
if($(window).height() + $(window).scrollTop() - nav.offset().top - dropdown.height() <= 10) {
dropdown.css('top', 'auto');
dropdown.css('bottom', offset - 1);
dropdown.css('bottom', offset);
// if parent is within a plugin, add additional offset
if(dropdown.closest('.cms_draggable').length) dropdown.css('bottom', offset - 1);
} else {
dropdown.css('top', offset);
dropdown.css('bottom', 'auto');
Expand Down
3 changes: 3 additions & 0 deletions cms/static/cms/js/plugins/cms.structureboard.js
Expand Up @@ -424,6 +424,9 @@ $(document).ready(function () {
if(plugin.length) bounds = plugin.data('settings').plugin_restriction;
if(holder.length) bounds = holder.data('settings').plugin_restriction;

// if parent has class disabled, dissalow drop
if(placeholder.parent().hasClass('cms_draggable-disabled')) return false;

// if restrictions is still empty, proceed
that.state = (bounds.length <= 0 || $.inArray(type, bounds) !== -1) ? true : false;

Expand Down
4 changes: 2 additions & 2 deletions cms/static/cms/js/plugins/cms.toolbar.js
Expand Up @@ -144,7 +144,7 @@ $(document).ready(function () {
});

// attach hover
lists.find('li').bind('mouseenter mouseleave', function (e) {
lists.find('li').bind('mouseenter mouseleave', function () {
var el = $(this);
var parent = el.closest('.cms_toolbar-item-navigation-children');
var hasChildren = el.hasClass(children) || parent.length;
Expand Down Expand Up @@ -411,7 +411,7 @@ $(document).ready(function () {
sideframe.open(el.attr('href'), true);
break;
case 'ajax':
this.openAjax(el.attr('href'), el.data('post'), el.data('text'));
this.openAjax(el.attr('href'), JSON.stringify(el.data('post')), el.data('text'));
break;
default:
window.location.href = el.attr('href');
Expand Down
6 changes: 3 additions & 3 deletions cms/static/cms/sass/cms.base.scss
Expand Up @@ -12,9 +12,9 @@
.cms_reset {
div, p, a, a:hover, a:active, a:focus, ul, li,
form, fieldset, label, input, textarea {
font:normal 13px/20px "Helvetica Neue",Helvetica,Arial,sans-serif;
color:#222; font-weight:normal; text-decoration:none; text-align:left; outline:none;
list-style-type:none; list-style-type:none; height:auto; padding:0; margin:0; border:none; background:none;
font:normal 13px/20px Helvetica,Arial,sans-serif;
color:#222; text-decoration:none; text-align:left; outline:none;
list-style-type:none; height:auto; padding:0; margin:0; border:none; background:none;
}
}

Expand Down
8 changes: 0 additions & 8 deletions cms/static/cms/sass/modules/_common.scss
Expand Up @@ -60,13 +60,5 @@
color:white; font-weight:normal; padding:5px 7px; background:$color-grey-70; }
}









// end of toolbar
}
2 changes: 1 addition & 1 deletion cms/static/cms/sass/modules/_modal.scss
Expand Up @@ -21,7 +21,7 @@
.cms_modal-frame iframe { width:100%; height:100%; }

.cms_modal-title { display:block; font-size:13px; font-weight:bold; text-align:center; cursor:move;
padding:3px 75px 4px; @include border-radius(5px 5px 0px 0px);
padding:4px 75px 3px; @include border-radius(5px 5px 0px 0px);
color:$color-grey-70; background:$color-grey-5; }

.cms_modal-collapse, .cms_modal-close, .cms_modal-maximize { display:block; position:absolute; right:3px; top:3px;
Expand Down
4 changes: 2 additions & 2 deletions cms/static/cms/sass/modules/_sideframe.scss
Expand Up @@ -34,8 +34,8 @@
.cms_sideframe-hidden:hover { background-position:-80px -150px; }
.cms_sideframe-maximize { background-position:-40px -91px; }
.cms_sideframe-maximize:hover { background-position:-60px -91px; }
.cms_sideframe-minimize { background-position:-60px -111px; }
.cms_sideframe-minimize:hover { background-position:-60px -91px; }
.cms_sideframe-minimize { background-position:-61px -111px; }
.cms_sideframe-minimize:hover { background-position:-61px -91px; }

.cms_sideframe-hide { border:5px solid $color-grey-70; border-left:none; border-right:none; }
}
Expand Down
5 changes: 3 additions & 2 deletions cms/static/cms/sass/modules/_structureboard.scss
Expand Up @@ -31,7 +31,7 @@ display:none; position:absolute; top:0; right:0; width:100%; height:100%; z-inde
position:relative; left:0; top:0; z-index:9999;
@include border-radius(3px);

.cms_dragbar-title { font-size:12px; line-height:16px; text-transform:uppercase;
.cms_dragbar-title { font-size:12px; line-height:17px; text-transform:uppercase;
font-weight:500; padding:0 0 0 15px; height:16px; cursor:pointer;
color:white; @include text-shadow(0px 1px 0px black);

Expand Down Expand Up @@ -105,7 +105,7 @@ display:none; position:absolute; top:0; right:0; width:100%; height:100%; z-inde

.cms_dragitem { cursor:move; }
.cms_dragitem-collapsable { cursor:pointer; padding-left:15px; }
.cms_dragitem-collapsable { background:url('../img/toolbar/sprite_toolbar.png') no-repeat 1px -358px; }
.cms_dragitem-collapsable { background:url('../img/toolbar/sprite_toolbar.png') no-repeat 1px -359px; }
.cms_dragitem-expanded { background:url('../img/toolbar/sprite_toolbar.png') no-repeat 0 -389px; }
.cms_dragitem-success { position:absolute; left:-1px; top:-1px; @include border-radius(3px);
width:100%; height:100%;
Expand All @@ -131,6 +131,7 @@ display:none; position:absolute; top:0; right:0; width:100%; height:100%; z-inde

// hide arrow when adding plugin-in-plugin within disabled item
.cms_draggable-disabled > .cms_dragitem-collapsable { background:none; padding-left:0; }
.cms_draggable-disabled > .cms_draggables { display:none !important; }

// end of dragarea
}
Expand Down
4 changes: 2 additions & 2 deletions cms/static/cms/sass/modules/_subnav.scss
Expand Up @@ -33,8 +33,8 @@
cursor:default; text-align:right; height:25px; @include border-radius(4px);
background:$color-grey-70 url('../img/toolbar/sprite_toolbar.png') no-repeat right -326px; }
.cms_submenu-quicksearch label { cursor:pointer; }
.cms_submenu-quicksearch input { font-size:12px; color:white; text-align:right; -webkit-appearance:none;
width:109px; padding:3px 1px 1px 5px; margin-right:25px; border:none; background:none; }
.cms_submenu-quicksearch input { display:block; font-size:12px; color:white; text-align:right; -webkit-appearance:none;
width:109px; height:20px; padding:3px 1px 1px 5px; margin-right:25px; border:none; background:none; }

// end of toolbar
}
8 changes: 4 additions & 4 deletions cms/static/cms/sass/modules/_toolbar.scss
Expand Up @@ -136,9 +136,9 @@ position:absolute; left:0; top:5px; z-index:9999999; width:100%;
@include single-transition(outline 0.2s);
}
}
input[type="submit"] { font-size:12px; text-transform:uppercase; cursor:pointer;
padding:1px 15px 0; @include border-radius(3px);
color:white; border:1px solid darken($color-grey, 20%);
input[type="submit"] { display:block; color:white; font-size:12px; text-transform:uppercase; cursor:pointer;
height:23px; padding:1px 15px 0; @include border-radius(3px);
border:1px solid darken($color-grey, 20%);
@include box-shadow(inset 0 1px 0 lighten($color-grey, 20%));
@include background-image($gradient-dark);

Expand All @@ -154,7 +154,7 @@ position:absolute; left:0; top:5px; z-index:9999999; width:100%;
.cms_toolbar-item-buttons {
margin:4px 0 4px;

a { float:left; font-size:11px; line-height:11px; padding:5px 12px; }
a { float:left; font-size:11px; line-height:1; padding:5px 12px; }
a:first-child { @include border-radius(3px 0 0 3px); }
a:last-child { @include border-radius(0 3px 3px 0); }
a:only-child { @include border-radius(3px); }
Expand Down

0 comments on commit c83ea12

Please sign in to comment.