From 406f4a207d24df3af11b5d9eb911a2cdd987a9c3 Mon Sep 17 00:00:00 2001 From: Charles Holbrow Date: Thu, 21 Mar 2013 12:54:36 -0400 Subject: [PATCH] adding js script to detect arrival at course-detail page with #add-note fragment --- karmaworld/assets/js/course-addNote.js | 8 ++++++++ karmaworld/templates/courses/course_detail.html | 1 + 2 files changed, 9 insertions(+) create mode 100644 karmaworld/assets/js/course-addNote.js diff --git a/karmaworld/assets/js/course-addNote.js b/karmaworld/assets/js/course-addNote.js new file mode 100644 index 0000000..0433394 --- /dev/null +++ b/karmaworld/assets/js/course-addNote.js @@ -0,0 +1,8 @@ +if(window.location.hash) { + + // Get the first hasgh, remove the # character + var hash = window.location.hash.substring(1); + if (hash === 'add-note'){ + alert('Adding a note!'); + } +} diff --git a/karmaworld/templates/courses/course_detail.html b/karmaworld/templates/courses/course_detail.html index f0e18eb..47e62dd 100644 --- a/karmaworld/templates/courses/course_detail.html +++ b/karmaworld/templates/courses/course_detail.html @@ -6,6 +6,7 @@ +