Commits

Takafumi Arakaki  committed 168348a

Added jquery.heatcolor to make dictdiff better

  • Participants
  • Parent commits 9064690

Comments (0)

Files changed (4)

File neorg/static/neorg.coffee

     for i of arrowKeyArray
       unBindKeydown arrowKeyArray[i]
 
+
+neorgDictDiffInit = ->
+  $("table.neorg-dictdiff").each ->
+    ncolsList = ($(e).find("td").length for e in $(this).find("tr"))
+    ncols = Math.max ncolsList...
+
+    for column in [1..ncols]
+      console.log column
+      console.log $(this).find("tr > td:nth-child(" + column + ")")[1..]
+        .heatcolor -> $(this).text()
+
+
 neorgEdit = ->
   $.ajax
     url: "_edit_form"
 neorgInit = ->
   $(".neorg-gene-image-link").colorbox neorgCBSetting
 
+  neorgDictDiffInit()
+
   $("a.page-action-edit").click neorgEdit
   $("#edit-form-textarea").focus()
 

File neorg/templates/layout.html

     <script src="{{ url_for('static', filename='jslib/jquery-1.6.4.min.js') }}"></script>
     <script src="{{ url_for('static', filename='jslib/jquery.colorbox-min.js') }}"></script>
     <script src="{{ url_for('static', filename='jslib/jquery.hotkeys.js') }}"></script>
+    <script src="{{ url_for('static', filename='jslib/jquery.heatcolor.0.0.1.pack.js') }}"></script>
     <script src="{{ url_for('static', filename='neorg.js') }}"></script>
   </head>
   <body{% if temp_path %} class="gene"{% endif %}>

File neorg/wiki.py

                 node.get('base'),
                 node.get('file'),
                 'Diff of data found in: %s',
-                ))
+                ),
+            classes=['neorg-dictdiff'])
         node.replace_self(table_node)
 
 
             tmpdir, 'colorbox', 'example5', 'images')
         cbimglibpath = os.path.join(colorboxdir, 'images')
         hktmpglobptn = os.path.join(tmpdir, 'tzuryby-jquery.hotkeys*/')
+        hctmppath = os.path.join(tmpdir, 'jquery.heatcolor.0.0.1.pack.js')
 
         if os.path.exists(jsdir):
             shutil.rmtree(jsdir)
         hktmpdir = glob(hktmpglobptn)[0]
         copy_file(os.path.join(hktmpdir, 'jquery.hotkeys.js'), jsdir)
 
+        self._saveurl(
+            'http://www.jnathanson.com/blog/client/jquery/heatcolor/'
+            'jquery.heatcolor.0.0.1.pack.js',
+            hctmppath)
+        copy_file(hctmppath, jsdir)
+
 
 cmdclass = {
     'build': my_build,