Commit cba61086 authored by Aaron Wells's avatar Aaron Wells Committed by Gerrit Code Review
Browse files

Hard-coded lang string in blocktype/annotation Javascript

Bug 1431673. In order to replace this with a proper lang string,
I had to change the annotation blocktype so that it's using
the proper APIs for its JS file.

Change-Id: I5155be2505f4986e424bf2909769377de7cd8c42
parent b552de97
...@@ -242,7 +242,7 @@ function connectAnnotationFeedbackLinks() { ...@@ -242,7 +242,7 @@ function connectAnnotationFeedbackLinks() {
// Add a 'close' link at the bottom of the list for convenience. // Add a 'close' link at the bottom of the list for convenience.
if ($j('#closer_' + blockid).length == 0) { if ($j('#closer_' + blockid).length == 0) {
var closer = $j('<a id="closer_' + blockid + '" href="#" class="close-link">Close</a>').click(function(e) { var closer = $j('<a id="closer_' + blockid + '" href="#" class="close-link">' + get_string('Close') + '</a>').click(function(e) {
$j(this).parent().toggle(400, function() { $j(this).parent().toggle(400, function() {
link.focus(); link.focus();
}); });
...@@ -266,7 +266,3 @@ function connectAnnotationFeedbackLinks() { ...@@ -266,7 +266,3 @@ function connectAnnotationFeedbackLinks() {
} }
}); });
} }
addLoadEvent(connectAddAnnotationFeedbackForms);
addLoadEvent(connectAnnotationFeedbackLinks);
...@@ -137,9 +137,6 @@ class PluginBlocktypeAnnotation extends SystemBlocktype { ...@@ -137,9 +137,6 @@ class PluginBlocktypeAnnotation extends SystemBlocktype {
$view = new View($viewid); $view = new View($viewid);
list($feedbackcount, $annotationfeedback) = ArtefactTypeAnnotationfeedback::get_annotation_feedback_for_view($artefact, $view, $instance->get('id'), true, $editing); list($feedbackcount, $annotationfeedback) = ArtefactTypeAnnotationfeedback::get_annotation_feedback_for_view($artefact, $view, $instance->get('id'), true, $editing);
$smarty->assign('annotationfeedback', $annotationfeedback); $smarty->assign('annotationfeedback', $annotationfeedback);
if (!$editing) {
$smarty->assign('addannotationscript', get_config('wwwroot') . 'artefact/annotation/js/annotation.js');
}
} }
$smarty->assign('text', $text); $smarty->assign('text', $text);
$smarty->assign('artefactid', $artefactid); $smarty->assign('artefactid', $artefactid);
...@@ -321,4 +318,19 @@ class PluginBlocktypeAnnotation extends SystemBlocktype { ...@@ -321,4 +318,19 @@ class PluginBlocktypeAnnotation extends SystemBlocktype {
public static function default_copy_type() { public static function default_copy_type() {
return 'full'; return 'full';
} }
public static function get_instance_javascript(BlockInstance $bi) {
return array(
array(
'file' => 'js/annotation.js',
'initjs' => 'connectAddAnnotationFeedbackForms(); connectAnnotationFeedbackLinks();',
)
);
}
public static function jsstrings() {
return array(
'mahara' => array('Close')
);
}
} }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment