Skip to content

Commit

Permalink
Merge branch 'MDL-46531-master' of git://github.com/andrewnicols/moodle
Browse files Browse the repository at this point in the history
Conflicts:
	theme/bootstrapbase/style/moodle.css
  • Loading branch information
Sam Hemelryk committed Nov 17, 2014
2 parents 0f87473 + ee7432b commit 06404b0
Show file tree
Hide file tree
Showing 13 changed files with 265 additions and 132 deletions.
30 changes: 30 additions & 0 deletions lib/editor/atto/plugins/backcolor/styles.css
Original file line number Diff line number Diff line change
@@ -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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
];

Expand All @@ -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
});
});

Expand All @@ -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']);
}
});

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
];

Expand All @@ -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
});
});

Expand All @@ -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']);
}
});

Expand Down
35 changes: 14 additions & 21 deletions lib/editor/atto/plugins/backcolor/yui/src/button/js/button.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
];

Expand All @@ -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
});
});

Expand All @@ -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']);
}
});
30 changes: 30 additions & 0 deletions lib/editor/atto/plugins/fontcolor/styles.css
Original file line number Diff line number Diff line change
@@ -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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
];

Expand All @@ -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
});
});
Expand All @@ -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']);
}
});

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
];

Expand All @@ -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
});
});
Expand All @@ -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']);
}
});

Expand Down
Loading

0 comments on commit 06404b0

Please sign in to comment.