You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bloodhound.apache.org by an...@apache.org on 2013/09/18 16:46:19 UTC

svn commit: r1524433 - in /bloodhound/branches/livesyntaxhighlighting/bloodhound_livesyntaxhighlighting: ./ bhlivesyntaxhighlight/ bhlivesyntaxhighlight/htdocs/css/ bhlivesyntaxhighlight/htdocs/js/

Author: anoopknayak
Date: Wed Sep 18 14:46:18 2013
New Revision: 1524433

URL: http://svn.apache.org/r1524433
Log: (empty)

Modified:
    bloodhound/branches/livesyntaxhighlighting/bloodhound_livesyntaxhighlighting/   (props changed)
    bloodhound/branches/livesyntaxhighlighting/bloodhound_livesyntaxhighlighting/bhlivesyntaxhighlight/bhlivesyntaxhighlight.py
    bloodhound/branches/livesyntaxhighlighting/bloodhound_livesyntaxhighlighting/bhlivesyntaxhighlight/htdocs/css/codemirror.css
    bloodhound/branches/livesyntaxhighlighting/bloodhound_livesyntaxhighlighting/bhlivesyntaxhighlight/htdocs/js/codemirror.js
    bloodhound/branches/livesyntaxhighlighting/bloodhound_livesyntaxhighlighting/bhlivesyntaxhighlight/htdocs/js/livesyntaxhighlight.js

Propchange: bloodhound/branches/livesyntaxhighlighting/bloodhound_livesyntaxhighlighting/
------------------------------------------------------------------------------
--- svn:global-ignores (original)
+++ svn:global-ignores Wed Sep 18 14:46:18 2013
@@ -1,3 +1,4 @@
 *.codeintel
+*.egg-info
 *.sublime-project
 *.sublime-workspace

Modified: bloodhound/branches/livesyntaxhighlighting/bloodhound_livesyntaxhighlighting/bhlivesyntaxhighlight/bhlivesyntaxhighlight.py
URL: http://svn.apache.org/viewvc/bloodhound/branches/livesyntaxhighlighting/bloodhound_livesyntaxhighlighting/bhlivesyntaxhighlight/bhlivesyntaxhighlight.py?rev=1524433&r1=1524432&r2=1524433&view=diff
==============================================================================
--- bloodhound/branches/livesyntaxhighlighting/bloodhound_livesyntaxhighlighting/bhlivesyntaxhighlight/bhlivesyntaxhighlight.py (original)
+++ bloodhound/branches/livesyntaxhighlighting/bloodhound_livesyntaxhighlighting/bhlivesyntaxhighlight/bhlivesyntaxhighlight.py Wed Sep 18 14:46:18 2013
@@ -25,8 +25,11 @@ class LiveSyntaxHighlightingPlugin(Compo
         flag = False
         if re.match(r'.*?(/wiki/)', req.path_info) or re.match(r'/wiki/', 
             req.path_info):
-            if req.args['action'] == "edit":
-                flag = True
+            try:
+                if req.args['action'] == "edit":
+                    flag = True
+            except KeyError:
+                flag = False
         
         if flag:
 

Modified: bloodhound/branches/livesyntaxhighlighting/bloodhound_livesyntaxhighlighting/bhlivesyntaxhighlight/htdocs/css/codemirror.css
URL: http://svn.apache.org/viewvc/bloodhound/branches/livesyntaxhighlighting/bloodhound_livesyntaxhighlighting/bhlivesyntaxhighlight/htdocs/css/codemirror.css?rev=1524433&r1=1524432&r2=1524433&view=diff
==============================================================================
--- bloodhound/branches/livesyntaxhighlighting/bloodhound_livesyntaxhighlighting/bhlivesyntaxhighlight/htdocs/css/codemirror.css (original)
+++ bloodhound/branches/livesyntaxhighlighting/bloodhound_livesyntaxhighlighting/bhlivesyntaxhighlight/htdocs/css/codemirror.css Wed Sep 18 14:46:18 2013
@@ -1,3 +1,25 @@
+/*
+* Copyright (C) 2013 by Marijn Haverbeke <ma...@gmail.com> and others
+* 
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the "Software"), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+* 
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+* 
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+* THE SOFTWARE.
+*/
+
 /* BASICS */
 
 .CodeMirror {

Modified: bloodhound/branches/livesyntaxhighlighting/bloodhound_livesyntaxhighlighting/bhlivesyntaxhighlight/htdocs/js/codemirror.js
URL: http://svn.apache.org/viewvc/bloodhound/branches/livesyntaxhighlighting/bloodhound_livesyntaxhighlighting/bhlivesyntaxhighlight/htdocs/js/codemirror.js?rev=1524433&r1=1524432&r2=1524433&view=diff
==============================================================================
--- bloodhound/branches/livesyntaxhighlighting/bloodhound_livesyntaxhighlighting/bhlivesyntaxhighlight/htdocs/js/codemirror.js (original)
+++ bloodhound/branches/livesyntaxhighlighting/bloodhound_livesyntaxhighlighting/bhlivesyntaxhighlight/htdocs/js/codemirror.js Wed Sep 18 14:46:18 2013
@@ -1,3 +1,25 @@
+/*
+* Copyright (C) 2013 by Marijn Haverbeke <ma...@gmail.com> and others
+* 
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the "Software"), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+* 
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+* 
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+* THE SOFTWARE.
+*/
+
 // CodeMirror is the only global var we claim
 window.CodeMirror = (function() {
   "use strict";

Modified: bloodhound/branches/livesyntaxhighlighting/bloodhound_livesyntaxhighlighting/bhlivesyntaxhighlight/htdocs/js/livesyntaxhighlight.js
URL: http://svn.apache.org/viewvc/bloodhound/branches/livesyntaxhighlighting/bloodhound_livesyntaxhighlighting/bhlivesyntaxhighlight/htdocs/js/livesyntaxhighlight.js?rev=1524433&r1=1524432&r2=1524433&view=diff
==============================================================================
--- bloodhound/branches/livesyntaxhighlighting/bloodhound_livesyntaxhighlighting/bhlivesyntaxhighlight/htdocs/js/livesyntaxhighlight.js (original)
+++ bloodhound/branches/livesyntaxhighlighting/bloodhound_livesyntaxhighlighting/bhlivesyntaxhighlight/htdocs/js/livesyntaxhighlight.js Wed Sep 18 14:46:18 2013
@@ -7,39 +7,40 @@ livesyntaxhighlight = {
   editor : null,
   //Initializing function
   init : function () {
-    twidth = $('#text').width();
-    theight = $('#text').height();
-    editor = CodeMirror.fromTextArea(document.getElementById("text"), {
+    livesyntaxhighlight.twidth = $('#text').width();
+    livesyntaxhighlight.theight = $('#text').height();
+    livesyntaxhighlight.editor = CodeMirror.fromTextArea(document.getElementById("text"), {
         lineNumbers: true,
         matchBrackets: true,
+        lineWrapping: true,
         continueComments: "Enter",
         extraKeys: {"Ctrl-Q": "toggleComment"}
       });
     console.log($('#text').width() + ' '+ $('#text').height());
     livesyntaxhighlight.resizeCodeMirror();
-    editor.refresh();
+    livesyntaxhighlight.editor.refresh();
     $(window).resize(livesyntaxhighlight.resizeCodeMirror);
   },
   resizeCodeMirror : function (){
     console.log($('#text').width() + ' '+ $('#text').height());
     var spanwidth = $('.span12').width()/2 - 15;
-    cmwidth = window.twidth;
+    cmwidth = livesyntaxhighlight.twidth;
     if ($('.span12').width() > 688 && document.getElementById('sidebyside').checked)
       cmwidth = spanwidth;
     else cmwidth = 2 * (spanwidth +15);
     cmheight = $('#text').height();
     // if(document.getElementById('preview'))
     //   cmheight = $('#preview').height();
-    editor.setSize(cmwidth, cmheight);
-    editor.refresh();
+    livesyntaxhighlight.editor.setSize(cmwidth, cmheight);
+    livesyntaxhighlight.editor.refresh();
   }
 };
 // Invoked initially to initialize the editor
 $(document).ready(function (){
   livesyntaxhighlight.init();
+  // To adjust the height of the editor
+  $("#editrows").change(function(){
+    var twidth = livesyntaxhighlight.cmwidth;
+    livesyntaxhighlight.editor.setSize(twidth, this.options[this.selectedIndex].value*13);
+  });
 });
-// To adjust the height of the editor
-$("#editrows").change(function(){
-  var twidth = livesyntaxhighlight.cmwidth;
-  editor.setSize(twidth, this.options[this.selectedIndex].value*13);
-});
\ No newline at end of file