Commit 9f47076d authored by bbaer's avatar bbaer
Browse files

Changed the initialization of fabric

parent 37aff310
{
"emojis": [
{
"name": "dice",
"code": ":dice:",
"class": "emoji emoji-dice",
"selector": "e-dice",
"url": "../Emoji/1f3b2.svg"
},
{
"name": "trophy",
"code": ":trophy:",
"class": "emoji emoji-trophy",
"selector": "e-trophy",
"url": "../extension/Resources/Public/Emoji/1f3c6.svg"
},
{
"name": "lightbulb",
"code": ":lighbulb:",
"class": "emoji emoji-lightbulb",
"selector": "e-lightbulb",
"url": "../extension/Resources/Public/Emoji/1f4a1.svg"
},
{
"name": "bomb",
"code": ":bomb:",
"class": "emoji emoji-bomb",
"selector": "e-bomb",
"url": "../extension/Resources/Public/Emoji/1f4a3.svg"
},
{
"name": "100p",
"code": ":100p:",
"class": "emoji emoji-onehundred",
"selector": "e-onehundred",
"url": "../extension/Resources/Public/Emoji/1f4af.svg"
},
{
"name": "forbidden",
"code": ":forbidden:",
"class": "emoji emoji-forbidden",
"selector": "e-forbidden",
"url": "../extension/Resources/Public/Emoji/1f6ab.svg"
},
{
"name": "star",
"code": ":star:",
"class": "emoji emoji-star",
"selector": "e-star",
"url": "../extension/Resources/Public/Emoji/1f31f.svg"
},
{
"name": "cookie",
"code": ":cookie:",
"class": "emoji emoji-cookie",
"selector": "e-cookie",
"url": "../extension/Resources/Public/Emoji/1f36a.svg"
},
{
"name": "blush",
"code": ":blush:",
"class": "emoji emoji-blush",
"selector": "e-blush",
"url": "../extension/Resources/Public/Emoji/1f60a.svg"
},
{
"name": "love",
"code": ":love:",
"class": "emoji emoji-love",
"selector": "e-love",
"url": "../extension/Resources/Public/Emoji/1f60d.svg"
},
{
"name": "cool",
"code": ":cool:",
"class": "emoji emoji-cool",
"selector": "e-cool",
"url": "../extension/Resources/Public/Emoji/1f60e.svg"
},
{
"name": "tongue",
"code": ":tongue:",
"class": "emoji emoji-tongue",
"selector": "e-tongue",
"url": "../extension/Resources/Public/Emoji/1f61b.svg"
},
{
"name": "ehh",
"code": ":ehh:",
"class": "emoji emoji-ehh",
"selector": "e-ehh",
"url": "../extension/Resources/Public/Emoji/1f62c.svg"
},
{
"name": "wow",
"code": ":wow:",
"class": "emoji emoji-wow",
"selector": "e-wow",
"url": "../extension/Resources/Public/Emoji/1f62e.svg"
},
{
"name": "educated",
"code": ":educated:",
"class": "emoji emoji-educated",
"selector": "e-educated",
"url": "../extension/Resources/Public/Emoji/1f393.svg"
},
{
"name": "heart",
"code": ":heart:",
"class": "emoji emoji-heart",
"selector": "e-heart",
"url": "../extension/Resources/Public/Emoji/1f496.svg"
},
{
"name": "lol",
"code": ":lol:",
"class": "emoji emoji-lol",
"selector": "e-lol",
"url": "../extension/Resources/Public/Emoji/1f602.svg"
},
{
"name": "biggrin",
"code": ":biggrin:",
"class": "emoji emoji-biggrin",
"selector": "e-biggrin",
"url": "../extension/Resources/Public/Emoji/1f603.svg"
},
{
"name": "laughing",
"code": ":laughing:",
"class": "emoji emoji-laughing",
"selector": "e-laughing",
"url": "../extension/Resources/Public/Emoji/1f604.svg"
},
{
"name": "oops",
"code": ":oops:",
"class": "emoji emoji-oops",
"selector": "e-oops",
"url": "../extension/Resources/Public/Emoji/1f605.svg"
},
{
"name": "innocent",
"code": ":innocent:",
"class": "emoji emoji-innocent",
"selector": "e-innocent",
"url": "../extension/Resources/Public/Emoji/1f607.svg"
},
{
"name": "evil",
"code": ":evil:",
"class": "emoji emoji-evil",
"selector": "e-evil",
"url": "../extension/Resources/Public/Emoji/1f608.svg"
},
{
"name": "shocked",
"code": ":shocked:",
"class": "emoji emoji-shocked",
"selector": "e-shocked",
"url": "../extension/Resources/Public/Emoji/1f631.svg"
},
{
"name": "myBad",
"code": ":mybad:",
"class": "emoji emoji-mybad",
"selector": "e-mybad",
"url": "../extension/Resources/Public/Emoji/1f632.svg"
},
{
"name": "noReaction",
"code": ":noreaction:",
"class": "emoji emoji-noreaction",
"selector": "e-evil",
"url": "../extension/Resources/Public/Emoji/1f636.svg"
},
{
"name": "sad",
"code": ":sad:",
"class": "emoji emoji-sad",
"selector": "e-sad",
"url": "../extension/Resources/Public/Emoji/1f641.svg"
},
{
"name": "happy",
"code": ":happy:",
"class": "emoji emoji-happy",
"selector": "e-happy",
"url": "../extension/Resources/Public/Emoji/1f642.svg"
},
{
"name": "correct",
"code": ":correct:",
"class": "emoji emoji-correct",
"selector": "e-correct",
"url": "../extension/Resources/Public/Emoji/2b55.svg"
},
{
"name": "warning",
"code": ":warning:",
"class": "emoji emoji-warning",
"selector": "e-warning",
"url": "../extension/Resources/Public/Emoji/26a0.svg"
},
{
"name": "correct",
"code": ":correct:",
"class": "emoji emoji-correct",
"selector": "e-correct",
"url": "../extension/Resources/Public/Emoji/2b55.svg"
},
{
"name": "zero",
"code": ":zero:",
"class": "emoji emoji-zero",
"selector": "e-zero",
"url": "../extension/Resources/Public/Emoji/30-20e3.svg"
},
{
"name": "one",
"code": ":one:",
"class": "emoji emoji-one",
"selector": "e-one",
"url": "../extension/Resources/Public/Emoji/31-20e3.svg"
},
{
"name": "two",
"code": ":two:",
"class": "emoji emoji-two",
"selector": "e-two",
"url": "../extension/Resources/Public/Emoji/32-20e3.svg"
},
{
"name": "three",
"code": ":three:",
"class": "emoji emoji-three",
"selector": "e-three",
"url": "../extension/Resources/Public/Emoji/33-20e3.svg"
},
{
"name": "four",
"code": ":four:",
"class": "emoji emoji-four",
"selector": "e-four",
"url": "../extension/Resources/Public/Emoji/34-20e3.svg"
},
{
"name": "five",
"code": ":five:",
"class": "emoji emoji-five",
"selector": "e-five",
"url": "../extension/Resources/Public/Emoji/35-20e3.svg"
},
{
"name": "six",
"code": ":six:",
"class": "emoji emoji-six",
"selector": "e-six",
"url": "../extension/Resources/Public/Emoji/36-20e3.svg"
},
{
"name": "seven",
"code": ":seven:",
"class": "emoji emoji-seven",
"selector": "e-seven",
"url": "../extension/Resources/Public/Emoji/37-20e3.svg"
},
{
"name": "eight",
"code": ":eight:",
"class": "emoji emoji-eight",
"selector": "e-eight",
"url": "../extension/Resources/Public/Emoji/38-20e3.svg"
},
{
"name": "nine",
"code": ":nine:",
"class": "emoji emoji-nine",
"selector": "e-nine",
"url": "../extension/Resources/Public/Emoji/39-20e3.svg"
},
{
"name": "hand",
"code": ":hand:",
"class": "emoji emoji-hand",
"selector": "e-hand",
"url": "../extension/Resources/Public/Emoji/261d.svg"
},
{
"name": "checked",
"code": ":checked:",
"class": "emoji emoji-checked",
"selector": "e-checked",
"url": "../extension/Resources/Public/Emoji/2714.svg"
},
{
"name": "wrong",
"code": ":wrong:",
"class": "emoji emoji-wrong",
"selector": "e-wrong",
"url": "../extension/Resources/Public/Emoji/274c.svg"
}
]
}
\ No newline at end of file
{
"images": [
{
"page": 1,
"selector": "#qfq-fabric-image-1"
},
{
"page": 2,
"selector": "#qfq-fabric-image-2"
},
{
"page": 1,
"selector": "#qfq-fabric-image-3"
}
]
}
\ No newline at end of file
......@@ -229,11 +229,13 @@ $(function (n) {
fabric.Object.prototype.transparentCorners = false;
};
n.Fabric.prototype.initialize = function(jsonImages, jsonButtons, jsonEmojis) {
n.Fabric.prototype.initialize = function($fabricElement) {
var jsonButtons = $fabricElement.data('buttons');
var jsonEmojis = $fabricElement.data('emojis');
this.modeSettings.initialize(this, jsonButtons);
this.emojiHandler.initialize(this, jsonEmojis);
this.generateCanvas();
this.setBackground(jsonImages);
this.setBackground();
this.setBrush();
};
......@@ -295,9 +297,10 @@ $(function (n) {
});
that.canvas.setBackgroundImage(img, that.canvas.renderAll.bind(that.canvas));
});*/
var getJSON = $('#fabric').data('images');
console.log(getJSON.images[0].selector);
var $image = document.getElementById(getJSON.images[0].selector);
//var getJSON = $('#fabric').data('images');
//console.log(getJSON.images[0].selector);
//var $image = document.getElementById(getJSON.images[0].selector);
var $image = document.getElementsByClassName("qfq-fabric-image")[0];
var img = new fabric.Image($image, {
width: this.canvas.width,
height: this.canvas.height,
......@@ -549,7 +552,7 @@ $(function (n) {
// Just for mockup, init() function called from new QfqNS.Plugin class maybe.
n.fabric = new n.Fabric();
n.fabric.initialize("qfq-fabric-image-1", 'mockData/fabric.modes.json', 'mockData/qfq.emoji.json');
n.fabric.initialize($("#fabric"));
// Will be integrated shortly or scrapped entirely.
......
......@@ -37,17 +37,13 @@
</div>
</div>
<img src="mockData/Scan2a.jpeg" class="qfq-fabric-image" id="qfq-fabric-image-1"> </img>
<img src="mockData/MATH_165__02-07__Johnston_dmkimler_Scan.jpeg" class="qfq-fabric-image" id="qfq-fabric-image-2">
<img src="mockData/Math167_HW8_Page1.jpg" class="qfq-fabric-image" id="qfq-fabric-image-3">
<div class="row">
<div class="col-md-4">
<div id="fabric" data-images='{"images": [{"page": 1, "selector": "qfq-fabric-image-1"}, {"page":2, "selector": "#qfq..."}]}'></div>
<div id="fabric" data-buttons="mockData/fabric.buttons.json" data-emojis="mockData/qfq.emoji.json" data-images='{"images": [{"page": 1, "selector": "qfq-fabric-image-1"}, {"page":2, "selector": "#qfq..."}]}'></div>
<input id="fabric-output" name="fabric-data" type="hidden">
<div class="text-insert" style="display:none;" id="user-text-control">
<textarea class="fabric-text" placeholder="Remember, be nice!" id="text-user-value"></textarea>
<div class="text-options">
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment