Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
officejs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
officejs
Commits
94bbc634
Commit
94bbc634
authored
Nov 29, 2013
by
Thibaut Frain
Committed by
Marco Mariani
Mar 07, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added svgedit tests
Conflicts: test/officejs.html
parent
812e99c5
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
132 additions
and
1 deletion
+132
-1
src/gadget/svgedit.html
src/gadget/svgedit.html
+2
-1
src/js/gadget_svgedit.js
src/js/gadget_svgedit.js
+0
-0
test/officejs.html
test/officejs.html
+13
-0
test/svgedit-gadget-test.html
test/svgedit-gadget-test.html
+35
-0
test/svgedit-gadget-test.js
test/svgedit-gadget-test.js
+82
-0
No files found.
src/gadget/svg
-editor
.html
→
src/gadget/svg
edit
.html
View file @
94bbc634
...
...
@@ -56,9 +56,10 @@
<link
rel=
"alternate"
type=
"application/atom+xml"
title=
"SVG-edit General Discussion"
href=
"http://groups.google.com/group/svg-edit/feed/atom_v1_0_msgs.xml"
/>
<link
rel=
"alternate"
type=
"application/atom+xml"
title=
"SVG-edit Updates (Issues/Fixes/Commits)"
href=
"http://code.google.com/feeds/p/svg-edit/updates/basic"
/>
<script
type=
"text/javascript"
src=
"../lib/rsvp.js"
></script>
<script
type=
"text/javascript"
src=
"../lib/jschannel.js"
></script>
<script
type=
"text/javascript"
src=
"../lib/renderjs.js"
></script>
<script
type=
"text/javascript"
src=
"../js/gadget_svg
_
edit.js"
></script>
<script
type=
"text/javascript"
src=
"../js/gadget_svgedit.js"
></script>
<!-- Add script with custom handlers here -->
<title>
SVG-edit
</title>
...
...
src/js/gadget_svg
_
edit.js
→
src/js/gadget_svgedit.js
View file @
94bbc634
File moved
test/officejs.html
View file @
94bbc634
...
...
@@ -16,10 +16,23 @@
<script
src=
"bw-gadget-test.js"
></script>
<script
src=
"jqs-gadget-test.js"
></script>
<script
src=
"codemirror-gadget-test.js"
"
></script>
<script
src=
"svgedit-gadget-test.js"
></script>
</head>
<body>
<div
id=
"qunit"
></div>
<div
id=
"qunit-fixture"
></div>
<div
id=
"gadget"
style=
"display:none;"
></div>
<div
id=
"svgedit-fixtures"
>
<div
id=
"fixture-1"
style=
"display: none;"
>
<svg
width=
"640"
height=
"480"
xmlns=
"http://www.w3.org/2000/svg"
>
<!-- Created with SVG-edit - http://svg-edit.googlecode.com/ -->
<g>
<title>
Layer 1
</title>
<rect
fill=
"#FF0000"
stroke=
"#000000"
stroke-width=
"5"
x=
"109"
y=
"174"
width=
"287"
height=
"54"
id=
"svg_1"
/>
<rect
fill=
"#FF0000"
stroke=
"#000000"
stroke-width=
"5"
x=
"393"
y=
"121"
width=
"99"
height=
"222"
id=
"svg_2"
/>
</g>
</svg>
</div>
</div>
</body>
</html>
test/svgedit-gadget-test.html
0 → 100644
View file @
94bbc634
<!DOCTYPE html>
<html>
<head>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, height=device-height"
/>
<title>
Test svgedit gadget
</title>
<link
rel=
"stylesheet"
href=
"../src/lib/qunit/qunit.css"
>
<script
src=
"../src/lib/jquery.js"
></script>
<script
src=
"../src/lib/qunit/qunit.js"
></script>
<script
src=
"../src/lib/sinon/sinon.js"
></script>
<script
src=
"../src/lib/rsvp.js"
></script>
<script
src=
"../src/lib/jschannel.js"
></script>
<script
src=
"../src/lib/renderjs.js"
></script>
<script
src=
"svgedit-gadget-test.js"
></script>
</head>
<body>
<div
id=
"qunit"
></div>
<div
id=
"qunit-fixture"
></div>
<div
id=
"svgedit-fixtures"
>
<div
id=
"fixture-1"
style=
"display: none;"
>
<svg
width=
"640"
height=
"480"
xmlns=
"http://www.w3.org/2000/svg"
>
<!-- Created with SVG-edit - http://svg-edit.googlecode.com/ -->
<g>
<title>
Layer 1
</title>
<rect
fill=
"#FF0000"
stroke=
"#000000"
stroke-width=
"5"
x=
"109"
y=
"174"
width=
"287"
height=
"54"
id=
"svg_1"
/>
<rect
fill=
"#FF0000"
stroke=
"#000000"
stroke-width=
"5"
x=
"393"
y=
"121"
width=
"99"
height=
"222"
id=
"svg_2"
/>
</g>
</svg>
</div>
</div>
</body>
</html>
test/svgedit-gadget-test.js
0 → 100644
View file @
94bbc634
/*global window, document, QUnit, jQuery, rJS, sinon, XMLSerializer */
/*jslint indent: 2, maxerr: 3, maxlen: 79 */
"
use strict
"
;
QUnit
.
config
.
testTimeout
=
1000
;
(
function
(
window
,
$
,
QUnit
,
rJS
)
{
//var test = QUnit.test,
var
asyncTest
=
QUnit
.
asyncTest
,
//stop = QUnit.stop,
start
=
QUnit
.
start
,
ok
=
QUnit
.
ok
,
//expect = QUnit.expect,
//throws = QUnit.throws,
//deepEqual = QUnit.deepEqual;
svgeditGadgetURL
=
'
../src/gadget/svgedit.html
'
;
function
iframeSelector
(
selectorString
)
{
return
$
(
'
iframe
'
).
contents
().
find
(
selectorString
);
}
rJS
(
window
).
ready
(
function
(
g
)
{
var
gadget_context
=
document
.
getElementById
(
'
qunit-fixture
'
);
asyncTest
(
"
[svgedit gadget] loading (iframed)
"
,
1
,
function
()
{
g
.
declareGadget
(
svgeditGadgetURL
,
{
sandbox
:
"
iframe
"
,
element
:
gadget_context
})
.
then
(
function
()
{
ok
(
iframeSelector
(
"
svg
"
)[
0
]);
})
.
always
(
start
);
});
asyncTest
(
"
[svgedit gadget] initial textarea (iframed)
"
,
1
,
function
()
{
g
.
declareGadget
(
svgeditGadgetURL
,
{
sandbox
:
"
iframe
"
,
element
:
gadget_context
})
.
then
(
function
(
gadget
)
{
return
gadget
.
getContent
();
})
.
then
(
function
(
content
)
{
ok
(
content
.
indexOf
(
'
Layer 1
'
)
!==
-
1
);
})
.
always
(
start
);
});
asyncTest
(
"
[svgedit gadget] clear content (iframed)
"
,
2
,
function
()
{
var
gadget
;
g
.
declareGadget
(
svgeditGadgetURL
,
{
sandbox
:
"
iframe
"
,
element
:
gadget_context
})
.
then
(
function
(
g
)
{
gadget
=
g
;
gadget
.
setContent
(
$
(
"
#svgedit-fixtures #fixture-1
"
).
html
())
.
then
(
gadget
.
getContent
)
.
then
(
function
(
content
)
{
ok
(
content
.
indexOf
(
'
rect
'
)
!==
-
1
);
})
.
then
(
gadget
.
clearContent
)
.
then
(
gadget
.
getContent
)
.
then
(
function
(
content
)
{
ok
(
content
.
indexOf
(
'
rect
'
)
===
-
1
);
})
.
always
(
start
);
});
});
asyncTest
(
"
[svgedit gadget] set/get content (iframed)
"
,
1
,
function
()
{
var
gadget
;
g
.
declareGadget
(
svgeditGadgetURL
,
{
sandbox
:
"
iframe
"
,
element
:
gadget_context
})
.
then
(
function
(
g
)
{
gadget
=
g
;
g
.
setContent
(
$
(
"
#svgedit-fixtures #fixture-1
"
).
html
())
.
then
(
gadget
.
getContent
)
.
then
(
function
(
content
)
{
ok
(
content
.
indexOf
(
'
rect
'
)
!==
-
1
);
})
.
always
(
start
);
});
});
});
}
(
window
,
jQuery
,
QUnit
,
rJS
));
Write
Preview
Markdown
is supported
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