diff --git a/common/static/js/vendor/ova/catch/js/catch.js b/common/static/js/vendor/ova/catch/js/catch.js index c2f16b98e4..130d51a35e 100644 --- a/common/static/js/vendor/ova/catch/js/catch.js +++ b/common/static/js/vendor/ova/catch/js/catch.js @@ -106,7 +106,7 @@ annotationMediaSelector: '
  • '+ gettext('Video')+ '
  • '+ - 'li class="ui-state-default" media="image">'+ + '
  • '+ gettext('Image')+ '
  • '+ '', @@ -815,6 +815,10 @@ CatchAnnotation.prototype = { var allannotations = this.annotator.plugins['Store'].annotations, osda = this.annotator.osda; + if(this.options.externalLink){ + uri += (uri.indexOf('?') >= 0)?'&osdaId='+osdaId:'?osdaId='+osdaId; + location.href = uri; + } for(var item in allannotations){ var an = allannotations[item]; if (typeof an.id!='undefined' && an.id == osdaId){//this is the annotation diff --git a/lms/djangoapps/notes/views.py b/lms/djangoapps/notes/views.py index 88dc78f741..f121e2473a 100644 --- a/lms/djangoapps/notes/views.py +++ b/lms/djangoapps/notes/views.py @@ -1,6 +1,7 @@ from django.contrib.auth.decorators import login_required from django.http import Http404 from edxmako.shortcuts import render_to_response +from opaque_keys.edx.locations import SlashSeparatedCourseKey from courseware.courses import get_course_with_access from notes.models import Note from notes.utils import notes_enabled_for_course @@ -10,12 +11,12 @@ from xmodule.annotator_token import retrieve_token @login_required def notes(request, course_id): ''' Displays the student's notes. ''' - - course = get_course_with_access(request.user, 'load', course_id) + course_key = SlashSeparatedCourseKey.from_deprecated_string(course_id) + course = get_course_with_access(request.user, 'load', course_key) if not notes_enabled_for_course(course): raise Http404 - notes = Note.objects.filter(course_id=course_id, user=request.user).order_by('-created', 'uri') + notes = Note.objects.filter(course_id=course_key, user=request.user).order_by('-created', 'uri') student = request.user storage = course.annotation_storage_url @@ -25,6 +26,7 @@ def notes(request, course_id): 'student': student, 'storage': storage, 'token': retrieve_token(student.email, course.annotation_token_secret), + 'default_tab': 'myNotes', } return render_to_response('notes.html', context) diff --git a/lms/templates/notes.html b/lms/templates/notes.html index 58f81be274..569393daaa 100644 --- a/lms/templates/notes.html +++ b/lms/templates/notes.html @@ -1,6 +1,10 @@ <%! from django.utils.translation import ugettext as _ %> <%namespace name='static' file='static_content.html'/> +${static.css(group='style-vendor-tinymce-content', raw=True)} +${static.css(group='style-vendor-tinymce-skin', raw=True)} + + <%inherit file="main.html" /> <%! from django.core.urlresolvers import reverse @@ -102,7 +106,7 @@ if (annotation.permissions) { tokens = annotation.permissions[action] || []; if (is_staff){ - return true; + return true; } if (tokens.length === 0) { return true; @@ -128,7 +132,7 @@ }, }, auth: { - tokenUrl: location.protocol+'//'+location.host+"/token?course_id=${course.id.to_deprecated_string()}" + token: "${token}" }, store: { // The endpoint of the store on your server. @@ -158,37 +162,34 @@ optionsRichText: { tinymce:{ selector: "li.annotator-item textarea", - plugins: "media image insertdatetime link code", + plugins: "media image codemirror", menubar: false, toolbar_items_size: 'small', extended_valid_elements : "iframe[src|frameborder|style|scrolling|class|width|height|name|align|id]", - toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image media rubric | code ", + toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | image rubric | code ", } - return true; - }, - }, - auth: { - token: "${token}" - }, - store: { - // The endpoint of the store on your server. - prefix: "${storage}", - - annotationData: {}, - - urls: { - // These are the default URLs. - create: '/create', - read: '/read/:id', - update: '/update/:id', - destroy: '/delete/:id', - search: '/search' }, + auth: { + token: "${token}" + }, + store: { + // The endpoint of the store on your server. + prefix: "${storage}", + + annotationData: {}, + + urls: { + // These are the default URLs. + create: '/create', + read: '/read/:id', + update: '/update/:id', + destroy: '/delete/:id', + search: '/search' + }, + } }; - tinyMCE.baseURL = "${settings.STATIC_URL}" + "js/vendor/ova"; var imgURLRoot = "${settings.STATIC_URL}" + "js/vendor/ova/catch/img/"; - //remove old instances if (Annotator._instances.length !== 0) { $('#notesHolder').annotator("destroy"); @@ -207,7 +208,8 @@ showMediaSelector: true, showPublicPrivate: true, pagination:pagination,//Number of Annotations per load in the pagination, - flags:is_staff + flags:is_staff, + default_tab: "${default_tab}", }, Catch = new CatchAnnotation($('#catchDIV'),catchOptions);