Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
dd5a7e7b
Commit
dd5a7e7b
authored
Apr 05, 2013
by
Vasyl Nakvasiuk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
initialize JS for word_cloud
parent
4b3fe54d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
64 additions
and
328 deletions
+64
-328
common/lib/xmodule/xmodule/js/src/word_cloud/word_cloud.js
+4
-322
common/lib/xmodule/xmodule/js/src/word_cloud/word_cloud_main.js
+59
-5
lms/templates/word_cloud.html
+1
-1
No files found.
common/lib/xmodule/xmodule/js/src/word_cloud/word_cloud.js
View file @
dd5a7e7b
This diff is collapsed.
Click to expand it.
common/lib/xmodule/xmodule/js/src/word_cloud/word_cloud_main.js
View file @
dd5a7e7b
window
.
Poll
=
function
(
el
)
{
(
function
(
requirejs
,
require
,
define
)
{
RequireJS
.
require
([
'PollMain'
],
function
(
PollMain
)
{
define
(
'WordCloudMain'
,
[
'logme'
],
function
(
logme
)
{
new
PollMain
(
el
);
});
WordCloudMain
.
prototype
=
{
};
'submitAnswer'
:
function
(
answer
,
answerObj
)
{
var
_this
;
_this
=
this
;
console
.
log
(
'submit answer'
);
answerObj
.
buttonEl
.
addClass
(
'answered'
);
// Send the data to the server as an AJAX request. Attach a callback that will
// be fired on server's response.
$
.
postWithPrefix
(
_this
.
ajax_url
+
'/'
+
answer
,
{},
function
(
response
)
{
console
.
log
(
'success! response = '
);
console
.
log
(
response
);
_this
.
showWordCloud
(
response
.
poll_answers
,
response
.
total
);
}
);
},
// End-of: 'submitAnswer': function (answer, answerEl) {
'showWordCloud'
:
function
(){
console
.
log
(
'TADAM!!!'
)
},
};
// End-of: WordCloudMain.prototype = {
return
WordCloudMain
;
function
WordCloudMain
(
el
)
{
var
_this
;
this
.
questionEl
=
$
(
el
).
find
(
'.poll_question'
);
if
(
this
.
questionEl
.
length
!==
1
)
{
// We require one question DOM element.
logme
(
'ERROR: WordCloudMain constructor requires one question DOM element.'
);
return
;
}
// Access this object inside inner functions.
_this
=
this
;
this
.
submitAnswer
(
this
.
questionEl
)
}
// End-of: function WordCloudMain(el) {
});
// End-of: define('WordCloudMain', ['logme'], function (logme) {
// End-of: (function (requirejs, require, define) {
}(
RequireJS
.
requirejs
,
RequireJS
.
require
,
RequireJS
.
define
));
lms/templates/word_cloud.html
View file @
dd5a7e7b
<section
<section
id=
"
poll
_${element_id}"
id=
"
word_cloud
_${element_id}"
class=
"${element_class}"
class=
"${element_class}"
data-ajax-url=
"${ajax_url}"
data-ajax-url=
"${ajax_url}"
>
>
...
...
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