Commits

Benoit Chesneau  committed c6f924e

use javascript objects.

  • Participants
  • Parent commits ee1a1f6

Comments (0)

Files changed (3)

File static/js/src/friendpaste.js

 
 */
 
+var Friendpaste = function() {
+    this.init();
+}
 
-var Friendpaste = {
+Friendpaste.prototype = {
     snippet: null,
     snippet_edit: null,
 
 
 };
 
-var Diff = {
+var Diff = function() {
+    this.init();
+}
+
+Diff.prototype = {
     init: function() {
         this.sourcetable = $(".sourcetable");
         this.difftabular = $(".difftabular");

File templates/paste/diff.html

 </div>
 <p id="dl"><strong>Download in other format:</strong><br /><a href="/{{ snippet.pasteid }}/changeset?rev={{ rev }}&amp;format=raw">Unified diff</a></p>
 <script type="text/javascript">
-    Friendpaste.init();
-    Diff.init();
+    new Friendpaste();
+    new Diff();
     
 </script>
 {% endblock %}

File templates/paste/view.html

 </div>
 
 <script type="text/javascript">
-    Friendpaste.init();
+    new Friendpaste();
     
 </script>
 {% endblock %}