Gitlab CSE Unil
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
M. Chardon
moodle-assignfeedback_editpdfplus
Commits
824165fd
Commit
824165fd
authored
Aug 11, 2017
by
M. Chardon
Browse files
manipulation axes
parent
1daa79c5
Changes
6
Expand all
Show whitespace changes
Inline
Side-by-side
amd/build/admin_panel.min.js
View file @
824165fd
This diff is collapsed.
Click to expand it.
amd/src/admin_panel.js
View file @
824165fd
...
...
@@ -57,11 +57,17 @@ define(['jquery'/*, 'core/yui'*/, 'core/notification', 'core/templates', 'core/f
var
selectAxis
=
$
(
"
#editpdlplus_axes
"
).
val
();
$
(
"
#editpdlplus_toolbar_
"
+
selectAxis
).
show
();
var
canBeDelete
=
$
(
"
#editpdlplus_axes option:selected
"
).
data
(
'
delete
'
);
if
(
canBeDelete
&&
parseInt
(
canBeDelete
)
>
0
)
{
if
(
canBeDelete
)
{
if
(
parseInt
(
canBeDelete
)
>
0
)
{
$
(
"
#assignfeedback_editpdfplus_widget_admin_button_delaxis
"
).
addClass
(
"
disabled
"
);
}
else
{
$
(
"
#assignfeedback_editpdfplus_widget_admin_button_delaxis
"
).
removeClass
(
"
disabled
"
);
}
}
else
{
$
(
"
#editpdlplus_axes option[value='
"
+
selectAxis
+
"
']
"
).
data
(
'
delete
'
,
0
);
$
(
"
#assignfeedback_editpdfplus_widget_admin_button_delaxis
"
).
removeClass
(
"
disabled
"
);
}
$
(
'
#toolworkspace
'
).
html
(
""
);
});
$
(
"
#editpdlplus_axes
"
).
change
();
//
...
...
@@ -154,6 +160,8 @@ define(['jquery'/*, 'core/yui'*/, 'core/notification', 'core/templates', 'core/f
$
(
"
#axistool
"
).
hide
();
$
(
'
#assignfeedback_editpdfplus_widget_admin_div_addaxis
'
).
show
();
$
(
'
#assignfeedback_editpdfplus_widget_admin_div_addaxis > .panel-body
'
).
html
(
""
);
$
(
'
#assignfeedback_editpdfplus_widget_admin_toolheader
'
).
hide
();
$
(
'
#assignfeedback_editpdfplus_widget_admin_toolworkspace
'
).
hide
();
var
params
=
{};
fragment
.
loadFragment
(
'
assignfeedback_editpdfplus
'
,
'
axisadd
'
,
contextid
,
params
)
.
done
(
function
(
html
,
js
)
{
...
...
@@ -166,6 +174,8 @@ define(['jquery'/*, 'core/yui'*/, 'core/notification', 'core/templates', 'core/f
$
(
"
#axistool
"
).
hide
();
$
(
'
#assignfeedback_editpdfplus_widget_admin_div_editaxis
'
).
show
();
$
(
'
#assignfeedback_editpdfplus_widget_admin_div_editaxis > .panel-body
'
).
html
(
""
);
$
(
'
#assignfeedback_editpdfplus_widget_admin_toolheader
'
).
hide
();
$
(
'
#assignfeedback_editpdfplus_widget_admin_toolworkspace
'
).
hide
();
/*var context = {name: 'Tweety bird', intelligence: 2};
templates.render('assignfeedback_editpdfplus/admin_axis_add', context)
// It returns a promise that needs to be resoved.
...
...
@@ -188,6 +198,8 @@ define(['jquery'/*, 'core/yui'*/, 'core/notification', 'core/templates', 'core/f
$
(
"
#axistool
"
).
hide
();
$
(
'
#assignfeedback_editpdfplus_widget_admin_div_delaxis
'
).
show
();
$
(
'
#assignfeedback_editpdfplus_widget_admin_div_delaxis > .panel-body
'
).
html
(
""
);
$
(
'
#assignfeedback_editpdfplus_widget_admin_toolheader
'
).
hide
();
$
(
'
#assignfeedback_editpdfplus_widget_admin_toolworkspace
'
).
hide
();
var
axeid
=
$
(
"
#editpdlplus_axes option:selected
"
).
val
();
var
params
=
{
axeid
:
axeid
};
fragment
.
loadFragment
(
'
assignfeedback_editpdfplus
'
,
'
axisdel
'
,
contextid
,
params
)
...
...
@@ -497,7 +509,7 @@ define(['jquery'/*, 'core/yui'*/, 'core/notification', 'core/templates', 'core/f
$
(
"
#editpdlplus_toolbar_
"
+
toolbar
[
0
].
axeid
).
append
(
buttonTmp
);
}
$
(
"
.editpdlplus_tool
"
).
on
(
"
click
"
,
refreshToolView
);
$
(
'
#
editpdlplus_tool_item
'
).
html
(
""
);
$
(
'
#
toolworkspace
'
).
html
(
""
);
}
else
{
$
(
"
#message_edit_tool
"
).
html
(
toolbar
[
0
].
message
);
$
(
"
#message_edit_tool
"
).
addClass
(
"
alert-danger
"
);
...
...
amd/src/editplus.js
deleted
100644 → 0
View file @
1daa79c5
// Standard license block omitted.
/*
* @package assignfeedback_editpdfplus
* @copyright 2015 Someone cool
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* @module mod_assignfeedback_editpdfplus/editplus
*/
define
([
'
jquery
'
],
function
(
$
)
{
/**
* @constructor
* @alias module:mod_assignfeedback_editpdfplus/editplus
*/
var
greeting
=
function
()
{
/** @access private */
//var privateThoughts = 'I like the colour blue';
$
(
"
#id
"
).
val
();
/** @access public */
this
.
publicThoughts
=
'
I like the colour orange
'
;
};
/**
* A formal greeting.
* @access public
* @return {string}
*/
greeting
.
prototype
.
formal
=
function
()
{
return
'
How do you do?
'
;
};
/**
* An informal greeting.
* @access public
* @return {string}
*/
greeting
.
prototype
.
informal
=
function
()
{
return
'
Wassup!
'
;
};
return
{
init
:
function
()
{
alert
(
"
hello
"
);
}
};
});
\ No newline at end of file
templates/admin.mustache
View file @
824165fd
...
...
@@ -55,7 +55,8 @@
<div
class=
"panel-body"
></div>
</div>
</div>
<div
class=
'col-sm-10'
>
<div
class=
'col-sm-10'
id=
'assignfeedback_editpdfplus_widget_admin_toolworkspace'
>
<div
id=
'editpdlplus_toolbars'
>
{{#
toolbars
}}
<div
id=
"editpdlplus_toolbar_
{{
axis
.
id
}}
"
class=
"btn-group toolbar"
style=
"display: none;"
>
{{#
tools
}}
...
...
@@ -65,6 +66,7 @@
{{/
tools
}}
</div>
{{/
toolbars
}}
</div>
<div
id=
"editpdlplus_tool_item"
style=
"margin-top: 10px;"
></div>
...
...
templates/axis_del_form.mustache
View file @
824165fd
...
...
@@ -33,11 +33,16 @@ require(['jquery','core/ajax','core/notification'], function($,ajax,notification
}else{
$('#assignfeedback_editpdfplus_widget_admin_div_delaxis > .panel-body > .panel > .panel-body').append("
<div
class=
'alert alert-danger'
style=
'margin-top: 5px;'
>
"+message[0].message+"
</div>
");
}
$("#axistool").show();
$('#assignfeedback_editpdfplus_widget_admin_toolheader').show();
$('#assignfeedback_editpdfplus_widget_admin_toolworkspace').show();
}).fail(notification.exception);
});
$("#axisDelCancel").on("click", function () {
$('#assignfeedback_editpdfplus_widget_admin_div_delaxis > .panel-body').html("");
$("#axistool").show();
$('#assignfeedback_editpdfplus_widget_admin_toolheader').show();
$('#assignfeedback_editpdfplus_widget_admin_toolworkspace').show();
});
});
{{/
js
}}
\ No newline at end of file
templates/axis_form.mustache
View file @
824165fd
...
...
@@ -25,14 +25,20 @@ require(['jquery','core/ajax','core/notification'], function($,ajax,notification
}
])[0].done(function(axe) {
if ('
{{
action
}}
' === 'add'){
var divAxis = "
<div
id=
'editpdlplus_toolbar_"+axe[0].axeid+"'
class=
'btn-group toolbar'
style=
'display: none;'
></div>
";
$('#editpdlplus_toolbars').append(divAxis);
$('#assignfeedback_editpdfplus_widget_admin_div_addaxis > .panel-body').html("");
$("#editpdlplus_axes").append(new Option(axe[0].axelabel, axe[0].axeid, true, true));
var option=new Option(axe[0].axelabel, axe[0].axeid, true, true);
$("#editpdlplus_axes").append(option);
$("#editpdlplus_axes").change();
$('#editpdlplus_tool_item').html("");
} else {
$('#assignfeedback_editpdfplus_widget_admin_div_editaxis > .panel-body').html("");
$("#editpdlplus_axes option:selected").html(axe[0].axelabel);
}
$("#axistool").show();
$('#assignfeedback_editpdfplus_widget_admin_toolheader').show();
$('#assignfeedback_editpdfplus_widget_admin_toolworkspace').show();
}).fail(notification.exception);
});
$("#axisFormCancel").on("click", function () {
...
...
@@ -42,6 +48,8 @@ require(['jquery','core/ajax','core/notification'], function($,ajax,notification
$('#assignfeedback_editpdfplus_widget_admin_div_editaxis > .panel-body').html("");
}
$("#axistool").show();
$('#assignfeedback_editpdfplus_widget_admin_toolheader').show();
$('#assignfeedback_editpdfplus_widget_admin_toolworkspace').show();
});
});
{{/
js
}}
\ No newline at end of file
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