Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
typo3
qfq
Commits
b10878d1
Commit
b10878d1
authored
Jan 08, 2018
by
bbaer
Browse files
added fabric.editor.buttons to resources
parent
99b30f0c
Changes
3
Hide whitespace changes
Inline
Side-by-side
extension/Resources/Public/Json/fabric.editor.buttons.json
0 → 100644
View file @
b10878d1
{
"modes"
:
[
{
"name"
:
"rotateRight"
,
"selector"
:
"turn-right"
,
"requiresDrawing"
:
false
,
"requiresSelection"
:
false
,
"isToggle"
:
false
,
"toggle"
:
""
,
"hasToggleElement"
:
false
,
"toggleElement"
:
""
,
"icon"
:
"glyphicon-repeat"
},
{
"name"
:
"exportImage"
,
"selector"
:
"export-img"
,
"requiresDrawing"
:
false
,
"requiresSelection"
:
false
,
"isToggle"
:
false
,
"toggle"
:
""
,
"hasToggleElement"
:
false
,
"toggleElement"
:
""
,
"icon"
:
"glyphicon-floppy-disk"
}
],
"currentMode"
:
""
}
\ No newline at end of file
javascript/src/Plugins/qfq.fabric.js
View file @
b10878d1
...
...
@@ -435,7 +435,7 @@ $(function (n) {
var
oldWidth
=
this
.
canvas
.
getWidth
();
var
backgroundImageWidth
=
0
;
if
(
this
.
canvas
.
backgroundImage
)
{
backgroundImageWidth
=
this
.
canvas
.
backgroundImage
.
getW
idth
()
||
0
;
backgroundImageWidth
=
this
.
canvas
.
backgroundImage
.
w
idth
||
0
;
}
if
(
oldWidth
!==
backgroundImageWidth
&&
backgroundImageWidth
!==
0
)
{
oldWidth
=
backgroundImageWidth
;
...
...
@@ -494,9 +494,6 @@ $(function (n) {
that
.
canvas
.
setBackgroundImage
(
img
,
that
.
canvas
.
renderAll
.
bind
(
that
.
canvas
));
});
}
else
{
//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
,
...
...
@@ -856,7 +853,6 @@ $(function (n) {
}
}
this
.
canvas
.
centerObject
(
img
);
console
.
log
(
"
img width after Resize:
"
+
img
.
width
);
this
.
canvas
.
renderAll
();
};
...
...
@@ -972,22 +968,18 @@ $(function (n) {
};
n
.
Fabric
.
prototype
.
defaultObjectHoverHandler
=
function
()
{
console
.
log
(
"
Over object
"
);
this
.
overObject
=
true
;
};
n
.
Fabric
.
prototype
.
defaultObjectOutHandler
=
function
()
{
console
.
log
(
"
Left object
"
);
this
.
overObject
=
false
;
};
n
.
Fabric
.
prototype
.
defaultSelectionCreateHandler
=
function
()
{
console
.
log
(
"
Selection created
"
);
this
.
selectionActive
=
true
;
};
n
.
Fabric
.
prototype
.
defaultSelectionClearHandler
=
function
()
{
console
.
log
(
"
Selection cleared
"
);
this
.
selectionActive
=
false
;
};
...
...
@@ -1005,13 +997,13 @@ $(function (n) {
};
n
.
Fabric
.
prototype
.
deactivateAllObjects
=
function
()
{
this
.
canvas
.
forEachObject
(
function
(
object
){
this
.
canvas
.
forEachObject
(
function
(
object
)
{
object
.
selectable
=
false
;
});
};
n
.
Fabric
.
prototype
.
activateAllObjects
=
function
()
{
this
.
canvas
.
forEachObject
(
function
(
object
){
this
.
canvas
.
forEachObject
(
function
(
object
)
{
object
.
selectable
=
true
;
});
};
...
...
mockup/imageEditorFabric.html
View file @
b10878d1
...
...
@@ -10,7 +10,7 @@
<link
rel=
"stylesheet"
href=
"../css/jqx.base.css"
>
<link
rel=
"stylesheet"
href=
"../css/jqx.bootstrap.css"
>
<link
rel=
"stylesheet"
href=
"../extension/Resources/Public/Css/qfq-bs.css"
>
<title>
Input Mode Switche
r
</title>
<title>
Fabric Image Edito
r
</title>
</head>
<body>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment