Merge branch 'MDL-46061-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE
This commit is contained in:
@@ -19,10 +19,50 @@ Feature: Add images to Atto
|
||||
And I set the field "Describe this image" to "It's the Moodle"
|
||||
# Wait for the page to "settle".
|
||||
And I wait "2" seconds
|
||||
And the field "Width" matches value "204"
|
||||
And the field "Height" matches value "61"
|
||||
And I set the field "Auto size" to "1"
|
||||
And I set the field "Width" to "2040"
|
||||
# Trigger blur on the width field.
|
||||
And I set the field "Alignment" to "Bottom"
|
||||
And the field "Height" matches value "610"
|
||||
And I set the field "Height" to "61"
|
||||
# Trigger blur on the height field.
|
||||
And I set the field "Alignment" to "Bottom"
|
||||
And the field "Width" matches value "204"
|
||||
And I set the field "Auto size" to "0"
|
||||
And I set the field "Width" to "123"
|
||||
And I set the field "Height" to "456"
|
||||
# Trigger blur on the height field.
|
||||
And I set the field "Alignment" to "Bottom"
|
||||
And the field "Width" matches value "123"
|
||||
And the field "Height" matches value "456"
|
||||
And I click on "Save image" "button"
|
||||
And I click on "Update profile" "button"
|
||||
And I follow "Edit profile"
|
||||
And I select the text in the "Description" Atto editor
|
||||
And I click on "Image" "button"
|
||||
Then the field "Describe this image" matches value "It's the Moodle"
|
||||
And the field "Width" matches value "123"
|
||||
And the field "Height" matches value "456"
|
||||
|
||||
@javascript
|
||||
Scenario: Manually inserting an image
|
||||
Given I log in as "admin"
|
||||
And I navigate to "Edit profile" node in "My profile settings"
|
||||
And I set the field "Description" to "<p>Image: <img src='/nothing/here'>.</p>"
|
||||
And I select the text in the "Description" Atto editor
|
||||
When I click on "Image" "button"
|
||||
Then the field "Enter URL" matches value "/nothing/here"
|
||||
And I set the field "Describe this image" to "Something"
|
||||
And I set the field "Enter URL" to ""
|
||||
And I press "Save image"
|
||||
And I set the field "Description" to "<p>Image: <img src='/nothing/again' width='123' height='456' alt='Awesome!'>.</p>"
|
||||
And I press "Update profile"
|
||||
And I follow "Edit profile"
|
||||
And I select the text in the "Description" Atto editor
|
||||
And I click on "Image" "button"
|
||||
And the field "Enter URL" matches value "/nothing/again"
|
||||
And the field "Width" matches value "123"
|
||||
And the field "Height" matches value "456"
|
||||
And the field "Describe this image" matches value "Awesome!"
|
||||
Vendored
+8
@@ -243,6 +243,9 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
|
||||
return;
|
||||
}
|
||||
|
||||
// Reset the image dimensions.
|
||||
this._rawImageDimensions = null;
|
||||
|
||||
var dialogue = this.getDialogue({
|
||||
headerContent: M.util.get_string('imageproperties', COMPONENTNAME),
|
||||
width: '480px',
|
||||
@@ -388,6 +391,11 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
|
||||
rawPercentage,
|
||||
rawSize;
|
||||
|
||||
// If we do not know the image size, do not do anything.
|
||||
if (!this._rawImageDimensions) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Set the width back to default if it is empty.
|
||||
if (keyFieldValue === '') {
|
||||
keyFieldValue = this._rawImageDimensions[keyFieldType];
|
||||
|
||||
Vendored
+2
-2
File diff suppressed because one or more lines are too long
Vendored
+8
@@ -243,6 +243,9 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
|
||||
return;
|
||||
}
|
||||
|
||||
// Reset the image dimensions.
|
||||
this._rawImageDimensions = null;
|
||||
|
||||
var dialogue = this.getDialogue({
|
||||
headerContent: M.util.get_string('imageproperties', COMPONENTNAME),
|
||||
width: '480px',
|
||||
@@ -388,6 +391,11 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
|
||||
rawPercentage,
|
||||
rawSize;
|
||||
|
||||
// If we do not know the image size, do not do anything.
|
||||
if (!this._rawImageDimensions) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Set the width back to default if it is empty.
|
||||
if (keyFieldValue === '') {
|
||||
keyFieldValue = this._rawImageDimensions[keyFieldType];
|
||||
|
||||
@@ -241,6 +241,9 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
|
||||
return;
|
||||
}
|
||||
|
||||
// Reset the image dimensions.
|
||||
this._rawImageDimensions = null;
|
||||
|
||||
var dialogue = this.getDialogue({
|
||||
headerContent: M.util.get_string('imageproperties', COMPONENTNAME),
|
||||
width: '480px',
|
||||
@@ -386,6 +389,11 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
|
||||
rawPercentage,
|
||||
rawSize;
|
||||
|
||||
// If we do not know the image size, do not do anything.
|
||||
if (!this._rawImageDimensions) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Set the width back to default if it is empty.
|
||||
if (keyFieldValue === '') {
|
||||
keyFieldValue = this._rawImageDimensions[keyFieldType];
|
||||
|
||||
Reference in New Issue
Block a user