Merge branch 'MDL-42407-master' of git://github.com/phalacee/moodle

This commit is contained in:
Dan Poltawski 2013-10-29 15:08:13 +08:00
commit 576abe8f39
8 changed files with 48 additions and 24 deletions

View File

@ -15,6 +15,7 @@ Upgrade procedure:
4/ update ./thirdpartylibs.xml
5/ execute cli/update_lang_files.php and review changes in lang/en/editor_tinymce.php
6/ use search/replace to fix oversized zIndexes
7/ add moodle-has-zindex to the class definition in createColorSplitButton() in tiny_mce_src.js and tiny_mce.js
Changes:

File diff suppressed because one or more lines are too long

View File

@ -16188,7 +16188,7 @@ tinymce.ForceBlocks = function(editor) {
s = extend({
title : s.title,
'class' : 'mce_' + id,
'class' : 'moodle-has-zindex mce_' + id,
'menu_class' : ed.getParam('skin') + 'Skin',
scope : s.scope,
more_colors_title : ed.getLang('more_colors')

View File

@ -49,6 +49,8 @@ information provided here is intended especially for developers.
of 'fopen' to read gzip-compressed files if required.
* update_internal_user_password() and setnew_password_and_mail() now trigger user_updated event.
* Add thirdpartylibs.xml file to plugins that bundle any 3rd party libraries.
* New class introduced to help auto generate zIndex values for modals - "moodle-has-zindex" can be given as a
class for any element that needs it's zIndex to be considered when creating a modal dialogue.
DEPRECATIONS:
Various previously deprecated functions have now been altered to throw DEBUG_DEVELOPER debugging notices

View File

@ -42,6 +42,7 @@ var DIALOGUE_NAME = 'Moodle dialogue',
DIALOGUE_HIDDEN_CLASS = DIALOGUE_PREFIX + '-hidden',
DIALOGUE_SELECTOR =' [role=dialog]',
MENUBAR_SELECTOR = '[role=menubar]',
HAS_ZINDEX = '.moodle-has-zindex',
CAN_RECEIVE_FOCUS_SELECTOR = 'input:not([type="hidden"]), a[href], button, textarea, select, [tabindex]';
/**
@ -110,7 +111,7 @@ Y.extend(DIALOGUE, Y.Panel, {
_resizeevent : null,
// Orientation change event listener.
_orientationevent : null,
_calculatedzindex : false,
/**
* Initialise the dialogue.
*
@ -138,6 +139,8 @@ Y.extend(DIALOGUE, Y.Panel, {
if (config.visible) {
this.applyZIndex();
}
// Recalculate the zIndex every time the modal is altered.
this.on('maskShow', this.applyZIndex);
// We must show - after the dialogue has been positioned,
// either by centerDialogue or makeResonsive. This is because the show() will trigger
// a focus on the dialogue, which will scroll the page. If the dialogue has not
@ -156,24 +159,28 @@ Y.extend(DIALOGUE, Y.Panel, {
* @return void
*/
applyZIndex : function() {
var highestzindex = 0,
var highestzindex = 1,
zindexvalue = 1,
bb = this.get('boundingBox'),
ol = this.get('maskNode'),
zindex = this.get('zIndex');
if (zindex) {
if (zindex !== 0 && !this._calculatedzindex) {
// The zindex was specified so we should use that.
bb.setStyle('zIndex', zindex);
} else {
// Determine the correct zindex by looking at all existing dialogs and menubars in the page.
Y.all(DIALOGUE_SELECTOR+', '+MENUBAR_SELECTOR).each(function (node) {
Y.all(DIALOGUE_SELECTOR+', '+MENUBAR_SELECTOR+', '+HAS_ZINDEX).each(function (node) {
var zindex = this.findZIndex(node);
if (zindex > highestzindex) {
highestzindex = zindex;
}
}, this);
// Only set the zindex if we found a wrapper.
if (highestzindex > 0) {
bb.setStyle('zIndex', (highestzindex + 1).toString());
}
zindexvalue = (highestzindex + 1).toString();
bb.setStyle('zIndex', zindexvalue);
ol.setStyle('zIndex', zindexvalue);
this.set('zIndex', zindexvalue);
this._calculatedzindex = true;
}
},

File diff suppressed because one or more lines are too long

View File

@ -42,6 +42,7 @@ var DIALOGUE_NAME = 'Moodle dialogue',
DIALOGUE_HIDDEN_CLASS = DIALOGUE_PREFIX + '-hidden',
DIALOGUE_SELECTOR =' [role=dialog]',
MENUBAR_SELECTOR = '[role=menubar]',
HAS_ZINDEX = '.moodle-has-zindex',
CAN_RECEIVE_FOCUS_SELECTOR = 'input:not([type="hidden"]), a[href], button, textarea, select, [tabindex]';
/**
@ -110,7 +111,7 @@ Y.extend(DIALOGUE, Y.Panel, {
_resizeevent : null,
// Orientation change event listener.
_orientationevent : null,
_calculatedzindex : false,
/**
* Initialise the dialogue.
*
@ -138,6 +139,8 @@ Y.extend(DIALOGUE, Y.Panel, {
if (config.visible) {
this.applyZIndex();
}
// Recalculate the zIndex every time the modal is altered.
this.on('maskShow', this.applyZIndex);
// We must show - after the dialogue has been positioned,
// either by centerDialogue or makeResonsive. This is because the show() will trigger
// a focus on the dialogue, which will scroll the page. If the dialogue has not
@ -156,24 +159,28 @@ Y.extend(DIALOGUE, Y.Panel, {
* @return void
*/
applyZIndex : function() {
var highestzindex = 0,
var highestzindex = 1,
zindexvalue = 1,
bb = this.get('boundingBox'),
ol = this.get('maskNode'),
zindex = this.get('zIndex');
if (zindex) {
if (zindex !== 0 && !this._calculatedzindex) {
// The zindex was specified so we should use that.
bb.setStyle('zIndex', zindex);
} else {
// Determine the correct zindex by looking at all existing dialogs and menubars in the page.
Y.all(DIALOGUE_SELECTOR+', '+MENUBAR_SELECTOR).each(function (node) {
Y.all(DIALOGUE_SELECTOR+', '+MENUBAR_SELECTOR+', '+HAS_ZINDEX).each(function (node) {
var zindex = this.findZIndex(node);
if (zindex > highestzindex) {
highestzindex = zindex;
}
}, this);
// Only set the zindex if we found a wrapper.
if (highestzindex > 0) {
bb.setStyle('zIndex', (highestzindex + 1).toString());
}
zindexvalue = (highestzindex + 1).toString();
bb.setStyle('zIndex', zindexvalue);
ol.setStyle('zIndex', zindexvalue);
this.set('zIndex', zindexvalue);
this._calculatedzindex = true;
}
},

View File

@ -11,6 +11,7 @@ var DIALOGUE_NAME = 'Moodle dialogue',
DIALOGUE_HIDDEN_CLASS = DIALOGUE_PREFIX + '-hidden',
DIALOGUE_SELECTOR =' [role=dialog]',
MENUBAR_SELECTOR = '[role=menubar]',
HAS_ZINDEX = '.moodle-has-zindex',
CAN_RECEIVE_FOCUS_SELECTOR = 'input:not([type="hidden"]), a[href], button, textarea, select, [tabindex]';
/**
@ -79,7 +80,7 @@ Y.extend(DIALOGUE, Y.Panel, {
_resizeevent : null,
// Orientation change event listener.
_orientationevent : null,
_calculatedzindex : false,
/**
* Initialise the dialogue.
*
@ -107,6 +108,8 @@ Y.extend(DIALOGUE, Y.Panel, {
if (config.visible) {
this.applyZIndex();
}
// Recalculate the zIndex every time the modal is altered.
this.on('maskShow', this.applyZIndex);
// We must show - after the dialogue has been positioned,
// either by centerDialogue or makeResonsive. This is because the show() will trigger
// a focus on the dialogue, which will scroll the page. If the dialogue has not
@ -125,24 +128,28 @@ Y.extend(DIALOGUE, Y.Panel, {
* @return void
*/
applyZIndex : function() {
var highestzindex = 0,
var highestzindex = 1,
zindexvalue = 1,
bb = this.get('boundingBox'),
ol = this.get('maskNode'),
zindex = this.get('zIndex');
if (zindex) {
if (zindex !== 0 && !this._calculatedzindex) {
// The zindex was specified so we should use that.
bb.setStyle('zIndex', zindex);
} else {
// Determine the correct zindex by looking at all existing dialogs and menubars in the page.
Y.all(DIALOGUE_SELECTOR+', '+MENUBAR_SELECTOR).each(function (node) {
Y.all(DIALOGUE_SELECTOR+', '+MENUBAR_SELECTOR+', '+HAS_ZINDEX).each(function (node) {
var zindex = this.findZIndex(node);
if (zindex > highestzindex) {
highestzindex = zindex;
}
}, this);
// Only set the zindex if we found a wrapper.
if (highestzindex > 0) {
bb.setStyle('zIndex', (highestzindex + 1).toString());
}
zindexvalue = (highestzindex + 1).toString();
bb.setStyle('zIndex', zindexvalue);
ol.setStyle('zIndex', zindexvalue);
this.set('zIndex', zindexvalue);
this._calculatedzindex = true;
}
},