Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
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
Xiaowu Zhang
renderjs
Commits
86809e30
Commit
86809e30
authored
Jan 21, 2014
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Drop useless gadget parameter to the selector.
parent
91c789e9
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
17 deletions
+15
-17
examples/officejs/aceeditor.js
examples/officejs/aceeditor.js
+2
-2
examples/officejs/editor.js
examples/officejs/editor.js
+2
-2
examples/officejs/io.js
examples/officejs/io.js
+5
-5
examples/officejs/jqteditor.js
examples/officejs/jqteditor.js
+3
-3
renderjs.js
renderjs.js
+0
-2
test/embedded.js
test/embedded.js
+3
-3
No files found.
examples/officejs/aceeditor.js
View file @
86809e30
...
@@ -5,10 +5,10 @@
...
@@ -5,10 +5,10 @@
var
gk
=
rJS
(
window
);
var
gk
=
rJS
(
window
);
gk
.
declareMethod
(
'
setContent
'
,
function
(
value
)
{
gk
.
declareMethod
(
'
setContent
'
,
function
(
value
)
{
rJS
(
this
)
.
editor
.
getSession
().
setValue
(
value
);
this
.
editor
.
getSession
().
setValue
(
value
);
})
})
.
declareMethod
(
'
getContent
'
,
function
()
{
.
declareMethod
(
'
getContent
'
,
function
()
{
return
rJS
(
this
)
.
editor
.
getSession
().
getValue
();
return
this
.
editor
.
getSession
().
getValue
();
});
});
gk
.
ready
(
function
(
g
)
{
gk
.
ready
(
function
(
g
)
{
...
...
examples/officejs/editor.js
View file @
86809e30
...
@@ -11,11 +11,11 @@
...
@@ -11,11 +11,11 @@
var
gk
=
rJS
(
window
);
var
gk
=
rJS
(
window
);
gk
.
declareMethod
(
'
setContent
'
,
function
(
value
)
{
gk
.
declareMethod
(
'
setContent
'
,
function
(
value
)
{
rJS
(
this
)
.
element
.
getElementsByTagName
(
'
textarea
'
)[
0
].
value
=
this
.
element
.
getElementsByTagName
(
'
textarea
'
)[
0
].
value
=
escape_text
(
value
);
escape_text
(
value
);
})
})
.
declareMethod
(
'
getContent
'
,
function
()
{
.
declareMethod
(
'
getContent
'
,
function
()
{
return
rJS
(
this
)
.
element
.
getElementsByTagName
(
'
textarea
'
)[
0
].
value
;
return
this
.
element
.
getElementsByTagName
(
'
textarea
'
)[
0
].
value
;
});
});
}(
window
,
rJS
));
}(
window
,
rJS
));
examples/officejs/io.js
View file @
86809e30
...
@@ -4,16 +4,16 @@
...
@@ -4,16 +4,16 @@
var
gk
=
rJS
(
window
);
var
gk
=
rJS
(
window
);
gk
.
declareMethod
(
'
configureIO
'
,
function
(
key
)
{
gk
.
declareMethod
(
'
configureIO
'
,
function
(
key
)
{
rJS
(
this
)
.
jio
=
jIO
.
createJIO
({
this
.
jio
=
jIO
.
createJIO
({
"
type
"
:
"
local
"
,
"
type
"
:
"
local
"
,
"
username
"
:
"
couscous
"
,
"
username
"
:
"
couscous
"
,
"
application_name
"
:
"
renderjs
"
"
application_name
"
:
"
renderjs
"
});
});
rJS
(
this
)
.
jio_key
=
key
;
this
.
jio_key
=
key
;
})
})
.
declareMethod
(
'
getIO
'
,
function
()
{
.
declareMethod
(
'
getIO
'
,
function
()
{
var
gadget
=
rJS
(
this
)
;
var
gadget
=
this
;
return
gadget
.
jio
.
getAttachment
({
return
gadget
.
jio
.
getAttachment
({
"
_id
"
:
gadget
.
jio_key
,
"
_id
"
:
gadget
.
jio_key
,
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
})
})
.
declareMethod
(
'
setIO
'
,
function
(
value
)
{
.
declareMethod
(
'
setIO
'
,
function
(
value
)
{
var
gadget
=
rJS
(
this
)
;
var
gadget
=
this
;
return
gadget
.
jio
.
put
({
"
_id
"
:
gadget
.
jio_key
})
return
gadget
.
jio
.
put
({
"
_id
"
:
gadget
.
jio_key
})
.
then
(
function
()
{
.
then
(
function
()
{
...
@@ -40,7 +40,7 @@
...
@@ -40,7 +40,7 @@
})
})
.
declareMethod
(
'
configureDataSourceCallback
'
,
function
(
that
,
callback
)
{
.
declareMethod
(
'
configureDataSourceCallback
'
,
function
(
that
,
callback
)
{
var
g
=
rJS
(
this
)
;
var
g
=
this
;
$
(
g
.
element
).
find
(
'
a
'
).
unbind
(
'
click
'
).
click
(
function
()
{
$
(
g
.
element
).
find
(
'
a
'
).
unbind
(
'
click
'
).
click
(
function
()
{
callback
.
apply
(
that
).
then
(
function
(
value
)
{
callback
.
apply
(
that
).
then
(
function
(
value
)
{
g
.
setIO
(
value
);
g
.
setIO
(
value
);
...
...
examples/officejs/jqteditor.js
View file @
86809e30
...
@@ -4,11 +4,11 @@
...
@@ -4,11 +4,11 @@
var
gk
=
rJS
(
window
);
var
gk
=
rJS
(
window
);
gk
.
declareMethod
(
'
setContent
'
,
function
(
value
)
{
gk
.
declareMethod
(
'
setContent
'
,
function
(
value
)
{
// return
rJS(this)
.context.find('textarea').val(escape_text(value));
// return
this
.context.find('textarea').val(escape_text(value));
return
$
(
rJS
(
this
)
.
element
).
find
(
'
#textarea-b
'
).
jqteVal
(
value
);
return
$
(
this
.
element
).
find
(
'
#textarea-b
'
).
jqteVal
(
value
);
})
})
.
declareMethod
(
'
getContent
'
,
function
()
{
.
declareMethod
(
'
getContent
'
,
function
()
{
return
$
(
rJS
(
this
)
.
element
).
find
(
'
#textarea-b
'
).
val
();
return
$
(
this
.
element
).
find
(
'
#textarea-b
'
).
val
();
});
});
gk
.
ready
(
function
(
g
)
{
gk
.
ready
(
function
(
g
)
{
...
...
renderjs.js
View file @
86809e30
...
@@ -331,8 +331,6 @@
...
@@ -331,8 +331,6 @@
// window is the 'this' value when loading a javascript file
// window is the 'this' value when loading a javascript file
// In this case, use the current loading gadget constructor
// In this case, use the current loading gadget constructor
result
=
gadget_loading_klass
;
result
=
gadget_loading_klass
;
}
else
if
(
selector
instanceof
RenderJSGadget
)
{
result
=
selector
;
}
}
if
(
result
===
undefined
)
{
if
(
result
===
undefined
)
{
throw
new
Error
(
"
Unknown selector '
"
+
selector
+
"
'
"
);
throw
new
Error
(
"
Unknown selector '
"
+
selector
+
"
'
"
);
...
...
test/embedded.js
View file @
86809e30
...
@@ -14,13 +14,13 @@
...
@@ -14,13 +14,13 @@
throw
new
Error
(
"
Manually triggered embedded error
"
);
throw
new
Error
(
"
Manually triggered embedded error
"
);
})
})
.
declareMethod
(
'
triggerEvent
'
,
function
(
value
)
{
.
declareMethod
(
'
triggerEvent
'
,
function
(
value
)
{
return
rJS
(
this
)
.
trigger
(
'
fooTrigger
'
,
'
barValue
'
);
return
this
.
trigger
(
'
fooTrigger
'
,
'
barValue
'
);
})
})
.
declareMethod
(
'
setContent
'
,
function
(
value
)
{
.
declareMethod
(
'
setContent
'
,
function
(
value
)
{
rJS
(
this
)
.
embedded_property
=
value
;
this
.
embedded_property
=
value
;
})
})
.
declareMethod
(
'
getContent
'
,
function
()
{
.
declareMethod
(
'
getContent
'
,
function
()
{
return
rJS
(
this
)
.
embedded_property
;
return
this
.
embedded_property
;
});
});
}(
window
,
rJS
));
}(
window
,
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