Merge branch 'MDL-46531-master' of git://github.com/andrewnicols/moodle

Conflicts:
	theme/bootstrapbase/style/moodle.css
This commit is contained in:
Sam Hemelryk
2014-11-18 10:48:31 +13:00
13 changed files with 265 additions and 132 deletions
@@ -1,3 +1,33 @@
.atto_backcolor_button .dropdown-menu {
min-width: inherit;
}
.atto_backcolor_button .dropdown-menu .atto_menuentry div {
border: 1px solid #ccc;
width: 20px;
height: 20px;
}
.atto_backcolor_button .dropdown-menu .atto_menuentry .white {
background-color: #fff;
}
.atto_backcolor_button .dropdown-menu .atto_menuentry .red {
background-color: #ef4540;
}
.atto_backcolor_button .dropdown-menu .atto_menuentry .yellow {
background-color: #ffcf35;
}
.atto_backcolor_button .dropdown-menu .atto_menuentry .green {
background-color: #98ca3e;
}
.atto_backcolor_button .dropdown-menu .atto_menuentry .blue {
background-color: #7d9fd3;
}
.atto_backcolor_button .dropdown-menu .atto_menuentry .black {
background-color: #000;
}
@@ -35,23 +35,17 @@ YUI.add('moodle-atto_backcolor-button', function (Y, NAME) {
var colors = [
{
name: 'white',
color: '#FFFFFF'
name: 'white'
}, {
name: 'red',
color: '#EF4540'
name: 'red'
}, {
name: 'yellow',
color: '#FFCF35'
name: 'yellow'
}, {
name: 'green',
color: '#98CA3E'
name: 'green'
}, {
name: 'blue',
color: '#7D9FD3'
name: 'blue'
}, {
name: 'black',
color: '#333333'
name: 'black'
}
];
@@ -60,10 +54,8 @@ Y.namespace('M.atto_backcolor').Button = Y.Base.create('button', Y.M.editor_atto
var items = [];
Y.Array.each(colors, function(color) {
items.push({
text: '<div style="width: 20px; height: 20px; border: 1px solid #CCC; background-color: ' +
color.color +
'"></div>',
callbackArgs: color.color
text: '<div class="' + color.name + '"></div>',
callbackArgs: color.className || color.name
});
});
@@ -82,13 +74,14 @@ Y.namespace('M.atto_backcolor').Button = Y.Base.create('button', Y.M.editor_atto
*
* @method _changeStyle
* @param {EventFacade} e
* @param {string} color The new background color
* @param {string} className The class for the new font
* @private
*/
_changeStyle: function(e, color) {
this.get('host').formatSelectionInlineStyle({
backgroundColor: color
});
_changeStyle: function(e, className) {
var id = Y.stamp({});
this.get('host').toggleInlineSelectionClass([id]);
this.editor.one('.' + id).setAttribute('class', '');
this.get('host').toggleInlineSelectionClass([className, 'backcolor']);
}
});
@@ -1 +1 @@
YUI.add("moodle-atto_backcolor-button",function(e,t){var n=[{name:"white",color:"#FFFFFF"},{name:"red",color:"#EF4540"},{name:"yellow",color:"#FFCF35"},{name:"green",color:"#98CA3E"},{name:"blue",color:"#7D9FD3"},{name:"black",color:"#333333"}];e.namespace("M.atto_backcolor").Button=e.Base.create("button",e.M.editor_atto.EditorPlugin,[],{initializer:function(){var t=[];e.Array.each(n,function(e){t.push({text:'<div style="width: 20px; height: 20px; border: 1px solid #CCC; background-color: '+e.color+'"></div>',callbackArgs:e.color})}),this.addToolbarMenu({icon:"e/text_highlight",overlayWidth:"4",globalItemConfig:{callback:this._changeStyle},items:t})},_changeStyle:function(e,t){this.get("host").formatSelectionInlineStyle({backgroundColor:t})}})},"@VERSION@");
YUI.add("moodle-atto_backcolor-button",function(e,t){var n=[{name:"white"},{name:"red"},{name:"yellow"},{name:"green"},{name:"blue"},{name:"black"}];e.namespace("M.atto_backcolor").Button=e.Base.create("button",e.M.editor_atto.EditorPlugin,[],{initializer:function(){var t=[];e.Array.each(n,function(e){t.push({text:'<div class="'+e.name+'"></div>',callbackArgs:e.className||e.name})}),this.addToolbarMenu({icon:"e/text_highlight",overlayWidth:"4",globalItemConfig:{callback:this._changeStyle},items:t})},_changeStyle:function(t,n){var r=e.stamp({});this.get("host").toggleInlineSelectionClass([r]),this.editor.one("."+r).setAttribute("class",""),this.get("host").toggleInlineSelectionClass([n,"backcolor"])}})},"@VERSION@");
@@ -35,23 +35,17 @@ YUI.add('moodle-atto_backcolor-button', function (Y, NAME) {
var colors = [
{
name: 'white',
color: '#FFFFFF'
name: 'white'
}, {
name: 'red',
color: '#EF4540'
name: 'red'
}, {
name: 'yellow',
color: '#FFCF35'
name: 'yellow'
}, {
name: 'green',
color: '#98CA3E'
name: 'green'
}, {
name: 'blue',
color: '#7D9FD3'
name: 'blue'
}, {
name: 'black',
color: '#333333'
name: 'black'
}
];
@@ -60,10 +54,8 @@ Y.namespace('M.atto_backcolor').Button = Y.Base.create('button', Y.M.editor_atto
var items = [];
Y.Array.each(colors, function(color) {
items.push({
text: '<div style="width: 20px; height: 20px; border: 1px solid #CCC; background-color: ' +
color.color +
'"></div>',
callbackArgs: color.color
text: '<div class="' + color.name + '"></div>',
callbackArgs: color.className || color.name
});
});
@@ -82,13 +74,14 @@ Y.namespace('M.atto_backcolor').Button = Y.Base.create('button', Y.M.editor_atto
*
* @method _changeStyle
* @param {EventFacade} e
* @param {string} color The new background color
* @param {string} className The class for the new font
* @private
*/
_changeStyle: function(e, color) {
this.get('host').formatSelectionInlineStyle({
backgroundColor: color
});
_changeStyle: function(e, className) {
var id = Y.stamp({});
this.get('host').toggleInlineSelectionClass([id]);
this.editor.one('.' + id).setAttribute('class', '');
this.get('host').toggleInlineSelectionClass([className, 'backcolor']);
}
});
+14 -21
View File
@@ -33,23 +33,17 @@
var colors = [
{
name: 'white',
color: '#FFFFFF'
name: 'white'
}, {
name: 'red',
color: '#EF4540'
name: 'red'
}, {
name: 'yellow',
color: '#FFCF35'
name: 'yellow'
}, {
name: 'green',
color: '#98CA3E'
name: 'green'
}, {
name: 'blue',
color: '#7D9FD3'
name: 'blue'
}, {
name: 'black',
color: '#333333'
name: 'black'
}
];
@@ -58,10 +52,8 @@ Y.namespace('M.atto_backcolor').Button = Y.Base.create('button', Y.M.editor_atto
var items = [];
Y.Array.each(colors, function(color) {
items.push({
text: '<div style="width: 20px; height: 20px; border: 1px solid #CCC; background-color: ' +
color.color +
'"></div>',
callbackArgs: color.color
text: '<div class="' + color.name + '"></div>',
callbackArgs: color.className || color.name
});
});
@@ -80,12 +72,13 @@ Y.namespace('M.atto_backcolor').Button = Y.Base.create('button', Y.M.editor_atto
*
* @method _changeStyle
* @param {EventFacade} e
* @param {string} color The new background color
* @param {string} className The class for the new font
* @private
*/
_changeStyle: function(e, color) {
this.get('host').formatSelectionInlineStyle({
backgroundColor: color
});
_changeStyle: function(e, className) {
var id = Y.stamp({});
this.get('host').toggleInlineSelectionClass([id]);
this.editor.one('.' + id).setAttribute('class', '');
this.get('host').toggleInlineSelectionClass([className, 'backcolor']);
}
});
@@ -1,3 +1,33 @@
.atto_fontcolor_button .dropdown-menu {
min-width: inherit;
}
.atto_fontcolor_button .dropdown-menu .atto_menuentry div {
border: 1px solid #ccc;
width: 20px;
height: 20px;
}
.atto_fontcolor_button .dropdown-menu .atto_menuentry .white {
background-color: #fff;
}
.atto_fontcolor_button .dropdown-menu .atto_menuentry .red {
background-color: #ef4540;
}
.atto_fontcolor_button .dropdown-menu .atto_menuentry .yellow {
background-color: #ffcf35;
}
.atto_fontcolor_button .dropdown-menu .atto_menuentry .green {
background-color: #98ca3e;
}
.atto_fontcolor_button .dropdown-menu .atto_menuentry .blue {
background-color: #7d9fd3;
}
.atto_fontcolor_button .dropdown-menu .atto_menuentry .black {
background-color: #000;
}
@@ -35,23 +35,17 @@ YUI.add('moodle-atto_fontcolor-button', function (Y, NAME) {
var colors = [
{
name: 'white',
color: '#FFFFFF'
name: 'white'
}, {
name: 'red',
color: '#EF4540'
name: 'red'
}, {
name: 'yellow',
color: '#FFCF35'
name: 'yellow'
}, {
name: 'green',
color: '#98CA3E'
name: 'green'
}, {
name: 'blue',
color: '#7D9FD3'
name: 'blue'
}, {
name: 'black',
color: '#333333'
name: 'black'
}
];
@@ -60,10 +54,8 @@ Y.namespace('M.atto_fontcolor').Button = Y.Base.create('button', Y.M.editor_atto
var items = [];
Y.Array.each(colors, function(color) {
items.push({
text: '<div style="width: 20px; height: 20px; border: 1px solid #CCC; background-color: ' +
color.color +
'"></div>',
callbackArgs: color.color,
text: '<div class="' + color.name + '"></div>',
callbackArgs: color.className || color.name,
callback: this._changeStyle
});
});
@@ -80,17 +72,18 @@ Y.namespace('M.atto_fontcolor').Button = Y.Base.create('button', Y.M.editor_atto
},
/**
* Change the font color to the specified color.
* Change the font color using the specified class
*
* @method _changeStyle
* @param {EventFacade} e
* @param {string} color The new font color
* @param {string} className The class for the new font
* @private
*/
_changeStyle: function(e, color) {
this.get('host').formatSelectionInlineStyle({
color: color
});
_changeStyle: function(e, className) {
var id = Y.stamp({});
this.get('host').toggleInlineSelectionClass([id]);
this.editor.one('.' + id).setAttribute('class', '');
this.get('host').toggleInlineSelectionClass([className, 'fontcolor']);
}
});
@@ -1 +1 @@
YUI.add("moodle-atto_fontcolor-button",function(e,t){var n=[{name:"white",color:"#FFFFFF"},{name:"red",color:"#EF4540"},{name:"yellow",color:"#FFCF35"},{name:"green",color:"#98CA3E"},{name:"blue",color:"#7D9FD3"},{name:"black",color:"#333333"}];e.namespace("M.atto_fontcolor").Button=e.Base.create("button",e.M.editor_atto.EditorPlugin,[],{initializer:function(){var t=[];e.Array.each(n,function(e){t.push({text:'<div style="width: 20px; height: 20px; border: 1px solid #CCC; background-color: '+e.color+'"></div>',callbackArgs:e.color,callback:this._changeStyle})}),this.addToolbarMenu({icon:"e/text_color",overlayWidth:"4",menuColor:"#333333",globalItemConfig:{callback:this._changeStyle},items:t})},_changeStyle:function(e,t){this.get("host").formatSelectionInlineStyle({color:t})}})},"@VERSION@");
YUI.add("moodle-atto_fontcolor-button",function(e,t){var n=[{name:"white"},{name:"red"},{name:"yellow"},{name:"green"},{name:"blue"},{name:"black"}];e.namespace("M.atto_fontcolor").Button=e.Base.create("button",e.M.editor_atto.EditorPlugin,[],{initializer:function(){var t=[];e.Array.each(n,function(e){t.push({text:'<div class="'+e.name+'"></div>',callbackArgs:e.className||e.name,callback:this._changeStyle})}),this.addToolbarMenu({icon:"e/text_color",overlayWidth:"4",menuColor:"#333333",globalItemConfig:{callback:this._changeStyle},items:t})},_changeStyle:function(t,n){var r=e.stamp({});this.get("host").toggleInlineSelectionClass([r]),this.editor.one("."+r).setAttribute("class",""),this.get("host").toggleInlineSelectionClass([n,"fontcolor"])}})},"@VERSION@");
@@ -35,23 +35,17 @@ YUI.add('moodle-atto_fontcolor-button', function (Y, NAME) {
var colors = [
{
name: 'white',
color: '#FFFFFF'
name: 'white'
}, {
name: 'red',
color: '#EF4540'
name: 'red'
}, {
name: 'yellow',
color: '#FFCF35'
name: 'yellow'
}, {
name: 'green',
color: '#98CA3E'
name: 'green'
}, {
name: 'blue',
color: '#7D9FD3'
name: 'blue'
}, {
name: 'black',
color: '#333333'
name: 'black'
}
];
@@ -60,10 +54,8 @@ Y.namespace('M.atto_fontcolor').Button = Y.Base.create('button', Y.M.editor_atto
var items = [];
Y.Array.each(colors, function(color) {
items.push({
text: '<div style="width: 20px; height: 20px; border: 1px solid #CCC; background-color: ' +
color.color +
'"></div>',
callbackArgs: color.color,
text: '<div class="' + color.name + '"></div>',
callbackArgs: color.className || color.name,
callback: this._changeStyle
});
});
@@ -80,17 +72,18 @@ Y.namespace('M.atto_fontcolor').Button = Y.Base.create('button', Y.M.editor_atto
},
/**
* Change the font color to the specified color.
* Change the font color using the specified class
*
* @method _changeStyle
* @param {EventFacade} e
* @param {string} color The new font color
* @param {string} className The class for the new font
* @private
*/
_changeStyle: function(e, color) {
this.get('host').formatSelectionInlineStyle({
color: color
});
_changeStyle: function(e, className) {
var id = Y.stamp({});
this.get('host').toggleInlineSelectionClass([id]);
this.editor.one('.' + id).setAttribute('class', '');
this.get('host').toggleInlineSelectionClass([className, 'fontcolor']);
}
});
+15 -22
View File
@@ -33,23 +33,17 @@
var colors = [
{
name: 'white',
color: '#FFFFFF'
name: 'white'
}, {
name: 'red',
color: '#EF4540'
name: 'red'
}, {
name: 'yellow',
color: '#FFCF35'
name: 'yellow'
}, {
name: 'green',
color: '#98CA3E'
name: 'green'
}, {
name: 'blue',
color: '#7D9FD3'
name: 'blue'
}, {
name: 'black',
color: '#333333'
name: 'black'
}
];
@@ -58,10 +52,8 @@ Y.namespace('M.atto_fontcolor').Button = Y.Base.create('button', Y.M.editor_atto
var items = [];
Y.Array.each(colors, function(color) {
items.push({
text: '<div style="width: 20px; height: 20px; border: 1px solid #CCC; background-color: ' +
color.color +
'"></div>',
callbackArgs: color.color,
text: '<div class="' + color.name + '"></div>',
callbackArgs: color.className || color.name,
callback: this._changeStyle
});
});
@@ -78,16 +70,17 @@ Y.namespace('M.atto_fontcolor').Button = Y.Base.create('button', Y.M.editor_atto
},
/**
* Change the font color to the specified color.
* Change the font color using the specified class
*
* @method _changeStyle
* @param {EventFacade} e
* @param {string} color The new font color
* @param {string} className The class for the new font
* @private
*/
_changeStyle: function(e, color) {
this.get('host').formatSelectionInlineStyle({
color: color
});
_changeStyle: function(e, className) {
var id = Y.stamp({});
this.get('host').toggleInlineSelectionClass([id]);
this.editor.one('.' + id).setAttribute('class', '');
this.get('host').toggleInlineSelectionClass([className, 'fontcolor']);
}
});
+52
View File
@@ -2300,6 +2300,58 @@ body.lockscroll {
border: inherit;
}
/* Core content colours - these are defined in Atto but can be overwritten
* by themes. This is an alternative to using fixed colours applied using
* the style attribute */
.fontcolor.white {
color: #fff;
}
.fontcolor.red {
color: #ef4540;
}
.fontcolor.yellow {
color: #ffcf35;
}
.fontcolor.green {
color: #98ca3e;
}
.fontcolor.blue {
color: #7d9fd3;
}
.fontcolor.black {
color: #000;
}
.backcolor.white {
background-color: #fff;
}
.backcolor.red {
background-color: #ef4540;
}
.backcolor.yellow {
background-color: #ffcf35;
}
.backcolor.green {
background-color: #98ca3e;
}
.backcolor.blue {
background-color: #7d9fd3;
}
.backcolor.black {
background-color: #000;
}
.well {
min-height: 20px;
padding: 19px;
+63
View File
@@ -1,5 +1,68 @@
/* core.less */
/* Core content colours - these are defined in Atto but can be overwritten
* by themes. This is an alternative to using fixed colours applied using
* the style attribute */
@contentColorWhite: #fff;
@contentColorRed: #ef4540;
@contentColorYellow: #ffcf35;
@contentColorGreen: #98ca3e;
@contentColorBlue: #7d9fd3;
@contentColorBlack: #000;
.fontcolor {
&.white {
color: @contentColorWhite;
}
&.red {
color: @contentColorRed
}
&.yellow {
color: @contentColorYellow;
}
&.green {
color: @contentColorGreen;
}
&.blue {
color: @contentColorBlue;
}
&.black {
color: @contentColorBlack;
}
}
.backcolor {
&.white {
background-color: @contentColorWhite;
}
&.red {
background-color: @contentColorRed
}
&.yellow {
background-color: @contentColorYellow;
}
&.green {
background-color: @contentColorGreen;
}
&.blue {
background-color: @contentColorBlue;
}
&.black {
background-color: @contentColorBlack;
}
}
/** Page layout CSS starts **/
.layout-option-noheader #page-header,
.layout-option-nonavbar #page-navbar,
File diff suppressed because one or more lines are too long