Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
renderjs
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gabriel Monnerat
renderjs
Commits
381dafb4
Commit
381dafb4
authored
Aug 06, 2013
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
JSLint examples.
parent
90a54b2f
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
84 additions
and
75 deletions
+84
-75
Makefile
Makefile
+6
-3
examples/officejs/aceeditor.js
examples/officejs/aceeditor.js
+5
-5
examples/officejs/catalog.js
examples/officejs/catalog.js
+17
-17
examples/officejs/editor.js
examples/officejs/editor.js
+5
-5
examples/officejs/io.js
examples/officejs/io.js
+8
-8
examples/officejs/jqteditor.js
examples/officejs/jqteditor.js
+4
-4
examples/officejs/officejs.js
examples/officejs/officejs.js
+39
-33
No files found.
Makefile
View file @
381dafb4
...
...
@@ -3,6 +3,8 @@ RENDERJS = renderjs.js
RENDERJS_MIN
=
renderjs.min.js
BUILDDIR
=
tmp
LINT_OPTS
=
--maxlen
79
--indent
2
--maxerr
3
include
config.mk
all
:
external lint test build doc
...
...
@@ -67,10 +69,11 @@ lib/jio/complex_queries.js:
$(RENDERJS_MIN)
:
$(RENDERJS)
$(UGLIFY_CMD)
"
$<
"
>
"
$@
"
${BUILDDIR}/$(RENDERJS).lint
:
$(RENDERJS) test/renderjs_test.js
${BUILDDIR}/$(RENDERJS).lint
:
$(RENDERJS) test/renderjs_test.js
examples/officejs/*.js
@
mkdir
-p
$
(
@D
)
$(LINT_CMD)
"
$(RENDERJS)
"
$(LINT_CMD)
"test/renderjs_test.js"
$(LINT_CMD)
$(LINT_OPTS)
"
$(RENDERJS)
"
$(LINT_CMD)
$(LINT_OPTS)
"test/renderjs_test.js"
$(LINT_CMD)
$(LINT_OPTS)
examples/officejs/
*
.js
touch
$@
${BUILDDIR}/index.html.ok
:
test/index.html
...
...
examples/officejs/aceeditor.js
View file @
381dafb4
...
...
@@ -22,4 +22,4 @@
// editor.getSession().setMode("ace/mode/javascript");
});
}(
window
,
jQuery
,
rJS
,
ace
))
}(
window
,
jQuery
,
rJS
,
ace
))
;
examples/officejs/catalog.js
View file @
381dafb4
...
...
@@ -52,4 +52,4 @@
return
deferred
.
promise
();
});
}(
window
,
$
,
rJS
))
}(
window
,
jQuery
,
rJS
));
examples/officejs/editor.js
View file @
381dafb4
...
...
@@ -7,7 +7,7 @@
return
text
.
replace
(
/&/g
,
"
&
"
)
.
replace
(
/</g
,
"
<
"
)
.
replace
(
/>/g
,
"
>
"
);
}
;
}
var
gk
=
rJS
(
window
);
...
...
@@ -18,4 +18,4 @@
return
rJS
(
this
).
context
.
find
(
'
textarea
'
).
val
();
});
}(
window
,
$
,
rJS
))
}(
window
,
jQuery
,
rJS
));
examples/officejs/io.js
View file @
381dafb4
...
...
@@ -73,4 +73,4 @@
});
});
}(
window
,
$
,
jIO
,
rJS
))
}(
window
,
jQuery
,
jIO
,
rJS
));
examples/officejs/jqteditor.js
View file @
381dafb4
...
...
@@ -16,4 +16,4 @@
var
g
=
rJS
(
this
);
g
.
context
.
find
(
"
#textarea-b
"
).
jqte
();
});
}(
window
,
$
,
rJS
))
}(
window
,
jQuery
,
rJS
));
examples/officejs/officejs.js
View file @
381dafb4
...
...
@@ -21,43 +21,49 @@
io_a_context
=
g
.
context
.
find
(
"
.editor_a_safe
"
).
last
();
// editor_b_context = g.context.find(".editor_b").last(),
// io_b_context = g.context.find(".editor_b_safe").last();
;
// First, load the catalog gadget
g
.
declareGadget
(
'
./catalog.html
'
,
catalog_context
).
done
(
function
(
catalog
)
{
g
.
declareGadget
(
'
./catalog.html
'
,
catalog_context
).
done
(
function
(
catalog
)
{
// Fetch the list of editor and io gadgets
// This is done in 2 different queries to the catalog
$
.
when
(
catalog
.
allDocs
(
{
query
:
'
interface: "http://www.renderjs.org/interface/editor"
'
}),
{
query
:
'
interface: "http://www.renderjs.org/interface/editor"
'
}
),
catalog
.
allDocs
(
{
query
:
'
interface: "http://www.renderjs.org/interface/io"
'
}))
.
done
(
function
(
editor_list
,
io_list
)
{
{
query
:
'
interface: "http://www.renderjs.org/interface/io"
'
}
)
).
done
(
function
(
editor_list
,
io_list
)
{
var
panel_context
=
g
.
context
.
find
(
"
.bare_panel
"
);
// Load 1 editor and 1 IO and plug them
$
.
when
(
g
.
declareIframedGadget
(
editor_list
[
0
].
path
,
editor_a_context
),
g
.
declareGadget
(
io_list
[
0
].
path
,
io_a_context
),
"
officejs
"
).
done
(
attachIOToEditor
);
"
officejs
"
).
done
(
attachIOToEditor
);
// Fill the panel
$
.
each
(
editor_list
,
function
(
i
,
editor_definition
)
{
$
.
each
(
editor_list
,
function
(
i
,
editor_definition
)
{
panel_context
.
append
(
'
<a href="#" data-role="button" data-icon="edit"
'
+
'
data-iconpos="left">
'
+
editor_definition
.
title
+
'
</a>
'
);
'
data-iconpos="left">
'
+
editor_definition
.
title
+
'
</a>
'
);
panel_context
.
find
(
'
a
'
).
last
().
click
(
function
()
{
$
.
when
(
g
.
declareIframedGadget
(
editor_definition
.
path
,
editor_a_context
),
g
.
declareIframedGadget
(
editor_definition
.
path
,
editor_a_context
),
g
.
declareGadget
(
io_list
[
0
].
path
,
io_a_context
),
"
officejs
"
).
done
(
attachIOToEditor
);
"
officejs
"
).
done
(
attachIOToEditor
);
});
});
panel_context
.
trigger
(
'
create
'
);
});
}
);
}
);
// $.when(
// g.declareGadget('./jqteditor.html', editor_a_context),
...
...
@@ -70,4 +76,4 @@
// "officejs_b").done(attachIOToEditor);
});
}(
window
,
$
,
rJS
))
}(
window
,
jQuery
,
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