Просмотр исходного кода

updated de/inflate to versions 0.5/0.3, using versions found at
https://github.com/dankogai/js-deflate/commit/a3725d3beead1137ae010bb36e50e56f3b50c867
kudos Dan Kogai

El RIDO 11 лет назад
Родитель
Сommit
0c1d5c62d5
3 измененных файлов с 20 добавлено и 14 удалено
  1. 10 6
      js/rawdeflate-0.5.js
  2. 8 6
      js/rawinflate-0.3.js
  3. 2 2
      tpl/page.html

+ 10 - 6
js/rawdeflate.js → js/rawdeflate-0.5.js

@@ -1,11 +1,13 @@
 /*
- * $Id: rawdeflate.js,v 0.3 2009/03/01 19:05:05 dankogai Exp dankogai $
+ * $Id: rawdeflate.js,v 0.5 2013/04/09 14:25:38 dankogai Exp dankogai $
  *
+ * GNU General Public License, version 2 (GPL-2.0)
+ *   http://opensource.org/licenses/GPL-2.0
  * Original:
- *   http://www.onicos.com/staff/iz/amuse/javascript/expert/deflate.txt
+ *  http://www.onicos.com/staff/iz/amuse/javascript/expert/deflate.txt
  */
 
-(function(){
+(function(ctx){
 
 /* Copyright (C) 1999 Masanao Izumo <iz@onicos.co.jp>
  * Version: 1.0.1
@@ -753,6 +755,7 @@ var zip_init_deflate = function() {
     zip_qhead = null;
     zip_outcnt = 0;
     zip_outoff = 0;
+    zip_match_available = 0;
 
     if(zip_compr_level <= 3)
     {
@@ -763,6 +766,7 @@ var zip_init_deflate = function() {
     {
 	zip_match_length = zip_MIN_MATCH - 1;
 	zip_match_available = 0;
+        zip_match_available = 0;
     }
 
     zip_complete = false;
@@ -1665,7 +1669,7 @@ var zip_deflate = function(str, level) {
     return aout.join("");
 }
 
-if (! window.RawDeflate) RawDeflate = {};
-RawDeflate.deflate = zip_deflate;
+if (! ctx.RawDeflate) ctx.RawDeflate = {};
+ctx.RawDeflate.deflate = zip_deflate;
 
-})();
+})(this);

+ 8 - 6
js/rawinflate.js → js/rawinflate-0.3.js

@@ -1,11 +1,13 @@
 /*
- * $Id: rawinflate.js,v 0.2 2009/03/01 18:32:24 dankogai Exp $
+ * $Id: rawinflate.js,v 0.3 2013/04/09 14:25:38 dankogai Exp dankogai $
  *
+ * GNU General Public License, version 2 (GPL-2.0)
+ *   http://opensource.org/licenses/GPL-2.0
  * original:
- * http://www.onicos.com/staff/iz/amuse/javascript/expert/inflate.txt
+ *   http://www.onicos.com/staff/iz/amuse/javascript/expert/inflate.txt
  */
 
-(function(){
+(function(ctx){
 
 /* Copyright (C) 1999 Masanao Izumo <iz@onicos.co.jp>
  * Version: 1.0.0.1
@@ -747,7 +749,7 @@ var zip_inflate = function(str) {
     return aout.join("");
 }
 
-if (! window.RawDeflate) RawDeflate = {};
-RawDeflate.inflate = zip_inflate;
+if (! ctx.RawDeflate) ctx.RawDeflate = {};
+ctx.RawDeflate.inflate = zip_inflate;
 
-})();
+})(this);

+ 2 - 2
tpl/page.html

@@ -9,8 +9,8 @@
 		<script type="text/javascript" src="js/jquery-1.11.3.js"></script>
 		<script type="text/javascript" src="js/sjcl-1.0.2.js"></script>
 		<script type="text/javascript" src="js/base64-{$BASE64JSVERSION}.js"></script>
-		<script type="text/javascript" src="js/rawdeflate.js?{$VERSION|rawurlencode}"></script>
-		<script type="text/javascript" src="js/rawinflate.js?{$VERSION|rawurlencode}"></script>{if="$SYNTAXHIGHLIGHTING"}
+		<script type="text/javascript" src="js/rawdeflate-0.5.js"></script>
+		<script type="text/javascript" src="js/rawinflate-0.3.js"></script>{if="$SYNTAXHIGHLIGHTING"}
 		<script type="text/javascript" src="js/prettify.js?{$VERSION|rawurlencode}"></script>{/if}
 		<script type="text/javascript" src="js/zerobin.js?{$VERSION|rawurlencode}"></script>
 		<!--[if lt IE 10]>