adding js script to detect arrival at course-detail page with #add-note fragment
authorCharles Holbrow <charlesholbrow@gmail.com>
Thu, 21 Mar 2013 16:54:36 +0000 (12:54 -0400)
committerCharles Holbrow <charlesholbrow@gmail.com>
Thu, 21 Mar 2013 16:54:36 +0000 (12:54 -0400)
karmaworld/assets/js/course-addNote.js [new file with mode: 0644]
karmaworld/templates/courses/course_detail.html

diff --git a/karmaworld/assets/js/course-addNote.js b/karmaworld/assets/js/course-addNote.js
new file mode 100644 (file)
index 0000000..0433394
--- /dev/null
@@ -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!');
+  }
+}
index f0e18ebca034176be777fa6eb8661c4bf952128d..47e62dd034e4d958ee683cd99f9325c76b18f881 100644 (file)
@@ -6,6 +6,7 @@
   <script src="{{ STATIC_URL }}js/bootstrap-modal.js" ></script>
   <script src="{{ STATIC_URL }}ajaxuploader/js/fileuploader.js" ></script>
   <script src="{{ STATIC_URL }}js/lightboxupload.js" ></script>
+  <script src="{{ STATIC_URL }}js/course-addNote.js" ></script>
   <script>
     var courseId  = {{ course.id }};
     var csrf_token = "{{ csrf_token }}";