Browse Source

Merge git+ssh://repo.or.cz/srv/git/Worg

Wes Hardaker 10 years ago
parent
commit
4c8ced8904

+ 31 - 3
code/org-info-js/Makefile

@@ -1,6 +1,34 @@
-YUI= ~/bin/yuicompressor-2.4.2.jar
+YUI=~/bin/yuicompressor-2.4.2.jar
 
 MINIFY_OTPIONS=	 --preserve-semi --line-break 80
 
-all: org-info-src.js
-	java -jar $(YUI) $(MINIFY_OTPIONS) org-info-src.js > org-info.js
+VERSION = `grep -e '\* Version: *[0-9.]' org-info-src.js | cut -sd ':' -f 2-`
+TMPv = tmp-version.js
+TMPs = tmp-min.js
+
+all: minify
+
+
+minify: version sed.txt
+	@if [ -f $(TMPv) ] &&  [ -f $(TMPs) ]; then \
+	  sed -f sed.txt $(TMPv) > $(TMPs); \
+	  java -jar $(YUI) $(MINIFY_OTPIONS) $(TMPs) > org-info.js; \
+	  rm $(TMPv); \
+	  rm $(TMPs); \
+	  echo "org-info.js successfully built."; \
+	else \
+	  echo "Failed to build. $(TMPv) and/or $(TMPs) are missing!"; \
+	fi
+
+version:
+	@if [ -f $(TMPv) ] ||  [ -f $(TMPs) ]; then \
+	  echo "$(TMPv) and/or $(TMPs) exist. Please remove them or adjust the Makefile!"; \
+	else \
+	  sed -e "s/###VERSION###/$(VERSION)/g" org-info-src.js > $(TMPv); \
+	  touch $(TMPs); \
+	fi
+
+clean:
+	@rm -f $(TMPv) $(TMPs)
+	@echo "Temporary files removed."
+

+ 16 - 0
code/org-info-js/changes.org

@@ -9,6 +9,22 @@
 #+INFOJS_OPT: home:http://orgmode.org buttons:nil
 
 
+* 2009-06-28
+
+  Show the version number below the shortcut table.
+
+* 2009-06-27
+
+  Bugfix for links nested in lists.
+  Thanks to Xin Shi for finding this and sending a testfile.
+
+* 2009-06-25
+
+  * Fix for start section.
+    I a section was removed and the *.org file was published again, we saw an
+    empty page when browsing to that old location (e.g. =xy.html#sec-11=). Now the
+    first section is shown instead.
+
 * 2009-06-22
 
   * *NOTE: now GPL 3*

+ 16 - 15
code/org-info-js/org-info-src.js

@@ -1,6 +1,8 @@
 /**
  * @file
- *       org-info.js, v.0.1.1.7
+ * org-info.js
+ *
+ * Version: 0.1.1.8
  *
  * @author Sebastian Rose, Hannover, Germany - sebastian_rose at gmx dot de
  *
@@ -510,11 +512,10 @@ var org_html_manager = {
     var start_section = 0;
 
     if("" != location.hash) {
-      start_section = location.hash;
       t.BASE_URL = t.BASE_URL.substring(0, t.BASE_URL.indexOf('#'));
       // Search for the start section:
       for(var i=0;i<t.SECS.length;++i) {
-        if(t.SECS[i].isTargetFor[start_section]) {
+        if(t.SECS[i].isTargetFor[location.hash]) {
           start_section = i;
           break;
         }
@@ -976,17 +977,16 @@ var org_html_manager = {
     var i = (this.HIDE_TOC ? 0 : 1);
     var j;
     var foot_sec = this.SECS.length - 1;
-    for(i; i < this.SECS.length; ++i) {
-      var links = this.SECS[i].DIV.getElementsByTagName("a");
-      for(j=0; j<links.length; ++j) {
-        var href = links[j].href.replace(this.BASE_URL, '');
-            // could use quicksort like search here:
-            for(var k = 0; k < this.SECS.length; ++k) {
-              if(this.SECS[k].isTargetFor[href]) {
-                links[j].href="javascript:org_html_manager.navigateTo("+k+")";
-                break;
-              }}}}
-  },
+    // for(i; i < this.SECS.length; ++i) {
+    var links = document.getElementsByTagName("a"); // must be document!
+    for(j=0; j<links.length; ++j) {
+      var href = links[j].href.replace(this.BASE_URL, '');
+      // could use quicksort like search here:
+      for(var k = 0; k < this.SECS.length; ++k) {
+        if(this.SECS[k].isTargetFor[href]) {
+          links[j].href="javascript:org_html_manager.navigateTo("+k+")";
+          break;
+        }}}},
 
 
 
@@ -2026,7 +2026,8 @@ var org_html_manager = {
       if(t.PLAIN_VIEW == t.VIEW) t.infoView(true);
       t.WINDOW.innerHTML = 'Press any key or <a href="javascript:org_html_manager.showHelp();">click here</a> to proceed.'
         +'<h2>Keyboard Shortcuts</h2>'
-        +'<table cellpadding="3" rules="groups" frame="hsides" style="margin:20px;border-style:none;" border="0";>'
+        +'<table cellpadding="3" rules="groups" frame="hsides" style="caption-side:bottom;margin:20px;border-style:none;" border="0";>'
+        +'<caption><small>org-info.js, v.###VERSION###</small></caption>'
     +'<tbody>'
       // BEGIN RECEIVE ORGTBL Shortcuts
 	+'<tr><td><code><b>? / &iquest;</b></code></td><td>show this help screen</td></tr>'

File diff suppressed because it is too large
+ 6 - 6
code/org-info-js/org-info.js


+ 1 - 1
worg-about.org

@@ -1,7 +1,7 @@
 #+STARTUP:    align fold nodlcheck hidestars oddeven lognotestate
 #+SEQ_TODO:   TODO(t) INPROGRESS(i) WAITING(w@) | DONE(d) CANCELED(c@)
 #+TAGS:       Write(w) Update(u) Fix(f) Check(c) 
-#+TITLE:      I said: « Hello Worg! »
+#+TITLE:      I said: "Hello Worg!"
 #+AUTHOR:     Worg people
 #+EMAIL:      bzg AT altern DOT org
 #+LANGUAGE:   en