Skip to content

Commit

Permalink
wordbuildgrid first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
gouravmore committed Mar 31, 2017
0 parents commit c0dda69
Show file tree
Hide file tree
Showing 6 changed files with 369 additions and 0 deletions.
Binary file added assets/wordBuildGrid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions editor/help.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
**Scribble Pad**

This will acts a scribble pad (slate) for a child. Use this to teach letter tracing or just scribble any shape.

---

***Change color*** Use color picker to change color and transparency

***Transparency*** Go to more settings in color picker to set transparency. Make the scribble pad transparent to use it for tracing.


---

***Actions***

Objects on a stage can perform various actions in the content player when user clicks on them. Each action requires a target object to complete the action. Please ensure the target object is present before adding an action.

We suggest not to attach actions to a scribble pad

***Pro tip***

Place scribble pad over a shape, an image or a text to teach tracing of shapes, letters, and alphabets.

***Are you a developer?***

To get started visit <a href="https://community.ekstep.in/developers" target="_blank">EkStep Developer Community</a>
97 changes: 97 additions & 0 deletions editor/plugin.js

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

66 changes: 66 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"id": "org.ekstep.wordBuildGrid",
"ver": "1.0",
"author": "Gourav More",
"title": "wordBuildGrid Plugin",
"description": "",
"displayName": "wordBuildGrid",
"publishedDate": "",
"editor": {
"main": "editor/plugin.js",
"dependencies": [
],
"menu": [{
"id": "wordBuildGrid",
"category": "main",
"type": "icon",
"toolTip": "Add wordBuildGrid",
"title": "wordBuildGrid",
"iconClass": "icon-wordgrid icon",
"onclick": {
"id": "org.ekstep.wordBuildGrid:create",
"data": {
"type": "roundrect",
"y": 20,
"x": 25,
"fill": "#3399FF",
"w": 27,
"h": 60,
"stroke": "rgba(255, 255, 255, 0)",
"strokeWidth": 1,
"opacity": 0.3
}
},
"media": [{
"id": "eraserImage",
"src": "assets/wordgrid.png",
"type": "image"
}]
}],
"configManifest": [{
"propertyName": "color",
"title": "Fill color",
"description": "Choose a color from the color picker",
"dataType": "colorpicker",
"required": true,
"defaultValue": "#3399FF"
},{
"propertyName": "opacity",
"title": "Transparency",
"description": "Set the transparency for element",
"dataType": "rangeslider",
"labelSuffix": "%",
"required": true,
"defaultValue": 30,
"minimumValue": 0,
"maximumValue": 100
}],
"help": {
"src": "editor/help.md",
"dataType": "text"
}
},
"renderer": {
"main": "renderer/scribblepadplugin.js"
}
}
113 changes: 113 additions & 0 deletions renderer/wordbuildgridplugin.js

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

67 changes: 67 additions & 0 deletions test/editor/plugin.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
'use strict';
/*
describe('org.ekstep.scribblepad', function() {
var $scope,
plugin,
pluginInstance,
pluginTitle = 'org.ekstep.scribblepad';
beforeEach(module('editorApp'));
beforeEach(inject(function($rootScope, $controller) {
$scope = $rootScope.$new();
$controller('MainCtrl', { $scope: $scope });
}));
beforeEach(function() {
EkstepEditor.pluginManager.loadPlugin(pluginTitle, "1.0");
});
it('should be intialized', function() {
EkstepEditor.eventManager.dispatchEvent(pluginTitle + ':create', {
"type": "roundrect",
"y": 20,
"x": 25,
"fill": "#3399FF",
"w": 27,
"h": 60
});
pluginInstance = EkstepEditorAPI.getCurrentObject();
expect(pluginInstance.type).toBe(pluginTitle);
expect(pluginInstance.editorObj).toBeDefined();
});
it('getAttributes should return properties', function() {
var attr = pluginInstance.getAttributes();
expect(attr.opacity).toBe(0.3);
expect(attr['stroke-width']).toBe(1);
expect(attr['opacity']).toBe(0.3);
expect(attr.stroke).toBe('#663300');
expect(attr.thickness).toBe(2);
});
it('should fire event onConfigChange', function() {
spyOn(EkstepEditorAPI, 'render');
spyOn(EkstepEditorAPI, 'dispatchEvent');
pluginInstance.onConfigChange('color', '#663300');
expect(EkstepEditorAPI.render).toHaveBeenCalled();
expect(EkstepEditorAPI.dispatchEvent).toHaveBeenCalledWith('object:modified', { target: EkstepEditorAPI.getEditorObject() });
});
it('should have config properties defined', function() {
var config = pluginInstance.getConfig();
expect(config.color).toBe(pluginInstance.attributes.fill);
});
it('should update attributes on updateAttributes', function() {
pluginInstance.updateAttributes();
var dataList = { "radius": "radius", "opacity": "opacity", "stroke": "stroke", "stroke-width": "stroke-width", "scaleX": "scaleX", "scaleY": "scaleY" };
_.forEach(dataList, function(val, key) {
expect(pluginInstance.attributes[key]).toBe(pluginInstance.editorObj.get(val));
});
});
});
*/

0 comments on commit c0dda69

Please sign in to comment.