Skip to content
This repository has been archived by the owner on Oct 26, 2019. It is now read-only.

Commit

Permalink
lotsa fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
zachrispoli committed Dec 6, 2016
1 parent db8763e commit b87e954
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 46 deletions.
47 changes: 23 additions & 24 deletions editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -257,23 +257,23 @@
<div id="projectPropertiesTabButton" class="propertiesTab">Project</div>

<div id="frameProperties" class="propertiesGUIContent">
Frame Name: <input type="text" id="frameIdentifier" maxlength="16" size="16">
Name <input style="width:130px; float:right;" type="text" id="frameIdentifier">
</div>

<div style="line-height: 25px;" id="objectProperties" class="propertiesGUIContent">
Position: <div style="float:right;">x: <input type="text" id="objectPositionX" maxlength="4" size="4"> y: <input type="text" id="objectPositionY" maxlength="4" size="4"></div>
<div id="objectProperties" class="propertiesGUIContent">
Name <input style="float:right; width:130px" type="text" id="objectName">
<br />
Size: <div style="float:right;">w: <input type="text" id="objectWidth" maxlength="4" size="4"> h: <input type="text" id="objectHeight" maxlength="4" size="4"></div>
Position <input style="float:right; width:61px;" type="text" id="objectPositionY"><span style="float:right;">x</span><input style="width:61px; float:right;" type="text" id="objectPositionX">
<br />
Rotation: <div style="margin-right:65px; float:right;"><input type="text" id="objectRotation" maxlength="4" size="4"></div>
Size <input style="float:right; width:61px;" type="text" id="objectHeight"><span style="float:right;">x</span><input style="width:61px; float:right;" type="text" id="objectWidth">
<br />
Opacity: <div style="float:right;"><input type="range" value="255" min="0" max="255" id="opacitySlider"></div>
Rotation <input style="float:right; width:130px" type="text" id="objectRotation">
<br />
Opacity <input style="float:right; width:130px" type="range" value="255" min="0" max="255" id="opacitySlider">
<br />
Name: <div style="float:right;"><input type="text" id="objectName" size="15"></div>
<br />
<div id="textProperties">
<br />
Font: <div style="float:right;"><select style="width:120px;" id="fontSelector">
Font <select style="float:right; width:130px;" id="fontSelector">
<option value="Georgia">Georgia</option>
<option value="Palatino Linotype">Palatino Linotype</option>
<option value="Book Antiqua">Book Antiqua</option>
Expand All @@ -290,36 +290,35 @@
<option value="Verdana">Verdana</option>
<option value="Courier New">Courier New</option>
<option value="Lucida Console">Lucida Console</option>
</select></div>
<br />
Color: <div style="margin-right:20px; float:right;"><input class="jscolor" value="FFFFFF" id="fontColor"></div>
<br />
Size: <div style="float:right;"><input type="range" value="40" min="2" max="150" id="fontSize"></div>
</select>
<br /><br />
Color <input style="width:130px; float:right;" class="jscolor" value="FFFFFF" id="fontColor">
<br />
<div style="float:right;"><input type="checkbox" id="boldCheckbox"> Bold </div>
<div style="margin-right:10px; float:right;"><input type="checkbox" id="italicCheckbox"> Italic</div>
<!--<input type="checkbox" id="underlinedCheckbox"> Underlined<br />-->
Size <input style="width:130px; float:right;" type="text" id="fontSize">
<br /><br />
<input type="checkbox" id="boldCheckbox"> Bold<br />
<input type="checkbox" id="italicCheckbox"> Italic
</div>
<div id="soundProperties">
<br />
<input type="checkbox" id="autoplayCheckbox"> Autoplay<br />
<input type="checkbox" id="loopCheckbox"> Loop<br />
</div>
</div>

<div id="projectProperties" class="propertiesGUIContent">
Project Name: <input type="text" id="projectName" size="15"><br />
Name <input style="float:right; width:130px;" type="text" id="projectName">
<br />
Background <input style="width:130px; float:right;" class="jscolor" value="#FFFFFF" id="projectBgColor">
<br />
Background color: <div style="float:right;"><input class="jscolor" value="#FFFFFF" id="projectBgColor"></div>
Border <input style="width:130px; float:right;" class="jscolor" value="#FFFFFF" id="projectBorderColor">
<br />
Border color: <div style="float:right;"><input class="jscolor" value="#FFFFFF" id="projectBorderColor"></div>
Size <input style="float:right; width:61px;" type="text" id="projectSizeY"><span style="float:right;">x</span><input style="width:61px; float:right;" type="text" id="projectSizeX">
<br />
Framerate <input style="float:right; width:130px;"type="text" id="frameRate">
<br />
Size: <input type="text" id="projectSizeX" maxlength="4" size="4"> x
<input type="text" id="projectSizeY" maxlength="4" size="4"><br />
Framerate: <input type="text" id="frameRate" maxlength="2" size="2"><br />
<br />
<input type="checkbox" id="experimentalToolsCheckbox"> Enable experimental tools
<br />
<input type="checkbox" id="onionSkinningCheckbox"> Enable onion skinning
<br />
</div>
Expand Down
Binary file modified favicon.ico
Binary file not shown.
4 changes: 0 additions & 4 deletions src/editor/InputHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ var InputHandler = function (wickEditor) {
that.mouse.down = false;
}, false );

document.addEventListener('contextmenu', function (event) {
event.preventDefault();
}, false);

/*************************
Tooltips
*************************/
Expand Down
3 changes: 0 additions & 3 deletions src/editor/interfaces/FabricInterface.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@ var FabricInterface = function (wickEditor) {
that.canvas.on('object:modified', function(e) {
that.modifyChangedObjects(e);
});
that.canvas.on('text:changed', function (e) {
wickEditor.interfaces.fabric.forceModifySelectedObjects();
});

this.recenterCanvas();
this.guiElements.update();
Expand Down
20 changes: 18 additions & 2 deletions src/editor/interfaces/PropertiesInterface.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ var PropertiesInterface = function (wickEditor) {
$("#textProperties").css('display', 'block');
document.getElementById('boldCheckbox').checked = selectedObj.fontData.fontWeight === "bold";
document.getElementById('italicCheckbox').checked = selectedObj.fontData.fontStyle === "italic";
document.getElementById('fontSize').value = selectedObj.fontData.fontSize;
//document.getElementById('underlinedCheckbox').checked = selectedObj.fontData.textDecoration === "underline";
} else if (selectedObj.audioData) {
$("#soundProperties").css('display', 'block');
Expand Down Expand Up @@ -178,12 +179,27 @@ var PropertiesInterface = function (wickEditor) {
});
};

document.getElementById('fontSize').onchange = function () {
/*document.getElementById('fontSize').onchange = function () {
wickEditor.actionHandler.doAction('modifyObjects', {
ids: [wickEditor.interfaces['fabric'].getSelectedObjectIDs()[0]],
modifiedStates: [{ fontSize : this.value }]
});
};
};*/
$('#fontSize').on('input propertychange', function () {

if(CheckInput.isNumber($('#fontSize').val())) {
var id = wickEditor.interfaces['fabric'].getSelectedObjectIDs()[0];
var obj = wickEditor.project.rootObject.getChildByID(id);
var modifiedState = {
fontSize : parseInt($('#fontSize').val())
};
wickEditor.actionHandler.doAction('modifyObjects', {
ids: [id],
modifiedStates: [modifiedState]
});
}

});

// Loop Checkbox: Toggle sound loop
document.getElementById('loopCheckbox').onchange = function () {
Expand Down
9 changes: 7 additions & 2 deletions src/editor/interfaces/RightClickMenuInterface.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,15 @@ var RightClickMenuInterface = function (wickEditor) {
Bind Mouse events to open menu
***********************************/


document.addEventListener('contextmenu', function (event) {
event.preventDefault();
}, false);

document.getElementById("editorCanvasContainer").addEventListener('mousedown', function(e) {
if(e.button == 2) {
that.open = true;
that.mode = "fabric";
//that.open = true;
//that.mode = "fabric";
} else {
that.open = false;
}
Expand Down
12 changes: 6 additions & 6 deletions src/project/WickObject.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,17 +173,17 @@ WickObject.fromText = function (text) {
//borderDashArray: undefined,
//borderScaleFactor: undefined,
//caching: true,
cursorColor: '#333',
cursorDelay: 1000,
cursorWidth: 2,
editable: true,
//cursorColor: '#333',
//cursorDelay: 1000,
//cursorWidth: 2,
//editable: true,
//editingBorderColor: undefined,
fontFamily: 'arial',
fontSize: 40,
fontStyle: 'normal',
fontWeight: 'normal',
textDecoration: '',
hasBorders: false,
//textDecoration: '',
//hasBorders: true,
lineHeight: 1.16,
fill: '#000000',
//selectionColor: undefined,
Expand Down
6 changes: 1 addition & 5 deletions styles/editor.css
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,14 @@ hr {
background-color: #DDDDDD;
}

.jscolor {
width: 80px;
}
input {
font-size: 16px;
color: #666;
text-align: center;
border: none;
}
select {
font-size: 16px;
color: #666;
text-align: center;
width: 80px;
}

Expand Down

0 comments on commit b87e954

Please sign in to comment.