Commit 0116a5db authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Merge "Hard-coded lang string in blocktype/annotation Javascript"

parents 85fededf cba61086
......@@ -242,7 +242,7 @@ function connectAnnotationFeedbackLinks() {
// Add a 'close' link at the bottom of the list for convenience.
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() {
link.focus();
});
......@@ -266,7 +266,3 @@ function connectAnnotationFeedbackLinks() {
}
});
}
addLoadEvent(connectAddAnnotationFeedbackForms);
addLoadEvent(connectAnnotationFeedbackLinks);
......@@ -137,9 +137,6 @@ class PluginBlocktypeAnnotation extends SystemBlocktype {
$view = new View($viewid);
list($feedbackcount, $annotationfeedback) = ArtefactTypeAnnotationfeedback::get_annotation_feedback_for_view($artefact, $view, $instance->get('id'), true, $editing);
$smarty->assign('annotationfeedback', $annotationfeedback);
if (!$editing) {
$smarty->assign('addannotationscript', get_config('wwwroot') . 'artefact/annotation/js/annotation.js');
}
}
$smarty->assign('text', $text);
$smarty->assign('artefactid', $artefactid);
......@@ -321,4 +318,19 @@ class PluginBlocktypeAnnotation extends SystemBlocktype {
public static function default_copy_type() {
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