Skip to content

Commit

Permalink
2.1 Release
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown authored and unknown committed Sep 2, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 60363ea commit e8d1091
Showing 6 changed files with 111 additions and 52 deletions.
2 changes: 1 addition & 1 deletion dist/bundle.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions version.php
Original file line number Diff line number Diff line change
@@ -24,8 +24,8 @@

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2020081200; // The current plugin version (Date: YYYYMMDDXX).
$plugin->release = '2.0';
$plugin->version = 2020090200; // The current plugin version (Date: YYYYMMDDXX).
$plugin->release = '2.1';
$plugin->requires = 2015111600; // Requires this Moodle version.
$plugin->component = 'atto_sketch';
$plugin->maturity = MATURITY_STABLE;
Original file line number Diff line number Diff line change
@@ -62,8 +62,7 @@ var COMPONENTNAME = 'atto_sketch',
'{{#if customstyle}}style="{{customstyle}}" {{/if}}' +
'{{#if classlist}}class="{{classlist}}" {{/if}}' +
'{{#if id}}id="{{id}}" {{/if}}' +
'/>',
myLC = null;
'/>';

Y.namespace('M.atto_sketch').Button = Y.Base.create('button', Y.M.editor_atto.EditorPlugin, [], {
/**
@@ -140,14 +139,13 @@ var COMPONENTNAME = 'atto_sketch',
// document.getElementById('sketchpad').contentDocument.getElementById('selection').click();

//find iframe
var iframeBody = $('#sketchpad');
var iframeBody = $('#' + IFID);
var sketchcontent = iframeBody.contents();

//find button inside iframe
var button = iframeBody.contents().find('#selection');
var button = sketchcontent.find('#selection');

$(button).click(function() { alert("here"); });

var sketchimage = this._convertImage(iframeBody[0].contentDocument.getElementById('canvas_minipaint').toDataURL());
var sketchimage = this._convertImage(sketchcontent[0].getElementById('canvas_minipaint').toDataURL());

// Only handle the event if an image file was dropped in.
var handlesDataTransfer = (sketchimage && sketchimage.size && sketchimage.type == 'image/png');
@@ -366,13 +364,12 @@ var COMPONENTNAME = 'atto_sketch',
selected = this._getSelectedImageProperties();
}
document.getElementById(IFID).addEventListener("load", function() {
var sketchpad = document.getElementById('sketchpad').contentDocument.getElementById('canvas_minipaint')[0];
var iframe = document.getElementById(IFID).contentWindow;
if (selected) { // Selection is an image.
var image = new Image();
image.src = selected.src;

var Layers = document.getElementById('sketchpad').contentWindow.Layers;
var iframeBody = $('#' + IFID);
var sketchcontent = iframeBody.contents()[0].defaultView;
var Layers = sketchcontent.Layers;
var name = image.src.replace(/^.*[\\\/]/, '');
var new_layer = {
name: name,
@@ -401,7 +398,7 @@ var COMPONENTNAME = 'atto_sketch',
// Set top and left to corner and calculate height with CSS3.
if (Y.one('.moodle-dialogue-focused')) {
Y.one('.moodle-dialogue-focused').setStyle('position', 'fixed');
Y.one('.moodle-dialogue-focused').setStyle('z-index', '9999');
Y.one('.moodle-dialogue-focused').setStyle('z-index', '999999');
Y.one('.moodle-dialogue-focused').setStyle('top', '0');
Y.one('.moodle-dialogue-focused').setStyle('left', '0');
}
@@ -458,16 +455,18 @@ var COMPONENTNAME = 'atto_sketch',
*/
_doInsertBase64: function(e) {
e.preventDefault();
var parent = this,
imgstring = document.getElementById('sketchpad').contentDocument.getElementById('canvas_minipaint').toDataURL(),
sketch = '<img src="' + imgstring + '" />';
var parent = this;
var iframeBody = $('#' + IFID);
var sketchcontent = iframeBody.contents()[0];
var imgstring = sketchcontent.getElementById('canvas_minipaint').toDataURL();
var sketchhtml = '<img src="' + imgstring + '" />';

// Hide the pop-up after we've received the selection in the "deliveryList" message.
// Hiding before message is received causes exceptions in IE.
parent.getDialogue({focusAfterHide: null}).hide();

parent.editor.focus();
parent.get('host').insertContentAtFocusPoint(sketch);
parent.get('host').insertContentAtFocusPoint(sketchhtml);
parent.markUpdated();
}
}, {

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

Loading

0 comments on commit e8d1091

Please sign in to comment.