You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by da...@apache.org on 2017/05/31 20:59:22 UTC
[11/52] [abbrv] incubator-trafficcontrol git commit: remove unused
third-party files
remove unused third-party files
(cherry picked from commit fa1d8eec50377f66a1f0847f2b10eb91c0940e8b)
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/03af4a28
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/03af4a28
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/03af4a28
Branch: refs/heads/1.8.x
Commit: 03af4a2837e84af319d6970168e520d7a48f8fe2
Parents: a7c882e
Author: Dan Kirkwood <da...@gmail.com>
Authored: Mon Jan 23 12:51:09 2017 -0700
Committer: Dan Kirkwood <da...@gmail.com>
Committed: Tue Jan 24 11:42:27 2017 -0700
----------------------------------------------------------------------
.../_themes/sphinx_rtd_theme/layout_old.html | 205 ------
.../src/main/webapp/css/jMenu.jquery.css | 102 ---
traffic_ops/app/public/js/lz-string-1.3.3.js | 684 -------------------
3 files changed, 991 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/03af4a28/docs/source/_themes/sphinx_rtd_theme/layout_old.html
----------------------------------------------------------------------
diff --git a/docs/source/_themes/sphinx_rtd_theme/layout_old.html b/docs/source/_themes/sphinx_rtd_theme/layout_old.html
deleted file mode 100644
index deb8df2..0000000
--- a/docs/source/_themes/sphinx_rtd_theme/layout_old.html
+++ /dev/null
@@ -1,205 +0,0 @@
-{#
- basic/layout.html
- ~~~~~~~~~~~~~~~~~
-
- Master layout template for Sphinx themes.
-
- :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-#}
-{%- block doctype -%}
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-{%- endblock %}
-{%- set reldelim1 = reldelim1 is not defined and ' »' or reldelim1 %}
-{%- set reldelim2 = reldelim2 is not defined and ' |' or reldelim2 %}
-{%- set render_sidebar = (not embedded) and (not theme_nosidebar|tobool) and
- (sidebars != []) %}
-{%- set url_root = pathto('', 1) %}
-{# XXX necessary? #}
-{%- if url_root == '#' %}{% set url_root = '' %}{% endif %}
-{%- if not embedded and docstitle %}
- {%- set titlesuffix = " — "|safe + docstitle|e %}
-{%- else %}
- {%- set titlesuffix = "" %}
-{%- endif %}
-
-{%- macro relbar() %}
- <div class="related">
- <h3>{{ _('Navigation') }}</h3>
- <ul>
- {%- for rellink in rellinks %}
- <li class="right" {% if loop.first %}style="margin-right: 10px"{% endif %}>
- <a href="{{ pathto(rellink[0]) }}" title="{{ rellink[1]|striptags|e }}"
- {{ accesskey(rellink[2]) }}>{{ rellink[3] }}</a>
- {%- if not loop.first %}{{ reldelim2 }}{% endif %}</li>
- {%- endfor %}
- {%- block rootrellink %}
- <li><a href="{{ pathto(master_doc) }}">{{ shorttitle|e }}</a>{{ reldelim1 }}</li>
- {%- endblock %}
- {%- for parent in parents %}
- <li><a href="{{ parent.link|e }}" {% if loop.last %}{{ accesskey("U") }}{% endif %}>{{ parent.title }}</a>{{ reldelim1 }}</li>
- {%- endfor %}
- {%- block relbaritems %} {% endblock %}
- </ul>
- </div>
-{%- endmacro %}
-
-{%- macro sidebar() %}
- {%- if render_sidebar %}
- <div class="sphinxsidebar">
- <div class="sphinxsidebarwrapper">
- {%- block sidebarlogo %}
- {%- if logo %}
- <p class="logo"><a href="{{ pathto(master_doc) }}">
- <img class="logo" src="{{ pathto('_static/' + logo, 1) }}" alt="Logo"/>
- </a></p>
- {%- endif %}
- {%- endblock %}
- {%- if sidebars != None %}
- {#- new style sidebar: explicitly include/exclude templates #}
- {%- for sidebartemplate in sidebars %}
- {%- include sidebartemplate %}
- {%- endfor %}
- {%- else %}
- {#- old style sidebars: using blocks -- should be deprecated #}
- {%- block sidebartoc %}
- {%- include "localtoc.html" %}
- {%- endblock %}
- {%- block sidebarrel %}
- {%- include "relations.html" %}
- {%- endblock %}
- {%- block sidebarsourcelink %}
- {%- include "sourcelink.html" %}
- {%- endblock %}
- {%- if customsidebar %}
- {%- include customsidebar %}
- {%- endif %}
- {%- block sidebarsearch %}
- {%- include "searchbox.html" %}
- {%- endblock %}
- {%- endif %}
- </div>
- </div>
- {%- endif %}
-{%- endmacro %}
-
-{%- macro script() %}
- <script type="text/javascript">
- var DOCUMENTATION_OPTIONS = {
- URL_ROOT: '{{ url_root }}',
- VERSION: '{{ release|e }}',
- COLLAPSE_INDEX: false,
- FILE_SUFFIX: '{{ '' if no_search_suffix else file_suffix }}',
- HAS_SOURCE: {{ has_source|lower }}
- };
- </script>
- {%- for scriptfile in script_files %}
- <script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script>
- {%- endfor %}
-{%- endmacro %}
-
-{%- macro css() %}
- <link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css" />
- <link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1) }}" type="text/css" />
- {%- for cssfile in css_files %}
- <link rel="stylesheet" href="{{ pathto(cssfile, 1) }}" type="text/css" />
- {%- endfor %}
-{%- endmacro %}
-
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset={{ encoding }}" />
- {{ metatags }}
- {%- block htmltitle %}
- <title>{{ title|striptags|e }}{{ titlesuffix }}</title>
- {%- endblock %}
- {{ css() }}
- {%- if not embedded %}
- {{ script() }}
- {%- if use_opensearch %}
- <link rel="search" type="application/opensearchdescription+xml"
- title="{% trans docstitle=docstitle|e %}Search within {{ docstitle }}{% endtrans %}"
- href="{{ pathto('_static/opensearch.xml', 1) }}"/>
- {%- endif %}
- {%- if favicon %}
- <link rel="shortcut icon" href="{{ pathto('_static/' + favicon, 1) }}"/>
- {%- endif %}
- {%- endif %}
-{%- block linktags %}
- {%- if hasdoc('about') %}
- <link rel="author" title="{{ _('About these documents') }}" href="{{ pathto('about') }}" />
- {%- endif %}
- {%- if hasdoc('genindex') %}
- <link rel="index" title="{{ _('Index') }}" href="{{ pathto('genindex') }}" />
- {%- endif %}
- {%- if hasdoc('search') %}
- <link rel="search" title="{{ _('Search') }}" href="{{ pathto('search') }}" />
- {%- endif %}
- {%- if hasdoc('copyright') %}
- <link rel="copyright" title="{{ _('Copyright') }}" href="{{ pathto('copyright') }}" />
- {%- endif %}
- <link rel="top" title="{{ docstitle|e }}" href="{{ pathto('index') }}" />
- {%- if parents %}
- <link rel="up" title="{{ parents[-1].title|striptags|e }}" href="{{ parents[-1].link|e }}" />
- {%- endif %}
- {%- if next %}
- <link rel="next" title="{{ next.title|striptags|e }}" href="{{ next.link|e }}" />
- {%- endif %}
- {%- if prev %}
- <link rel="prev" title="{{ prev.title|striptags|e }}" href="{{ prev.link|e }}" />
- {%- endif %}
-{%- endblock %}
-{%- block extrahead %} {% endblock %}
- </head>
- <body>
-{%- block header %}{% endblock %}
-
-{%- block relbar1 %}{{ relbar() }}{% endblock %}
-
-{%- block content %}
- {%- block sidebar1 %} {# possible location for sidebar #} {% endblock %}
-
- <div class="document">
- {%- block document %}
- <div class="documentwrapper">
- {%- if render_sidebar %}
- <div class="bodywrapper">
- {%- endif %}
- <div class="body">
- {% block body %} {% endblock %}
- </div>
- {%- if render_sidebar %}
- </div>
- {%- endif %}
- </div>
- {%- endblock %}
-
- {%- block sidebar2 %}{{ sidebar() }}{% endblock %}
- <div class="clearer"></div>
- </div>
-{%- endblock %}
-
-{%- block relbar2 %}{{ relbar() }}{% endblock %}
-
-{%- block footer %}
- <div class="footer">
- {%- if show_copyright %}
- {%- if hasdoc('copyright') %}
- {% trans path=pathto('copyright'), copyright=copyright|e %}© <a href="{{ path }}">Copyright</a> {{ copyright }}.{% endtrans %}
- {%- else %}
- {% trans copyright=copyright|e %}© Copyright {{ copyright }}.{% endtrans %}
- {%- endif %}
- {%- endif %}
- {%- if last_updated %}
- {% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}
- {%- endif %}
- {%- if show_sphinx %}
- {% trans sphinx_version=sphinx_version|e %}Created using <a href="http://sphinx-doc.org/">Sphinx</a> {{ sphinx_version }}.{% endtrans %}
- {%- endif %}
- </div>
- <p>asdf asdf asdf asdf 22</p>
-{%- endblock %}
- </body>
-</html>
-
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/03af4a28/traffic_monitor/src/main/webapp/css/jMenu.jquery.css
----------------------------------------------------------------------
diff --git a/traffic_monitor/src/main/webapp/css/jMenu.jquery.css b/traffic_monitor/src/main/webapp/css/jMenu.jquery.css
deleted file mode 100644
index 22da851..0000000
--- a/traffic_monitor/src/main/webapp/css/jMenu.jquery.css
+++ /dev/null
@@ -1,102 +0,0 @@
-.jMenu {
- display: block;
- text-align: left;
- padding: 0px;
-}
-
-/* First level */
-.jMenu li {
- display: inline-block;
- /*background-color: #322f32;*/
- background-color: #000000;
- margin: 0px;
- border-color: #322f32;
- border-style:solid;
- border-width:1px;
- border-top-left-radius: 1px;
- border-bottom-left-radius: 1px;
- border-top-right-radius: 1px;
- border-bottom-right-radius: 1px;
- width: 120px;
-}
-
-.jMenu li a {
- padding: 10px;
- display: block;
- background-color: transparent;
- color: white;
- cursor: pointer;
- text-decoration:none;
- border-top-left-radius: 1px;
- border-bottom-left-radius: 1px;
- border-top-right-radius: 1px;
- border-bottom-right-radius: 1px;
- width: 100px;
- text-align: center;
-}
-
-/* Lower levels */
-.jMenu li ul {
- display: none;
- position: absolute;
- z-index:9999;
- padding: 0;
- margin: 0;
-}
-
-.jMenu li ul li {
- /*background-color: #322f32;*/
- background-color: #000000;
- display: block;
- /*border-bottom: 1px solid #484548;*/
- padding: 0;
- border-color: #322f32;
- border-style:solid;
- border-width:1px;
-}
-
-.jMenu li ul li.arrow {
- /*background-color: #322f32;*/
- border-color: #322f32;
- border-style:solid;
- border-width:1px;
- background-image: url('../images/arrow_down.png');
- background-repeat: no-repeat;
- background-position: center center;
- height: 6px;
- padding: 0;
- border-bottom: none;
- padding-bottom: 10px
-}
-
-.jMenu li ul li.normal {
- font-size: 11px;
- text-transform: none;
- color: white;
- border-top: 1px solid transparent;
- border-bottom: 1px solid transparent;
-}
-
-.jMenu li ul li a {
- font-size: 11px;
- text-transform: none;
- display: block;
- border-top: 1px solid transparent;
- border-bottom: 1px solid transparent;
-}
-
-.jMenu li ul li a.isParent {
- background-color: #000000;
- /*background-color: #3a3a3a;*/
- background-image: url('../images/arrow_right.png');
- background-repeat: no-repeat;
- background-position: right center;
-}
-
-.jMenu li ul li a:hover {
- background-color: #322f32;
- /*background-color: #514c52;*/
- border-top: 1px solid #322f32;
- border-bottom: 1px solid #322f32;
-}
-
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/03af4a28/traffic_ops/app/public/js/lz-string-1.3.3.js
----------------------------------------------------------------------
diff --git a/traffic_ops/app/public/js/lz-string-1.3.3.js b/traffic_ops/app/public/js/lz-string-1.3.3.js
deleted file mode 100644
index 827f928..0000000
--- a/traffic_ops/app/public/js/lz-string-1.3.3.js
+++ /dev/null
@@ -1,684 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-// Copyright (c) 2013 Pieroxy <pi...@pieroxy.net>
-// This work is free. You can redistribute it and/or modify it
-// under the terms of the WTFPL, Version 2
-// For more information see LICENSE.txt or http://www.wtfpl.net/
-//
-// For more information, the home page:
-// http://pieroxy.net/blog/pages/lz-string/testing.html
-//
-// LZ-based compression algorithm, version 1.3.3
-var LZString = {
-
-
- // private property
- _keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
- _f : String.fromCharCode,
-
- compressToBase64 : function (input) {
- if (input == null) return "";
- var output = "";
- var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
- var i = 0;
-
- input = LZString.compress(input);
-
- while (i < input.length*2) {
-
- if (i%2==0) {
- chr1 = input.charCodeAt(i/2) >> 8;
- chr2 = input.charCodeAt(i/2) & 255;
- if (i/2+1 < input.length)
- chr3 = input.charCodeAt(i/2+1) >> 8;
- else
- chr3 = NaN;
- } else {
- chr1 = input.charCodeAt((i-1)/2) & 255;
- if ((i+1)/2 < input.length) {
- chr2 = input.charCodeAt((i+1)/2) >> 8;
- chr3 = input.charCodeAt((i+1)/2) & 255;
- } else
- chr2=chr3=NaN;
- }
- i+=3;
-
- enc1 = chr1 >> 2;
- enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
- enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
- enc4 = chr3 & 63;
-
- if (isNaN(chr2)) {
- enc3 = enc4 = 64;
- } else if (isNaN(chr3)) {
- enc4 = 64;
- }
-
- output = output +
- LZString._keyStr.charAt(enc1) + LZString._keyStr.charAt(enc2) +
- LZString._keyStr.charAt(enc3) + LZString._keyStr.charAt(enc4);
-
- }
-
- return output;
- },
-
- decompressFromBase64 : function (input) {
- if (input == null) return "";
- var output = "",
- ol = 0,
- output_,
- chr1, chr2, chr3,
- enc1, enc2, enc3, enc4,
- i = 0, f=LZString._f;
-
- input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
-
- while (i < input.length) {
-
- enc1 = LZString._keyStr.indexOf(input.charAt(i++));
- enc2 = LZString._keyStr.indexOf(input.charAt(i++));
- enc3 = LZString._keyStr.indexOf(input.charAt(i++));
- enc4 = LZString._keyStr.indexOf(input.charAt(i++));
-
- chr1 = (enc1 << 2) | (enc2 >> 4);
- chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
- chr3 = ((enc3 & 3) << 6) | enc4;
-
- if (ol%2==0) {
- output_ = chr1 << 8;
-
- if (enc3 != 64) {
- output += f(output_ | chr2);
- }
- if (enc4 != 64) {
- output_ = chr3 << 8;
- }
- } else {
- output = output + f(output_ | chr1);
-
- if (enc3 != 64) {
- output_ = chr2 << 8;
- }
- if (enc4 != 64) {
- output += f(output_ | chr3);
- }
- }
- ol+=3;
- }
-
- return LZString.decompress(output);
-
- },
-
- compressToUTF16 : function (input) {
- if (input == null) return "";
- var output = "",
- i,c,
- current,
- status = 0,
- f = LZString._f;
-
- input = LZString.compress(input);
-
- for (i=0 ; i<input.length ; i++) {
- c = input.charCodeAt(i);
- switch (status++) {
- case 0:
- output += f((c >> 1)+32);
- current = (c & 1) << 14;
- break;
- case 1:
- output += f((current + (c >> 2))+32);
- current = (c & 3) << 13;
- break;
- case 2:
- output += f((current + (c >> 3))+32);
- current = (c & 7) << 12;
- break;
- case 3:
- output += f((current + (c >> 4))+32);
- current = (c & 15) << 11;
- break;
- case 4:
- output += f((current + (c >> 5))+32);
- current = (c & 31) << 10;
- break;
- case 5:
- output += f((current + (c >> 6))+32);
- current = (c & 63) << 9;
- break;
- case 6:
- output += f((current + (c >> 7))+32);
- current = (c & 127) << 8;
- break;
- case 7:
- output += f((current + (c >> 8))+32);
- current = (c & 255) << 7;
- break;
- case 8:
- output += f((current + (c >> 9))+32);
- current = (c & 511) << 6;
- break;
- case 9:
- output += f((current + (c >> 10))+32);
- current = (c & 1023) << 5;
- break;
- case 10:
- output += f((current + (c >> 11))+32);
- current = (c & 2047) << 4;
- break;
- case 11:
- output += f((current + (c >> 12))+32);
- current = (c & 4095) << 3;
- break;
- case 12:
- output += f((current + (c >> 13))+32);
- current = (c & 8191) << 2;
- break;
- case 13:
- output += f((current + (c >> 14))+32);
- current = (c & 16383) << 1;
- break;
- case 14:
- output += f((current + (c >> 15))+32, (c & 32767)+32);
- status = 0;
- break;
- }
- }
-
- return output + f(current + 32);
- },
-
-
- decompressFromUTF16 : function (input) {
- if (input == null) return "";
- var output = "",
- current,c,
- status=0,
- i = 0,
- f = LZString._f;
-
- while (i < input.length) {
- c = input.charCodeAt(i) - 32;
-
- switch (status++) {
- case 0:
- current = c << 1;
- break;
- case 1:
- output += f(current | (c >> 14));
- current = (c&16383) << 2;
- break;
- case 2:
- output += f(current | (c >> 13));
- current = (c&8191) << 3;
- break;
- case 3:
- output += f(current | (c >> 12));
- current = (c&4095) << 4;
- break;
- case 4:
- output += f(current | (c >> 11));
- current = (c&2047) << 5;
- break;
- case 5:
- output += f(current | (c >> 10));
- current = (c&1023) << 6;
- break;
- case 6:
- output += f(current | (c >> 9));
- current = (c&511) << 7;
- break;
- case 7:
- output += f(current | (c >> 8));
- current = (c&255) << 8;
- break;
- case 8:
- output += f(current | (c >> 7));
- current = (c&127) << 9;
- break;
- case 9:
- output += f(current | (c >> 6));
- current = (c&63) << 10;
- break;
- case 10:
- output += f(current | (c >> 5));
- current = (c&31) << 11;
- break;
- case 11:
- output += f(current | (c >> 4));
- current = (c&15) << 12;
- break;
- case 12:
- output += f(current | (c >> 3));
- current = (c&7) << 13;
- break;
- case 13:
- output += f(current | (c >> 2));
- current = (c&3) << 14;
- break;
- case 14:
- output += f(current | (c >> 1));
- current = (c&1) << 15;
- break;
- case 15:
- output += f(current | c);
- status=0;
- break;
- }
-
-
- i++;
- }
-
- return LZString.decompress(output);
- //return output;
-
- },
-
-
-
- compress: function (uncompressed) {
- if (uncompressed == null) return "";
- var i, value,
- context_dictionary= {},
- context_dictionaryToCreate= {},
- context_c="",
- context_wc="",
- context_w="",
- context_enlargeIn= 2, // Compensate for the first entry which should not count
- context_dictSize= 3,
- context_numBits= 2,
- context_data_string="",
- context_data_val=0,
- context_data_position=0,
- ii,
- f=LZString._f;
-
- for (ii = 0; ii < uncompressed.length; ii += 1) {
- context_c = uncompressed.charAt(ii);
- if (!Object.prototype.hasOwnProperty.call(context_dictionary,context_c)) {
- context_dictionary[context_c] = context_dictSize++;
- context_dictionaryToCreate[context_c] = true;
- }
-
- context_wc = context_w + context_c;
- if (Object.prototype.hasOwnProperty.call(context_dictionary,context_wc)) {
- context_w = context_wc;
- } else {
- if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate,context_w)) {
- if (context_w.charCodeAt(0)<256) {
- for (i=0 ; i<context_numBits ; i++) {
- context_data_val = (context_data_val << 1);
- if (context_data_position == 15) {
- context_data_position = 0;
- context_data_string += f(context_data_val);
- context_data_val = 0;
- } else {
- context_data_position++;
- }
- }
- value = context_w.charCodeAt(0);
- for (i=0 ; i<8 ; i++) {
- context_data_val = (context_data_val << 1) | (value&1);
- if (context_data_position == 15) {
- context_data_position = 0;
- context_data_string += f(context_data_val);
- context_data_val = 0;
- } else {
- context_data_position++;
- }
- value = value >> 1;
- }
- } else {
- value = 1;
- for (i=0 ; i<context_numBits ; i++) {
- context_data_val = (context_data_val << 1) | value;
- if (context_data_position == 15) {
- context_data_position = 0;
- context_data_string += f(context_data_val);
- context_data_val = 0;
- } else {
- context_data_position++;
- }
- value = 0;
- }
- value = context_w.charCodeAt(0);
- for (i=0 ; i<16 ; i++) {
- context_data_val = (context_data_val << 1) | (value&1);
- if (context_data_position == 15) {
- context_data_position = 0;
- context_data_string += f(context_data_val);
- context_data_val = 0;
- } else {
- context_data_position++;
- }
- value = value >> 1;
- }
- }
- context_enlargeIn--;
- if (context_enlargeIn == 0) {
- context_enlargeIn = Math.pow(2, context_numBits);
- context_numBits++;
- }
- delete context_dictionaryToCreate[context_w];
- } else {
- value = context_dictionary[context_w];
- for (i=0 ; i<context_numBits ; i++) {
- context_data_val = (context_data_val << 1) | (value&1);
- if (context_data_position == 15) {
- context_data_position = 0;
- context_data_string += f(context_data_val);
- context_data_val = 0;
- } else {
- context_data_position++;
- }
- value = value >> 1;
- }
-
-
- }
- context_enlargeIn--;
- if (context_enlargeIn == 0) {
- context_enlargeIn = Math.pow(2, context_numBits);
- context_numBits++;
- }
- // Add wc to the dictionary.
- context_dictionary[context_wc] = context_dictSize++;
- context_w = String(context_c);
- }
- }
-
- // Output the code for w.
- if (context_w !== "") {
- if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate,context_w)) {
- if (context_w.charCodeAt(0)<256) {
- for (i=0 ; i<context_numBits ; i++) {
- context_data_val = (context_data_val << 1);
- if (context_data_position == 15) {
- context_data_position = 0;
- context_data_string += f(context_data_val);
- context_data_val = 0;
- } else {
- context_data_position++;
- }
- }
- value = context_w.charCodeAt(0);
- for (i=0 ; i<8 ; i++) {
- context_data_val = (context_data_val << 1) | (value&1);
- if (context_data_position == 15) {
- context_data_position = 0;
- context_data_string += f(context_data_val);
- context_data_val = 0;
- } else {
- context_data_position++;
- }
- value = value >> 1;
- }
- } else {
- value = 1;
- for (i=0 ; i<context_numBits ; i++) {
- context_data_val = (context_data_val << 1) | value;
- if (context_data_position == 15) {
- context_data_position = 0;
- context_data_string += f(context_data_val);
- context_data_val = 0;
- } else {
- context_data_position++;
- }
- value = 0;
- }
- value = context_w.charCodeAt(0);
- for (i=0 ; i<16 ; i++) {
- context_data_val = (context_data_val << 1) | (value&1);
- if (context_data_position == 15) {
- context_data_position = 0;
- context_data_string += f(context_data_val);
- context_data_val = 0;
- } else {
- context_data_position++;
- }
- value = value >> 1;
- }
- }
- context_enlargeIn--;
- if (context_enlargeIn == 0) {
- context_enlargeIn = Math.pow(2, context_numBits);
- context_numBits++;
- }
- delete context_dictionaryToCreate[context_w];
- } else {
- value = context_dictionary[context_w];
- for (i=0 ; i<context_numBits ; i++) {
- context_data_val = (context_data_val << 1) | (value&1);
- if (context_data_position == 15) {
- context_data_position = 0;
- context_data_string += f(context_data_val);
- context_data_val = 0;
- } else {
- context_data_position++;
- }
- value = value >> 1;
- }
-
-
- }
- context_enlargeIn--;
- if (context_enlargeIn == 0) {
- context_enlargeIn = Math.pow(2, context_numBits);
- context_numBits++;
- }
- }
-
- // Mark the end of the stream
- value = 2;
- for (i=0 ; i<context_numBits ; i++) {
- context_data_val = (context_data_val << 1) | (value&1);
- if (context_data_position == 15) {
- context_data_position = 0;
- context_data_string += f(context_data_val);
- context_data_val = 0;
- } else {
- context_data_position++;
- }
- value = value >> 1;
- }
-
- // Flush the last char
- while (true) {
- context_data_val = (context_data_val << 1);
- if (context_data_position == 15) {
- context_data_string += f(context_data_val);
- break;
- }
- else context_data_position++;
- }
- return context_data_string;
- },
-
- decompress: function (compressed) {
- if (compressed == null) return "";
- if (compressed == "") return null;
- var dictionary = [],
- next,
- enlargeIn = 4,
- dictSize = 4,
- numBits = 3,
- entry = "",
- result = "",
- i,
- w,
- bits, resb, maxpower, power,
- c,
- f = LZString._f,
- data = {string:compressed, val:compressed.charCodeAt(0), position:32768, index:1};
-
- for (i = 0; i < 3; i += 1) {
- dictionary[i] = i;
- }
-
- bits = 0;
- maxpower = Math.pow(2,2);
- power=1;
- while (power!=maxpower) {
- resb = data.val & data.position;
- data.position >>= 1;
- if (data.position == 0) {
- data.position = 32768;
- data.val = data.string.charCodeAt(data.index++);
- }
- bits |= (resb>0 ? 1 : 0) * power;
- power <<= 1;
- }
-
- switch (next = bits) {
- case 0:
- bits = 0;
- maxpower = Math.pow(2,8);
- power=1;
- while (power!=maxpower) {
- resb = data.val & data.position;
- data.position >>= 1;
- if (data.position == 0) {
- data.position = 32768;
- data.val = data.string.charCodeAt(data.index++);
- }
- bits |= (resb>0 ? 1 : 0) * power;
- power <<= 1;
- }
- c = f(bits);
- break;
- case 1:
- bits = 0;
- maxpower = Math.pow(2,16);
- power=1;
- while (power!=maxpower) {
- resb = data.val & data.position;
- data.position >>= 1;
- if (data.position == 0) {
- data.position = 32768;
- data.val = data.string.charCodeAt(data.index++);
- }
- bits |= (resb>0 ? 1 : 0) * power;
- power <<= 1;
- }
- c = f(bits);
- break;
- case 2:
- return "";
- }
- dictionary[3] = c;
- w = result = c;
- while (true) {
- if (data.index > data.string.length) {
- return "";
- }
-
- bits = 0;
- maxpower = Math.pow(2,numBits);
- power=1;
- while (power!=maxpower) {
- resb = data.val & data.position;
- data.position >>= 1;
- if (data.position == 0) {
- data.position = 32768;
- data.val = data.string.charCodeAt(data.index++);
- }
- bits |= (resb>0 ? 1 : 0) * power;
- power <<= 1;
- }
-
- switch (c = bits) {
- case 0:
- bits = 0;
- maxpower = Math.pow(2,8);
- power=1;
- while (power!=maxpower) {
- resb = data.val & data.position;
- data.position >>= 1;
- if (data.position == 0) {
- data.position = 32768;
- data.val = data.string.charCodeAt(data.index++);
- }
- bits |= (resb>0 ? 1 : 0) * power;
- power <<= 1;
- }
-
- dictionary[dictSize++] = f(bits);
- c = dictSize-1;
- enlargeIn--;
- break;
- case 1:
- bits = 0;
- maxpower = Math.pow(2,16);
- power=1;
- while (power!=maxpower) {
- resb = data.val & data.position;
- data.position >>= 1;
- if (data.position == 0) {
- data.position = 32768;
- data.val = data.string.charCodeAt(data.index++);
- }
- bits |= (resb>0 ? 1 : 0) * power;
- power <<= 1;
- }
- dictionary[dictSize++] = f(bits);
- c = dictSize-1;
- enlargeIn--;
- break;
- case 2:
- return result;
- }
-
- if (enlargeIn == 0) {
- enlargeIn = Math.pow(2, numBits);
- numBits++;
- }
-
- if (dictionary[c]) {
- entry = dictionary[c];
- } else {
- if (c === dictSize) {
- entry = w + w.charAt(0);
- } else {
- return null;
- }
- }
- result += entry;
-
- // Add w+entry[0] to the dictionary.
- dictionary[dictSize++] = w + entry.charAt(0);
- enlargeIn--;
-
- w = entry;
-
- if (enlargeIn == 0) {
- enlargeIn = Math.pow(2, numBits);
- numBits++;
- }
-
- }
- }
-};
-
-if( typeof module !== 'undefined' && module != null ) {
- module.exports = LZString
-}