diff --git a/.jazzy.yaml b/.jazzy.yaml index 7521aca4..dd110ce9 100644 --- a/.jazzy.yaml +++ b/.jazzy.yaml @@ -4,9 +4,9 @@ exclude: Tests/ swift_version: 3.0.2 author: Timofey Solomko module: SWCompression -module_version: 2.1.0 +module_version: 2.2.0-test copyright: '© 2017 Timofey Solomko' readme: README.md github_url: https://github.com/tsolomko/SWCompression -github_file_prefix: https://github.com/tsolomko/SWCompression/tree/v2.1.0 +github_file_prefix: https://github.com/tsolomko/SWCompression/tree/v2.2.0-test theme: fullwidth diff --git a/CHANGELOG.md b/CHANGELOG.md index 25a70c8a..6f3dbd66 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,9 @@ # Changelog +v2.2.0-test +---------------- +- Deflate compression (limited). +- More ZIP public functions (API). + v2.1.0 ---------------- - ZIP containers support. diff --git a/SWCompression.podspec b/SWCompression.podspec index 8a605549..eb638e68 100644 --- a/SWCompression.podspec +++ b/SWCompression.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "SWCompression" - s.version = "2.1.0" + s.version = "2.2.0-test" s.summary = "Framework with implementations in Swift of different (de)compression algorithms" s.description = <<-DESC @@ -34,7 +34,7 @@ Pod::Spec.new do |s| s.subspec 'Deflate' do |sp| sp.dependency 'SWCompression/Common' - sp.source_files = 'Sources/{Deflate.swift,HuffmanTree.swift}' + sp.source_files = 'Sources/{Deflate.swift,HuffmanTree.swift,BitToByteWriter.swift}' end s.subspec 'GZip' do |sp| diff --git a/Sources/Service/Info-iOS.plist b/Sources/Service/Info-iOS.plist index f69838d4..5d0ca0de 100644 --- a/Sources/Service/Info-iOS.plist +++ b/Sources/Service/Info-iOS.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 2.1.0 + 2.2.0-test CFBundleVersion $(CURRENT_PROJECT_VERSION) NSPrincipalClass diff --git a/Sources/Service/Info-tvOS.plist b/Sources/Service/Info-tvOS.plist index f69838d4..5d0ca0de 100644 --- a/Sources/Service/Info-tvOS.plist +++ b/Sources/Service/Info-tvOS.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 2.1.0 + 2.2.0-test CFBundleVersion $(CURRENT_PROJECT_VERSION) NSPrincipalClass diff --git a/Sources/Service/Info-watchOS.plist b/Sources/Service/Info-watchOS.plist index f69838d4..5d0ca0de 100644 --- a/Sources/Service/Info-watchOS.plist +++ b/Sources/Service/Info-watchOS.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 2.1.0 + 2.2.0-test CFBundleVersion $(CURRENT_PROJECT_VERSION) NSPrincipalClass diff --git a/Sources/Service/Info.plist b/Sources/Service/Info.plist index 64df5ef2..537c1690 100644 --- a/Sources/Service/Info.plist +++ b/Sources/Service/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 2.1.0 + 2.2.0-test CFBundleVersion $(CURRENT_PROJECT_VERSION) NSHumanReadableCopyright diff --git a/docs/Classes.html b/docs/Classes.html index 0bc99893..1eb8f2bc 100644 --- a/docs/Classes.html +++ b/docs/Classes.html @@ -8,6 +8,9 @@ + + + @@ -19,7 +22,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

+ +

+

+ +

@@ -121,6 +130,9 @@

+ @@ -174,7 +186,7 @@
- Show on GitHub + Show on GitHub
@@ -209,7 +221,7 @@
- Show on GitHub + Show on GitHub
@@ -244,7 +256,7 @@
- Show on GitHub + Show on GitHub
@@ -279,7 +291,7 @@
- Show on GitHub + Show on GitHub
@@ -314,7 +326,7 @@
- Show on GitHub + Show on GitHub
@@ -349,7 +361,7 @@
- Show on GitHub + Show on GitHub
@@ -384,7 +396,7 @@
- Show on GitHub + Show on GitHub
@@ -419,7 +431,7 @@
- Show on GitHub + Show on GitHub
@@ -433,7 +445,7 @@ diff --git a/docs/Classes/BZip2.html b/docs/Classes/BZip2.html index a99476d9..1cfdab13 100644 --- a/docs/Classes/BZip2.html +++ b/docs/Classes/BZip2.html @@ -8,6 +8,9 @@ + + + @@ -20,7 +23,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

+ +

+

+ +

@@ -122,6 +131,9 @@

+ @@ -172,23 +184,11 @@

If data passed is not actually compressed with BZip2, BZip2Error will be thrown.

-
-

Parameter

-

Parameter compressedData: Data compressed with BZip2.

- -
-

Throws

BZip2Error if unexpected byte (bit) sequence was encountered in compressedData. It may indicate that either the data is damaged or it might not be compressed with BZip2 at all.

-
- -
-

Returns

-

Decompressed data.

-
@@ -226,7 +226,7 @@ It may indicate that either the data is damaged or it might not be compressed wi
- Show on GitHub + Show on GitHub
@@ -240,7 +240,7 @@ It may indicate that either the data is damaged or it might not be compressed wi diff --git a/docs/Classes/Deflate.html b/docs/Classes/Deflate.html index 6c863702..763fdee2 100644 --- a/docs/Classes/Deflate.html +++ b/docs/Classes/Deflate.html @@ -8,6 +8,9 @@ + + + @@ -20,7 +23,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

+ +

+

+ +

@@ -122,6 +131,9 @@

+ @@ -172,23 +184,11 @@

If data passed is not actually compressed with DEFLATE, DeflateError will be thrown.

-
-

Parameter

-

Parameter compressedData: Data compressed with DEFLATE.

- -
-

Throws

DeflateError if unexpected byte (bit) sequence was encountered in compressedData. It may indicate that either the data is damaged or it might not be compressed with DEFLATE at all.

-
- -
-

Returns

-

Decompressed data.

-
@@ -226,7 +226,37 @@ It may indicate that either the data is damaged or it might not be compressed wi
- Show on GitHub + Show on GitHub +
+ + + +
  • +
    + + + + compress(data:) + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class Deflate: DecompressionAlgorithm
    + +
    +
    +
    @@ -240,7 +270,7 @@ It may indicate that either the data is damaged or it might not be compressed wi diff --git a/docs/Classes/GzipArchive.html b/docs/Classes/GzipArchive.html index d962fa55..b9dc16cd 100644 --- a/docs/Classes/GzipArchive.html +++ b/docs/Classes/GzipArchive.html @@ -8,6 +8,9 @@ + + + @@ -20,7 +23,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

    + +

    +

    + +

    @@ -122,6 +131,9 @@

  • + @@ -180,23 +192,11 @@ -
    -

    Parameter

    -

    Parameter archiveData: Data compressed with gzip.

    - -
    -

    Throws

    DeflateError or GzipError depending on the type of inconsistency in data. It may indicate that either the data is damaged or it might not be compressed with gzip or DEFLATE at all.

    -
    - -
    -

    Returns

    -

    Unarchived data.

    -
    @@ -234,7 +234,7 @@ It may indicate that either the data is damaged or it might not be compressed wi
    - Show on GitHub + Show on GitHub
    @@ -248,7 +248,7 @@ It may indicate that either the data is damaged or it might not be compressed wi diff --git a/docs/Classes/LZMA.html b/docs/Classes/LZMA.html index 7623d503..dbe1b5b0 100644 --- a/docs/Classes/LZMA.html +++ b/docs/Classes/LZMA.html @@ -8,6 +8,9 @@ + + + @@ -20,7 +23,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

    + +

    +

    + +

    @@ -122,6 +131,9 @@

    + @@ -172,23 +184,11 @@

    If data passed is not actually compressed with LZMA, LZMAError will be thrown.

    -
    -

    Parameter

    -

    Parameter compressedData: Data compressed with LZMA.

    - -
    -

    Throws

    LZMAError if unexpected byte (bit) sequence was encountered in compressedData. It may indicate that either the data is damaged or it might not be compressed with LZMA at all.

    -
    - -
    -

    Returns

    -

    Decompressed data.

    -
    @@ -226,7 +226,7 @@ It may indicate that either the data is damaged or it might not be compressed wi
    - Show on GitHub + Show on GitHub
    @@ -240,7 +240,7 @@ It may indicate that either the data is damaged or it might not be compressed wi diff --git a/docs/Classes/LZMA2.html b/docs/Classes/LZMA2.html index 602fd158..101ebc34 100644 --- a/docs/Classes/LZMA2.html +++ b/docs/Classes/LZMA2.html @@ -8,6 +8,9 @@ + + + @@ -20,7 +23,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

    + +

    +

    + +

    @@ -122,6 +131,9 @@

    + @@ -172,23 +184,11 @@

    If data passed is not actually compressed with LZMA2, LZMA2Error or LZMAError will be thrown.

    -
    -

    Parameter

    -

    Parameter compressedData: Data compressed with LZMA2.

    - -
    -

    Throws

    LZMA2Error or LZMAError if unexpected byte (bit) sequence was encountered in compressedData. It may indicate that either the data is damaged or it might not be compressed with LZMA2 at all.

    -
    - -
    -

    Returns

    -

    Decompressed data.

    -
    @@ -226,7 +226,7 @@ It may indicate that either the data is damaged or it might not be compressed wi
    - Show on GitHub + Show on GitHub
    @@ -240,7 +240,7 @@ It may indicate that either the data is damaged or it might not be compressed wi diff --git a/docs/Classes/XZArchive.html b/docs/Classes/XZArchive.html index a682cb4d..185c6ad3 100644 --- a/docs/Classes/XZArchive.html +++ b/docs/Classes/XZArchive.html @@ -8,6 +8,9 @@ + + + @@ -20,7 +23,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

    + +

    +

    + +

    @@ -122,6 +131,9 @@

    + @@ -176,23 +188,11 @@ If filters other than LZMA2 are used in archive then LZMAError or LZMA2Error will be thrown.

    -
    -

    Parameter

    -

    Parameter archiveData: Data compressed with xz.

    - -
    -

    Throws

    LZMAError, LZMA2Error or XZError depending on the type of inconsistency in data. It may indicate that either the data is damaged or it might not be compressed with xz or LZMA(2) at all.

    -
    - -
    -

    Returns

    -

    Unarchived data.

    -
    @@ -230,7 +230,7 @@ It may indicate that either the data is damaged or it might not be compressed wi
    - Show on GitHub + Show on GitHub
    @@ -244,7 +244,7 @@ It may indicate that either the data is damaged or it might not be compressed wi diff --git a/docs/Classes/ZipContainer.html b/docs/Classes/ZipContainer.html index 1f2b185b..9e1bb6c2 100644 --- a/docs/Classes/ZipContainer.html +++ b/docs/Classes/ZipContainer.html @@ -8,6 +8,9 @@ + + + @@ -20,7 +23,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

    + +

    +

    + +

    @@ -122,6 +131,9 @@

    + @@ -155,6 +167,96 @@
    @@ -247,7 +337,7 @@ It may indicate that either the container is damaged or it might not be ZIP cont
    - Show on GitHub + Show on GitHub
    @@ -261,7 +351,7 @@ It may indicate that either the container is damaged or it might not be ZIP cont diff --git a/docs/Classes/ZlibArchive.html b/docs/Classes/ZlibArchive.html index 025dd6f4..93d6c0d4 100644 --- a/docs/Classes/ZlibArchive.html +++ b/docs/Classes/ZlibArchive.html @@ -8,6 +8,9 @@ + + + @@ -20,7 +23,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

    + +

    +

    + +

    @@ -122,6 +131,9 @@

    + @@ -180,23 +192,11 @@ -
    -

    Parameter

    -

    Parameter archiveData: Data compressed with zlib.

    - -
    -

    Throws

    DeflateError or ZlibError depending on the type of inconsistency in data. It may indicate that either the data is damaged or it might not be compressed with zlib or DEFLATE at all.

    -
    - -
    -

    Returns

    -

    Unarchived data.

    -
    @@ -234,7 +234,7 @@ It may indicate that either the data is damaged or it might not be compressed wi
    - Show on GitHub + Show on GitHub
    @@ -248,7 +248,7 @@ It may indicate that either the data is damaged or it might not be compressed wi diff --git a/docs/Enums.html b/docs/Enums.html index fe9c3bca..76efcc45 100644 --- a/docs/Enums.html +++ b/docs/Enums.html @@ -8,6 +8,9 @@ + + + @@ -19,7 +22,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

    + +

    +

    + +

    @@ -121,6 +130,9 @@

    + @@ -183,7 +195,7 @@ It may indicate that either the data is damaged or it might not be compressed wi
    - Show on GitHub + Show on GitHub
    @@ -230,7 +242,7 @@ Associated value contains already decompressed data.
    - Show on GitHub + Show on GitHub
    @@ -280,7 +292,7 @@ It may indicate that either the data is damaged or it might not be ZIP archive (
    - Show on GitHub + Show on GitHub
    @@ -329,7 +341,7 @@ than the repeat length.
    - Show on GitHub + Show on GitHub
    @@ -374,7 +386,7 @@ Associated value contains already decompressed data.
    - Show on GitHub + Show on GitHub
    @@ -417,7 +429,7 @@ It may indicate that either the data is damaged or it might not be compressed wi
    - Show on GitHub + Show on GitHub
    @@ -465,7 +477,7 @@ It may indicate that either the data is damaged or it might not be compressed wi
    - Show on GitHub + Show on GitHub
    @@ -516,7 +528,7 @@ Associated value contains already decompressed data.
    - Show on GitHub + Show on GitHub
    @@ -530,7 +542,7 @@ Associated value contains already decompressed data. diff --git a/docs/Enums/BZip2Error.html b/docs/Enums/BZip2Error.html index a88f9c63..099cdfd3 100644 --- a/docs/Enums/BZip2Error.html +++ b/docs/Enums/BZip2Error.html @@ -8,6 +8,9 @@ + + + @@ -20,7 +23,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

    + +

    +

    + +

    @@ -122,6 +131,9 @@

    + @@ -193,7 +205,7 @@ It may indicate that either the data is damaged or it might not be compressed wi
    - Show on GitHub + Show on GitHub
    @@ -227,7 +239,7 @@ It may indicate that either the data is damaged or it might not be compressed wi
    - Show on GitHub + Show on GitHub
    @@ -261,7 +273,7 @@ It may indicate that either the data is damaged or it might not be compressed wi
    - Show on GitHub + Show on GitHub
    @@ -295,7 +307,7 @@ It may indicate that either the data is damaged or it might not be compressed wi
    - Show on GitHub + Show on GitHub
    @@ -329,7 +341,7 @@ It may indicate that either the data is damaged or it might not be compressed wi
    - Show on GitHub + Show on GitHub
    @@ -363,7 +375,7 @@ It may indicate that either the data is damaged or it might not be compressed wi
    - Show on GitHub + Show on GitHub
    @@ -397,7 +409,7 @@ It may indicate that either the data is damaged or it might not be compressed wi
    - Show on GitHub + Show on GitHub
    @@ -431,7 +443,7 @@ It may indicate that either the data is damaged or it might not be compressed wi
    - Show on GitHub + Show on GitHub
    @@ -465,7 +477,7 @@ It may indicate that either the data is damaged or it might not be compressed wi
    - Show on GitHub + Show on GitHub
    @@ -479,7 +491,7 @@ It may indicate that either the data is damaged or it might not be compressed wi diff --git a/docs/Enums/DeflateError.html b/docs/Enums/DeflateError.html index ea0483a8..b9075084 100644 --- a/docs/Enums/DeflateError.html +++ b/docs/Enums/DeflateError.html @@ -8,6 +8,9 @@ + + + @@ -20,7 +23,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

    + +

    +

    + +

    @@ -122,6 +131,9 @@

    + @@ -188,7 +200,7 @@ It may indicate that either the data is damaged or it might not be compressed wi
    - Show on GitHub + Show on GitHub
    @@ -222,7 +234,7 @@ It may indicate that either the data is damaged or it might not be compressed wi
    - Show on GitHub + Show on GitHub
    @@ -256,7 +268,7 @@ It may indicate that either the data is damaged or it might not be compressed wi
    - Show on GitHub + Show on GitHub
    @@ -290,7 +302,7 @@ It may indicate that either the data is damaged or it might not be compressed wi
    - Show on GitHub + Show on GitHub
    @@ -304,7 +316,7 @@ It may indicate that either the data is damaged or it might not be compressed wi diff --git a/docs/Enums/GzipError.html b/docs/Enums/GzipError.html index 4fe4bfda..a0b1e514 100644 --- a/docs/Enums/GzipError.html +++ b/docs/Enums/GzipError.html @@ -8,6 +8,9 @@ + + + @@ -20,7 +23,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

    + +

    +

    + +

    @@ -122,6 +131,9 @@

    + @@ -192,7 +204,7 @@ Associated value contains already decompressed data.
    - Show on GitHub + Show on GitHub
    @@ -226,7 +238,7 @@ Associated value contains already decompressed data.
    - Show on GitHub + Show on GitHub
    @@ -260,7 +272,7 @@ Associated value contains already decompressed data.
    - Show on GitHub + Show on GitHub
    @@ -294,7 +306,7 @@ Associated value contains already decompressed data.
    - Show on GitHub + Show on GitHub
    @@ -329,7 +341,7 @@ Associated value contains already decompressed data.

    - Show on GitHub + Show on GitHub
    @@ -363,7 +375,7 @@ Associated value contains already decompressed data.

    - Show on GitHub + Show on GitHub
    @@ -377,7 +389,7 @@ Associated value contains already decompressed data.

    diff --git a/docs/Enums/LZMA2Error.html b/docs/Enums/LZMA2Error.html index bd30c240..9d450f1c 100644 --- a/docs/Enums/LZMA2Error.html +++ b/docs/Enums/LZMA2Error.html @@ -8,6 +8,9 @@ + + + @@ -20,7 +23,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

    + +

    +

    + +

    @@ -122,6 +131,9 @@

    + @@ -189,7 +201,7 @@ It may indicate that either the data is damaged or it might not be compressed wi
    - Show on GitHub + Show on GitHub
    @@ -223,7 +235,7 @@ It may indicate that either the data is damaged or it might not be compressed wi
    - Show on GitHub + Show on GitHub
    @@ -257,7 +269,7 @@ It may indicate that either the data is damaged or it might not be compressed wi
    - Show on GitHub + Show on GitHub
    @@ -291,7 +303,7 @@ It may indicate that either the data is damaged or it might not be compressed wi
    - Show on GitHub + Show on GitHub
    @@ -326,7 +338,7 @@ amount of compressed data read was different from the one stored in LZMA2 packet
    - Show on GitHub + Show on GitHub
    @@ -340,7 +352,7 @@ amount of compressed data read was different from the one stored in LZMA2 packet diff --git a/docs/Enums/LZMAError.html b/docs/Enums/LZMAError.html index 44158bbf..f50e7e33 100644 --- a/docs/Enums/LZMAError.html +++ b/docs/Enums/LZMAError.html @@ -8,6 +8,9 @@ + + + @@ -20,7 +23,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

    + +

    +

    + +

    @@ -122,6 +131,9 @@

    + @@ -194,7 +206,7 @@ than the repeat length.
    - Show on GitHub + Show on GitHub
    @@ -228,7 +240,7 @@ than the repeat length.
    - Show on GitHub + Show on GitHub
    @@ -262,7 +274,7 @@ than the repeat length.
    - Show on GitHub + Show on GitHub
    @@ -296,7 +308,7 @@ than the repeat length.
    - Show on GitHub + Show on GitHub
    @@ -330,7 +342,7 @@ than the repeat length.
    - Show on GitHub + Show on GitHub
    @@ -364,7 +376,7 @@ than the repeat length.
    - Show on GitHub + Show on GitHub
    @@ -398,7 +410,7 @@ than the repeat length.
    - Show on GitHub + Show on GitHub
    @@ -412,7 +424,7 @@ than the repeat length. diff --git a/docs/Enums/XZError.html b/docs/Enums/XZError.html index 864608ca..bc14e588 100644 --- a/docs/Enums/XZError.html +++ b/docs/Enums/XZError.html @@ -8,6 +8,9 @@ + + + @@ -20,7 +23,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

    + +

    +

    + +

    @@ -122,6 +131,9 @@

    + @@ -196,7 +208,7 @@ Associated value contains already decompressed data.
    - Show on GitHub + Show on GitHub
    @@ -230,7 +242,7 @@ Associated value contains already decompressed data.
    - Show on GitHub + Show on GitHub
    @@ -264,7 +276,7 @@ Associated value contains already decompressed data.
    - Show on GitHub + Show on GitHub
    @@ -298,7 +310,7 @@ Associated value contains already decompressed data.
    - Show on GitHub + Show on GitHub
    @@ -332,7 +344,7 @@ Associated value contains already decompressed data.
    - Show on GitHub + Show on GitHub
    @@ -366,7 +378,7 @@ Associated value contains already decompressed data.
    - Show on GitHub + Show on GitHub
    @@ -401,7 +413,7 @@ amount of compressed data read was different from the one stored in block header
    - Show on GitHub + Show on GitHub
    @@ -436,7 +448,7 @@ Associated value contains already decompressed data.

    - Show on GitHub + Show on GitHub
    @@ -470,7 +482,7 @@ Associated value contains already decompressed data.

    - Show on GitHub + Show on GitHub
    @@ -504,7 +516,7 @@ Associated value contains already decompressed data.

    - Show on GitHub + Show on GitHub
    @@ -518,7 +530,7 @@ Associated value contains already decompressed data.

    diff --git a/docs/Enums/ZipError.html b/docs/Enums/ZipError.html index 7bb1976a..0ea33993 100644 --- a/docs/Enums/ZipError.html +++ b/docs/Enums/ZipError.html @@ -8,6 +8,9 @@ + + + @@ -20,7 +23,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

    + +

    +

    + +

    @@ -122,6 +131,9 @@

    + @@ -195,7 +207,7 @@ It may indicate that either the data is damaged or it might not be ZIP archive (
    - Show on GitHub + Show on GitHub
    @@ -229,7 +241,7 @@ It may indicate that either the data is damaged or it might not be ZIP archive (
    - Show on GitHub + Show on GitHub
    @@ -263,7 +275,7 @@ It may indicate that either the data is damaged or it might not be ZIP archive (
    - Show on GitHub + Show on GitHub
    @@ -297,7 +309,7 @@ It may indicate that either the data is damaged or it might not be ZIP archive (
    - Show on GitHub + Show on GitHub
    @@ -331,7 +343,7 @@ It may indicate that either the data is damaged or it might not be ZIP archive (
    - Show on GitHub + Show on GitHub
    @@ -365,7 +377,7 @@ It may indicate that either the data is damaged or it might not be ZIP archive (
    - Show on GitHub + Show on GitHub
    @@ -399,7 +411,7 @@ It may indicate that either the data is damaged or it might not be ZIP archive (
    - Show on GitHub + Show on GitHub
    @@ -433,7 +445,7 @@ It may indicate that either the data is damaged or it might not be ZIP archive (
    - Show on GitHub + Show on GitHub
    @@ -467,7 +479,7 @@ It may indicate that either the data is damaged or it might not be ZIP archive (
    - Show on GitHub + Show on GitHub
    @@ -501,7 +513,7 @@ It may indicate that either the data is damaged or it might not be ZIP archive (
    - Show on GitHub + Show on GitHub
    @@ -515,7 +527,7 @@ It may indicate that either the data is damaged or it might not be ZIP archive ( diff --git a/docs/Enums/ZlibError.html b/docs/Enums/ZlibError.html index 707dd6c3..df3bfae5 100644 --- a/docs/Enums/ZlibError.html +++ b/docs/Enums/ZlibError.html @@ -8,6 +8,9 @@ + + + @@ -20,7 +23,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

    + +

    +

    + +

    @@ -122,6 +131,9 @@

    + @@ -190,7 +202,7 @@ Associated value contains already decompressed data.
    - Show on GitHub + Show on GitHub
    @@ -224,7 +236,7 @@ Associated value contains already decompressed data.
    - Show on GitHub + Show on GitHub
    @@ -258,7 +270,7 @@ Associated value contains already decompressed data.
    - Show on GitHub + Show on GitHub
    @@ -292,7 +304,7 @@ Associated value contains already decompressed data.
    - Show on GitHub + Show on GitHub
    @@ -327,7 +339,7 @@ Associated value contains already decompressed data.

    - Show on GitHub + Show on GitHub
    @@ -341,7 +353,7 @@ Associated value contains already decompressed data.

    diff --git a/docs/Protocols.html b/docs/Protocols.html index c1fa9c82..d174c2ba 100644 --- a/docs/Protocols.html +++ b/docs/Protocols.html @@ -8,6 +8,9 @@ + + + @@ -19,7 +22,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

    + +

    +

    + +

    @@ -121,6 +130,9 @@

    + @@ -174,7 +186,7 @@
    - Show on GitHub + Show on GitHub
    @@ -205,7 +217,7 @@
    - Show on GitHub + Show on GitHub
    @@ -219,7 +231,7 @@ diff --git a/docs/Protocols/Archive.html b/docs/Protocols/Archive.html index 84a991bd..a50f2b7f 100644 --- a/docs/Protocols/Archive.html +++ b/docs/Protocols/Archive.html @@ -8,6 +8,9 @@ + + + @@ -20,7 +23,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

    + +

    +

    + +

    @@ -122,6 +131,9 @@

    + @@ -180,7 +192,7 @@
    - Show on GitHub + Show on GitHub
    @@ -194,7 +206,7 @@ diff --git a/docs/Protocols/DecompressionAlgorithm.html b/docs/Protocols/DecompressionAlgorithm.html index d325c541..c178a387 100644 --- a/docs/Protocols/DecompressionAlgorithm.html +++ b/docs/Protocols/DecompressionAlgorithm.html @@ -8,6 +8,9 @@ + + + @@ -20,7 +23,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

    + +

    +

    + +

    @@ -122,6 +131,9 @@

    + @@ -180,7 +192,7 @@
    - Show on GitHub + Show on GitHub
    @@ -194,7 +206,7 @@ diff --git a/docs/Structs.html b/docs/Structs.html index 4af3de12..947f4b95 100644 --- a/docs/Structs.html +++ b/docs/Structs.html @@ -8,6 +8,9 @@ + + + @@ -19,7 +22,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

    + +

    +

    + +

    @@ -121,6 +130,9 @@

    + @@ -174,7 +186,34 @@
    - Show on GitHub + Show on GitHub +
    + + + + + +
    +
    - Show on GitHub + Show on GitHub
    @@ -223,7 +262,7 @@ diff --git a/docs/Structs/GzipHeader.html b/docs/Structs/GzipHeader.html index b8746b3d..b8dbe7a6 100644 --- a/docs/Structs/GzipHeader.html +++ b/docs/Structs/GzipHeader.html @@ -8,6 +8,9 @@ + + + @@ -20,7 +23,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

    + +

    +

    + +

    @@ -122,6 +131,9 @@

    + @@ -181,7 +193,7 @@
    - Show on GitHub + Show on GitHub
    @@ -212,7 +224,7 @@
    - Show on GitHub + Show on GitHub
    @@ -242,7 +254,7 @@
    - Show on GitHub + Show on GitHub
    @@ -272,7 +284,7 @@
    - Show on GitHub + Show on GitHub
    @@ -302,7 +314,7 @@
    - Show on GitHub + Show on GitHub
    @@ -332,7 +344,7 @@
    - Show on GitHub + Show on GitHub
    @@ -362,7 +374,7 @@
    - Show on GitHub + Show on GitHub
    @@ -384,12 +396,6 @@

    If data passed is not actually a gzip archive, GzipError will be thrown.

    -
    -

    Parameter

    -

    Parameter archiveData: Data compressed with gzip.

    - -
    -

    Throws

    GzipError. It may indicate that either the data is damaged or @@ -427,7 +433,7 @@ it might not be compressed with gzip at all.

    - Show on GitHub + Show on GitHub
    @@ -441,7 +447,7 @@ it might not be compressed with gzip at all.

    diff --git a/docs/Structs/GzipHeader/CompressionMethod.html b/docs/Structs/GzipHeader/CompressionMethod.html index 203fa4c1..02bba75c 100644 --- a/docs/Structs/GzipHeader/CompressionMethod.html +++ b/docs/Structs/GzipHeader/CompressionMethod.html @@ -8,6 +8,9 @@ + + + @@ -20,7 +23,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

    + +

    +

    + +

    @@ -122,6 +131,9 @@

    + @@ -180,7 +192,7 @@
    - Show on GitHub + Show on GitHub
    @@ -194,7 +206,7 @@ diff --git a/docs/Structs/GzipHeader/FileSystemType.html b/docs/Structs/GzipHeader/FileSystemType.html index 59859573..b00b30c9 100644 --- a/docs/Structs/GzipHeader/FileSystemType.html +++ b/docs/Structs/GzipHeader/FileSystemType.html @@ -8,6 +8,9 @@ + + + @@ -20,7 +23,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

    + +

    +

    + +

    @@ -122,6 +131,9 @@

    + @@ -180,7 +192,7 @@
    - Show on GitHub + Show on GitHub
    @@ -214,7 +226,7 @@
    - Show on GitHub + Show on GitHub
    @@ -248,7 +260,7 @@
    - Show on GitHub + Show on GitHub
    @@ -282,7 +294,7 @@
    - Show on GitHub + Show on GitHub
    @@ -316,7 +328,7 @@
    - Show on GitHub + Show on GitHub
    @@ -330,7 +342,7 @@ diff --git a/docs/Structs/ZipEntry.html b/docs/Structs/ZipEntry.html new file mode 100644 index 00000000..e8539550 --- /dev/null +++ b/docs/Structs/ZipEntry.html @@ -0,0 +1,243 @@ + + + + ZipEntry Struct Reference + + + + + + + + + + + + + + + + +
    +

    + + SWCompression Docs + + (93% documented) +

    + +

    +

    + +
    +

    + +

    + + + View on GitHub + +

    + +
    + + + +
    + + +
    + + + + diff --git a/docs/Structs/ZlibHeader.html b/docs/Structs/ZlibHeader.html index ea7ac348..1306fbf0 100644 --- a/docs/Structs/ZlibHeader.html +++ b/docs/Structs/ZlibHeader.html @@ -8,6 +8,9 @@ + + + @@ -20,7 +23,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

    + +

    +

    + +

    @@ -122,6 +131,9 @@

    + @@ -181,7 +193,7 @@
    - Show on GitHub + Show on GitHub
    @@ -212,7 +224,7 @@
    - Show on GitHub + Show on GitHub
    @@ -242,7 +254,7 @@
    - Show on GitHub + Show on GitHub
    @@ -272,7 +284,7 @@
    - Show on GitHub + Show on GitHub
    @@ -302,7 +314,7 @@
    - Show on GitHub + Show on GitHub
    @@ -324,12 +336,6 @@

    If data passed is not actually a zlib archive, ZlibError will be thrown.

    -
    -

    Parameter

    -

    Parameter archiveData: Data compressed with zlib.

    - -
    -

    Throws

    ZlibError. It may indicate that either the data is damaged or @@ -367,7 +373,7 @@ it might not be compressed with zlib at all.

    - Show on GitHub + Show on GitHub
    @@ -381,7 +387,7 @@ it might not be compressed with zlib at all.

    diff --git a/docs/Structs/ZlibHeader/CompressionLevel.html b/docs/Structs/ZlibHeader/CompressionLevel.html index b0ed94fa..98fbc913 100644 --- a/docs/Structs/ZlibHeader/CompressionLevel.html +++ b/docs/Structs/ZlibHeader/CompressionLevel.html @@ -8,6 +8,9 @@ + + + @@ -20,7 +23,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

    + +

    +

    + +

    @@ -122,6 +131,9 @@

    + @@ -180,7 +192,7 @@
    - Show on GitHub + Show on GitHub
    @@ -214,7 +226,7 @@
    - Show on GitHub + Show on GitHub
    @@ -248,7 +260,7 @@
    - Show on GitHub + Show on GitHub
    @@ -282,7 +294,7 @@
    - Show on GitHub + Show on GitHub
    @@ -296,7 +308,7 @@ diff --git a/docs/Structs/ZlibHeader/CompressionMethod.html b/docs/Structs/ZlibHeader/CompressionMethod.html index 21086040..7fa29476 100644 --- a/docs/Structs/ZlibHeader/CompressionMethod.html +++ b/docs/Structs/ZlibHeader/CompressionMethod.html @@ -8,6 +8,9 @@ + + + @@ -20,7 +23,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

    + +

    +

    + +

    @@ -122,6 +131,9 @@

    + @@ -180,7 +192,7 @@
    - Show on GitHub + Show on GitHub
    @@ -194,7 +206,7 @@ diff --git a/docs/badge.svg b/docs/badge.svg new file mode 100644 index 00000000..a720cf66 --- /dev/null +++ b/docs/badge.svg @@ -0,0 +1 @@ +documentationdocumentation93%93% \ No newline at end of file diff --git a/docs/css/jazzy.css b/docs/css/jazzy.css index 75b54333..c83db5bf 100644 --- a/docs/css/jazzy.css +++ b/docs/css/jazzy.css @@ -327,3 +327,42 @@ html.dash .header, html.dash .breadcrumbs, html.dash .navigation { display: none; } html.dash .height-container { display: block; } + +form[role=search] input { + font: 16px/1.7 "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; + line-height: 24px; + padding: 0 10px; + margin: 0; + border: none; + border-radius: 1em; } + .loading form[role=search] input { + background: white url(../img/spinner.gif) center right 4px no-repeat; } +form[role=search] .tt-menu { + margin: 0; + min-width: 300px; + background: #fbfbfb; + color: #333; + border: 1px solid #ddd; } +form[role=search] .tt-highlight { + font-weight: bold; } +form[role=search] .tt-suggestion { + font: 16px/1.7 "Helvetica Neue", Helvetica, Arial, sans-serif; + padding: 0 8px; } + form[role=search] .tt-suggestion span { + display: table-cell; + white-space: nowrap; } + form[role=search] .tt-suggestion .doc-parent-name { + width: 100%; + text-align: right; + font-weight: normal; + font-size: 0.9em; + padding-left: 16px; } +form[role=search] .tt-suggestion:hover, +form[role=search] .tt-suggestion.tt-cursor { + cursor: pointer; + background-color: #4183c4; + color: #fff; } +form[role=search] .tt-suggestion:hover .doc-parent-name, +form[role=search] .tt-suggestion.tt-cursor .doc-parent-name { + color: #fff; } diff --git a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Classes.html b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Classes.html index 0bc99893..1eb8f2bc 100644 --- a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Classes.html +++ b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Classes.html @@ -8,6 +8,9 @@ + + + @@ -19,7 +22,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

    + +

    +

    + +

    @@ -121,6 +130,9 @@

    + @@ -174,7 +186,7 @@
    - Show on GitHub + Show on GitHub
    @@ -209,7 +221,7 @@
    - Show on GitHub + Show on GitHub
    @@ -244,7 +256,7 @@
    - Show on GitHub + Show on GitHub
    @@ -279,7 +291,7 @@
    - Show on GitHub + Show on GitHub
    @@ -314,7 +326,7 @@
    - Show on GitHub + Show on GitHub
    @@ -349,7 +361,7 @@
    - Show on GitHub + Show on GitHub
    @@ -384,7 +396,7 @@
    - Show on GitHub + Show on GitHub
    @@ -419,7 +431,7 @@
    - Show on GitHub + Show on GitHub
    @@ -433,7 +445,7 @@ diff --git a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/BZip2.html b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/BZip2.html index a99476d9..1cfdab13 100644 --- a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/BZip2.html +++ b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/BZip2.html @@ -8,6 +8,9 @@ + + + @@ -20,7 +23,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

    + +

    +

    + +

    @@ -122,6 +131,9 @@

    + @@ -172,23 +184,11 @@

    If data passed is not actually compressed with BZip2, BZip2Error will be thrown.

    -
    -

    Parameter

    -

    Parameter compressedData: Data compressed with BZip2.

    - -
    -

    Throws

    BZip2Error if unexpected byte (bit) sequence was encountered in compressedData. It may indicate that either the data is damaged or it might not be compressed with BZip2 at all.

    -
    - -
    -

    Returns

    -

    Decompressed data.

    -
    @@ -226,7 +226,7 @@ It may indicate that either the data is damaged or it might not be compressed wi
    - Show on GitHub + Show on GitHub
    @@ -240,7 +240,7 @@ It may indicate that either the data is damaged or it might not be compressed wi diff --git a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/Deflate.html b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/Deflate.html index 6c863702..763fdee2 100644 --- a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/Deflate.html +++ b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/Deflate.html @@ -8,6 +8,9 @@ + + + @@ -20,7 +23,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

    + +

    +

    + +

    @@ -122,6 +131,9 @@

    + @@ -172,23 +184,11 @@

    If data passed is not actually compressed with DEFLATE, DeflateError will be thrown.

    -
    -

    Parameter

    -

    Parameter compressedData: Data compressed with DEFLATE.

    - -
    -

    Throws

    DeflateError if unexpected byte (bit) sequence was encountered in compressedData. It may indicate that either the data is damaged or it might not be compressed with DEFLATE at all.

    -
    - -
    -

    Returns

    -

    Decompressed data.

    -
    @@ -226,7 +226,37 @@ It may indicate that either the data is damaged or it might not be compressed wi
    - Show on GitHub + Show on GitHub +
    + + + +
  • +
    + + + + compress(data:) + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class Deflate: DecompressionAlgorithm
    + +
    +
    +
    @@ -240,7 +270,7 @@ It may indicate that either the data is damaged or it might not be compressed wi diff --git a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/GzipArchive.html b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/GzipArchive.html index d962fa55..b9dc16cd 100644 --- a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/GzipArchive.html +++ b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/GzipArchive.html @@ -8,6 +8,9 @@ + + + @@ -20,7 +23,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

    + +

    +

    + +

    @@ -122,6 +131,9 @@

  • + @@ -180,23 +192,11 @@ -
    -

    Parameter

    -

    Parameter archiveData: Data compressed with gzip.

    - -
    -

    Throws

    DeflateError or GzipError depending on the type of inconsistency in data. It may indicate that either the data is damaged or it might not be compressed with gzip or DEFLATE at all.

    -
    - -
    -

    Returns

    -

    Unarchived data.

    -
    @@ -234,7 +234,7 @@ It may indicate that either the data is damaged or it might not be compressed wi
    - Show on GitHub + Show on GitHub
    @@ -248,7 +248,7 @@ It may indicate that either the data is damaged or it might not be compressed wi diff --git a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/LZMA.html b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/LZMA.html index 7623d503..dbe1b5b0 100644 --- a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/LZMA.html +++ b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/LZMA.html @@ -8,6 +8,9 @@ + + + @@ -20,7 +23,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

    + +

    +

    + +

    @@ -122,6 +131,9 @@

    + @@ -172,23 +184,11 @@

    If data passed is not actually compressed with LZMA, LZMAError will be thrown.

    -
    -

    Parameter

    -

    Parameter compressedData: Data compressed with LZMA.

    - -
    -

    Throws

    LZMAError if unexpected byte (bit) sequence was encountered in compressedData. It may indicate that either the data is damaged or it might not be compressed with LZMA at all.

    -
    - -
    -

    Returns

    -

    Decompressed data.

    -
    @@ -226,7 +226,7 @@ It may indicate that either the data is damaged or it might not be compressed wi
    - Show on GitHub + Show on GitHub
    @@ -240,7 +240,7 @@ It may indicate that either the data is damaged or it might not be compressed wi diff --git a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/LZMA2.html b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/LZMA2.html index 602fd158..101ebc34 100644 --- a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/LZMA2.html +++ b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/LZMA2.html @@ -8,6 +8,9 @@ + + + @@ -20,7 +23,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

    + +

    +

    + +

    @@ -122,6 +131,9 @@

    + @@ -172,23 +184,11 @@

    If data passed is not actually compressed with LZMA2, LZMA2Error or LZMAError will be thrown.

    -
    -

    Parameter

    -

    Parameter compressedData: Data compressed with LZMA2.

    - -
    -

    Throws

    LZMA2Error or LZMAError if unexpected byte (bit) sequence was encountered in compressedData. It may indicate that either the data is damaged or it might not be compressed with LZMA2 at all.

    -
    - -
    -

    Returns

    -

    Decompressed data.

    -
    @@ -226,7 +226,7 @@ It may indicate that either the data is damaged or it might not be compressed wi
    - Show on GitHub + Show on GitHub
    @@ -240,7 +240,7 @@ It may indicate that either the data is damaged or it might not be compressed wi diff --git a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/XZArchive.html b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/XZArchive.html index a682cb4d..185c6ad3 100644 --- a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/XZArchive.html +++ b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/XZArchive.html @@ -8,6 +8,9 @@ + + + @@ -20,7 +23,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

    + +

    +

    + +

    @@ -122,6 +131,9 @@

    + @@ -176,23 +188,11 @@ If filters other than LZMA2 are used in archive then LZMAError or LZMA2Error will be thrown.

    -
    -

    Parameter

    -

    Parameter archiveData: Data compressed with xz.

    - -
    -

    Throws

    LZMAError, LZMA2Error or XZError depending on the type of inconsistency in data. It may indicate that either the data is damaged or it might not be compressed with xz or LZMA(2) at all.

    -
    - -
    -

    Returns

    -

    Unarchived data.

    -
    @@ -230,7 +230,7 @@ It may indicate that either the data is damaged or it might not be compressed wi
    - Show on GitHub + Show on GitHub
    @@ -244,7 +244,7 @@ It may indicate that either the data is damaged or it might not be compressed wi diff --git a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/ZipContainer.html b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/ZipContainer.html index 1f2b185b..9e1bb6c2 100644 --- a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/ZipContainer.html +++ b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/ZipContainer.html @@ -8,6 +8,9 @@ + + + @@ -20,7 +23,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

    + +

    +

    + +

    @@ -122,6 +131,9 @@

    + @@ -155,6 +167,96 @@
      +
    • +
      + + + + entries + +
      +
      +
      +
      +
      +
      +

      Undocumented

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public class ZipContainer
      + +
      +
      + +
      +
      +
    • +
    • +
      + + + + init(containerData:) + +
      +
      +
      +
      +
      +
      +

      Undocumented

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public class ZipContainer
      + +
      +
      + +
      +
      +
    • +
    • +
      + + + + data(for:) + +
      +
      +
      +
      +
      +
      +

      Undocumented

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public class ZipContainer
      + +
      +
      + +
      +
      +
    • @@ -193,23 +295,11 @@ the last character of entry’s name (it should be ‘/’). If all
      -
      -

      Parameter

      -

      Parameter containerData: Data of ZIP container.

      - -
      -

      Throws

      ZipError or DeflateError depending on the type of inconsistency in data. It may indicate that either the container is damaged or it might not be ZIP container or compressed with Deflate at all.

      -
      - -
      -

      Returns

      -

      Array of pairs (tuples) where first member is entryName and second member is entryData.

      -
    @@ -247,7 +337,7 @@ It may indicate that either the container is damaged or it might not be ZIP cont
    @@ -261,7 +351,7 @@ It may indicate that either the container is damaged or it might not be ZIP cont diff --git a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/ZlibArchive.html b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/ZlibArchive.html index 025dd6f4..93d6c0d4 100644 --- a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/ZlibArchive.html +++ b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Classes/ZlibArchive.html @@ -8,6 +8,9 @@ + + + @@ -20,7 +23,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

    + +

    +

    + +

    @@ -122,6 +131,9 @@

    + @@ -180,23 +192,11 @@ -
    -

    Parameter

    -

    Parameter archiveData: Data compressed with zlib.

    - -
    -

    Throws

    DeflateError or ZlibError depending on the type of inconsistency in data. It may indicate that either the data is damaged or it might not be compressed with zlib or DEFLATE at all.

    -
    - -
    -

    Returns

    -

    Unarchived data.

    -
    @@ -234,7 +234,7 @@ It may indicate that either the data is damaged or it might not be compressed wi @@ -248,7 +248,7 @@ It may indicate that either the data is damaged or it might not be compressed wi diff --git a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Enums.html b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Enums.html index fe9c3bca..76efcc45 100644 --- a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Enums.html +++ b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Enums.html @@ -8,6 +8,9 @@ + + + @@ -19,7 +22,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

    + +

    +

    + +

    @@ -121,6 +130,9 @@

    + @@ -183,7 +195,7 @@ It may indicate that either the data is damaged or it might not be compressed wi @@ -230,7 +242,7 @@ Associated value contains already decompressed data. @@ -280,7 +292,7 @@ It may indicate that either the data is damaged or it might not be ZIP archive ( @@ -329,7 +341,7 @@ than the repeat length. @@ -374,7 +386,7 @@ Associated value contains already decompressed data. @@ -417,7 +429,7 @@ It may indicate that either the data is damaged or it might not be compressed wi @@ -465,7 +477,7 @@ It may indicate that either the data is damaged or it might not be compressed wi @@ -516,7 +528,7 @@ Associated value contains already decompressed data. @@ -530,7 +542,7 @@ Associated value contains already decompressed data. diff --git a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/BZip2Error.html b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/BZip2Error.html index a88f9c63..099cdfd3 100644 --- a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/BZip2Error.html +++ b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/BZip2Error.html @@ -8,6 +8,9 @@ + + + @@ -20,7 +23,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

    + +

    +

    + +

    @@ -122,6 +131,9 @@

    + @@ -193,7 +205,7 @@ It may indicate that either the data is damaged or it might not be compressed wi @@ -227,7 +239,7 @@ It may indicate that either the data is damaged or it might not be compressed wi @@ -261,7 +273,7 @@ It may indicate that either the data is damaged or it might not be compressed wi @@ -295,7 +307,7 @@ It may indicate that either the data is damaged or it might not be compressed wi @@ -329,7 +341,7 @@ It may indicate that either the data is damaged or it might not be compressed wi @@ -363,7 +375,7 @@ It may indicate that either the data is damaged or it might not be compressed wi @@ -397,7 +409,7 @@ It may indicate that either the data is damaged or it might not be compressed wi @@ -431,7 +443,7 @@ It may indicate that either the data is damaged or it might not be compressed wi @@ -465,7 +477,7 @@ It may indicate that either the data is damaged or it might not be compressed wi @@ -479,7 +491,7 @@ It may indicate that either the data is damaged or it might not be compressed wi diff --git a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/DeflateError.html b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/DeflateError.html index ea0483a8..b9075084 100644 --- a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/DeflateError.html +++ b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/DeflateError.html @@ -8,6 +8,9 @@ + + + @@ -20,7 +23,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

    + +

    +

    + +

    @@ -122,6 +131,9 @@

    + @@ -188,7 +200,7 @@ It may indicate that either the data is damaged or it might not be compressed wi @@ -222,7 +234,7 @@ It may indicate that either the data is damaged or it might not be compressed wi @@ -256,7 +268,7 @@ It may indicate that either the data is damaged or it might not be compressed wi @@ -290,7 +302,7 @@ It may indicate that either the data is damaged or it might not be compressed wi @@ -304,7 +316,7 @@ It may indicate that either the data is damaged or it might not be compressed wi diff --git a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/GzipError.html b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/GzipError.html index 4fe4bfda..a0b1e514 100644 --- a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/GzipError.html +++ b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/GzipError.html @@ -8,6 +8,9 @@ + + + @@ -20,7 +23,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

    + +

    +

    + +

    @@ -122,6 +131,9 @@

    + @@ -192,7 +204,7 @@ Associated value contains already decompressed data. @@ -226,7 +238,7 @@ Associated value contains already decompressed data. @@ -260,7 +272,7 @@ Associated value contains already decompressed data. @@ -294,7 +306,7 @@ Associated value contains already decompressed data. @@ -329,7 +341,7 @@ Associated value contains already decompressed data.

    @@ -363,7 +375,7 @@ Associated value contains already decompressed data.

    @@ -377,7 +389,7 @@ Associated value contains already decompressed data.

    diff --git a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/LZMA2Error.html b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/LZMA2Error.html index bd30c240..9d450f1c 100644 --- a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/LZMA2Error.html +++ b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/LZMA2Error.html @@ -8,6 +8,9 @@ + + + @@ -20,7 +23,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

    + +

    +

    + +

    @@ -122,6 +131,9 @@

    + @@ -189,7 +201,7 @@ It may indicate that either the data is damaged or it might not be compressed wi @@ -223,7 +235,7 @@ It may indicate that either the data is damaged or it might not be compressed wi @@ -257,7 +269,7 @@ It may indicate that either the data is damaged or it might not be compressed wi @@ -291,7 +303,7 @@ It may indicate that either the data is damaged or it might not be compressed wi @@ -326,7 +338,7 @@ amount of compressed data read was different from the one stored in LZMA2 packet @@ -340,7 +352,7 @@ amount of compressed data read was different from the one stored in LZMA2 packet diff --git a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/LZMAError.html b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/LZMAError.html index 44158bbf..f50e7e33 100644 --- a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/LZMAError.html +++ b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/LZMAError.html @@ -8,6 +8,9 @@ + + + @@ -20,7 +23,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

    + +

    +

    + +

    @@ -122,6 +131,9 @@

    + @@ -194,7 +206,7 @@ than the repeat length. @@ -228,7 +240,7 @@ than the repeat length. @@ -262,7 +274,7 @@ than the repeat length. @@ -296,7 +308,7 @@ than the repeat length. @@ -330,7 +342,7 @@ than the repeat length. @@ -364,7 +376,7 @@ than the repeat length. @@ -398,7 +410,7 @@ than the repeat length. @@ -412,7 +424,7 @@ than the repeat length. diff --git a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/XZError.html b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/XZError.html index 864608ca..bc14e588 100644 --- a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/XZError.html +++ b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/XZError.html @@ -8,6 +8,9 @@ + + + @@ -20,7 +23,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

    + +

    +

    + +

    @@ -122,6 +131,9 @@

    + @@ -196,7 +208,7 @@ Associated value contains already decompressed data. @@ -230,7 +242,7 @@ Associated value contains already decompressed data. @@ -264,7 +276,7 @@ Associated value contains already decompressed data. @@ -298,7 +310,7 @@ Associated value contains already decompressed data. @@ -332,7 +344,7 @@ Associated value contains already decompressed data. @@ -366,7 +378,7 @@ Associated value contains already decompressed data. @@ -401,7 +413,7 @@ amount of compressed data read was different from the one stored in block header @@ -436,7 +448,7 @@ Associated value contains already decompressed data.

    @@ -470,7 +482,7 @@ Associated value contains already decompressed data.

    @@ -504,7 +516,7 @@ Associated value contains already decompressed data.

    @@ -518,7 +530,7 @@ Associated value contains already decompressed data.

    diff --git a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/ZipError.html b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/ZipError.html index 7bb1976a..0ea33993 100644 --- a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/ZipError.html +++ b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/ZipError.html @@ -8,6 +8,9 @@ + + + @@ -20,7 +23,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

    + +

    +

    + +

    @@ -122,6 +131,9 @@

    + @@ -195,7 +207,7 @@ It may indicate that either the data is damaged or it might not be ZIP archive ( @@ -229,7 +241,7 @@ It may indicate that either the data is damaged or it might not be ZIP archive ( @@ -263,7 +275,7 @@ It may indicate that either the data is damaged or it might not be ZIP archive ( @@ -297,7 +309,7 @@ It may indicate that either the data is damaged or it might not be ZIP archive ( @@ -331,7 +343,7 @@ It may indicate that either the data is damaged or it might not be ZIP archive ( @@ -365,7 +377,7 @@ It may indicate that either the data is damaged or it might not be ZIP archive ( @@ -399,7 +411,7 @@ It may indicate that either the data is damaged or it might not be ZIP archive ( @@ -433,7 +445,7 @@ It may indicate that either the data is damaged or it might not be ZIP archive ( @@ -467,7 +479,7 @@ It may indicate that either the data is damaged or it might not be ZIP archive ( @@ -501,7 +513,7 @@ It may indicate that either the data is damaged or it might not be ZIP archive ( @@ -515,7 +527,7 @@ It may indicate that either the data is damaged or it might not be ZIP archive ( diff --git a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/ZlibError.html b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/ZlibError.html index 707dd6c3..df3bfae5 100644 --- a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/ZlibError.html +++ b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Enums/ZlibError.html @@ -8,6 +8,9 @@ + + + @@ -20,7 +23,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

    + +

    +

    + +

    @@ -122,6 +131,9 @@

    + @@ -190,7 +202,7 @@ Associated value contains already decompressed data. @@ -224,7 +236,7 @@ Associated value contains already decompressed data. @@ -258,7 +270,7 @@ Associated value contains already decompressed data. @@ -292,7 +304,7 @@ Associated value contains already decompressed data. @@ -327,7 +339,7 @@ Associated value contains already decompressed data.

    @@ -341,7 +353,7 @@ Associated value contains already decompressed data.

    diff --git a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Protocols.html b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Protocols.html index c1fa9c82..d174c2ba 100644 --- a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Protocols.html +++ b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Protocols.html @@ -8,6 +8,9 @@ + + + @@ -19,7 +22,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

    + +

    +

    + +

    @@ -121,6 +130,9 @@

    + @@ -174,7 +186,7 @@ @@ -205,7 +217,7 @@ @@ -219,7 +231,7 @@ diff --git a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Protocols/Archive.html b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Protocols/Archive.html index 84a991bd..a50f2b7f 100644 --- a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Protocols/Archive.html +++ b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Protocols/Archive.html @@ -8,6 +8,9 @@ + + + @@ -20,7 +23,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

    + +

    +

    + +

    @@ -122,6 +131,9 @@

    + @@ -180,7 +192,7 @@ @@ -194,7 +206,7 @@ diff --git a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Protocols/DecompressionAlgorithm.html b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Protocols/DecompressionAlgorithm.html index d325c541..c178a387 100644 --- a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Protocols/DecompressionAlgorithm.html +++ b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Protocols/DecompressionAlgorithm.html @@ -8,6 +8,9 @@ + + + @@ -20,7 +23,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

    + +

    +

    + +

    @@ -122,6 +131,9 @@

    + @@ -180,7 +192,7 @@ @@ -194,7 +206,7 @@ diff --git a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Structs.html b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Structs.html index 4af3de12..947f4b95 100644 --- a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Structs.html +++ b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Structs.html @@ -8,6 +8,9 @@ + + + @@ -19,7 +22,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

    + +

    +

    + +

    @@ -121,6 +130,9 @@

    + @@ -174,7 +186,34 @@ + + + + + +
    +
    @@ -223,7 +262,7 @@ diff --git a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/GzipHeader.html b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/GzipHeader.html index b8746b3d..b8dbe7a6 100644 --- a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/GzipHeader.html +++ b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/GzipHeader.html @@ -8,6 +8,9 @@ + + + @@ -20,7 +23,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

    + +

    +

    + +

    @@ -122,6 +131,9 @@

    + @@ -181,7 +193,7 @@ @@ -212,7 +224,7 @@ @@ -242,7 +254,7 @@ @@ -272,7 +284,7 @@ @@ -302,7 +314,7 @@ @@ -332,7 +344,7 @@ @@ -362,7 +374,7 @@ @@ -384,12 +396,6 @@

    If data passed is not actually a gzip archive, GzipError will be thrown.

    -
    -

    Parameter

    -

    Parameter archiveData: Data compressed with gzip.

    - -
    -

    Throws

    GzipError. It may indicate that either the data is damaged or @@ -427,7 +433,7 @@ it might not be compressed with gzip at all.

    @@ -441,7 +447,7 @@ it might not be compressed with gzip at all.

    diff --git a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/GzipHeader/CompressionMethod.html b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/GzipHeader/CompressionMethod.html index 203fa4c1..02bba75c 100644 --- a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/GzipHeader/CompressionMethod.html +++ b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/GzipHeader/CompressionMethod.html @@ -8,6 +8,9 @@ + + + @@ -20,7 +23,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

    + +

    +

    + +

    @@ -122,6 +131,9 @@

    + @@ -180,7 +192,7 @@ @@ -194,7 +206,7 @@ diff --git a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/GzipHeader/FileSystemType.html b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/GzipHeader/FileSystemType.html index 59859573..b00b30c9 100644 --- a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/GzipHeader/FileSystemType.html +++ b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/GzipHeader/FileSystemType.html @@ -8,6 +8,9 @@ + + + @@ -20,7 +23,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

    + +

    +

    + +

    @@ -122,6 +131,9 @@

    + @@ -180,7 +192,7 @@ @@ -214,7 +226,7 @@ @@ -248,7 +260,7 @@ @@ -282,7 +294,7 @@ @@ -316,7 +328,7 @@ @@ -330,7 +342,7 @@ diff --git a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/ZipEntry.html b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/ZipEntry.html new file mode 100644 index 00000000..e8539550 --- /dev/null +++ b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/ZipEntry.html @@ -0,0 +1,243 @@ + + + + ZipEntry Struct Reference + + + + + + + + + + + + + + + + +
    +

    + + SWCompression Docs + + (93% documented) +

    + +

    +

    + +
    +

    + +

    + + + View on GitHub + +

    + +
    + + + +
    + + +
    + + + + diff --git a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/ZlibHeader.html b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/ZlibHeader.html index ea7ac348..1306fbf0 100644 --- a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/ZlibHeader.html +++ b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/ZlibHeader.html @@ -8,6 +8,9 @@ + + + @@ -20,7 +23,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

    + +

    +

    + +

    @@ -122,6 +131,9 @@

    + @@ -181,7 +193,7 @@ @@ -212,7 +224,7 @@ @@ -242,7 +254,7 @@ @@ -272,7 +284,7 @@ @@ -302,7 +314,7 @@ @@ -324,12 +336,6 @@

    If data passed is not actually a zlib archive, ZlibError will be thrown.

    -
    -

    Parameter

    -

    Parameter archiveData: Data compressed with zlib.

    - -
    -

    Throws

    ZlibError. It may indicate that either the data is damaged or @@ -367,7 +373,7 @@ it might not be compressed with zlib at all.

    @@ -381,7 +387,7 @@ it might not be compressed with zlib at all.

    diff --git a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/ZlibHeader/CompressionLevel.html b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/ZlibHeader/CompressionLevel.html index b0ed94fa..98fbc913 100644 --- a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/ZlibHeader/CompressionLevel.html +++ b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/ZlibHeader/CompressionLevel.html @@ -8,6 +8,9 @@ + + + @@ -20,7 +23,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

    + +

    +

    + +

    @@ -122,6 +131,9 @@

    + @@ -180,7 +192,7 @@ @@ -214,7 +226,7 @@ @@ -248,7 +260,7 @@ @@ -282,7 +294,7 @@ @@ -296,7 +308,7 @@ diff --git a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/ZlibHeader/CompressionMethod.html b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/ZlibHeader/CompressionMethod.html index 21086040..7fa29476 100644 --- a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/ZlibHeader/CompressionMethod.html +++ b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/Structs/ZlibHeader/CompressionMethod.html @@ -8,6 +8,9 @@ + + + @@ -20,7 +23,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

    + +

    +

    + +

    @@ -122,6 +131,9 @@

    + @@ -180,7 +192,7 @@ @@ -194,7 +206,7 @@ diff --git a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/css/jazzy.css b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/css/jazzy.css index 75b54333..c83db5bf 100644 --- a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/css/jazzy.css +++ b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/css/jazzy.css @@ -327,3 +327,42 @@ html.dash .header, html.dash .breadcrumbs, html.dash .navigation { display: none; } html.dash .height-container { display: block; } + +form[role=search] input { + font: 16px/1.7 "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; + line-height: 24px; + padding: 0 10px; + margin: 0; + border: none; + border-radius: 1em; } + .loading form[role=search] input { + background: white url(../img/spinner.gif) center right 4px no-repeat; } +form[role=search] .tt-menu { + margin: 0; + min-width: 300px; + background: #fbfbfb; + color: #333; + border: 1px solid #ddd; } +form[role=search] .tt-highlight { + font-weight: bold; } +form[role=search] .tt-suggestion { + font: 16px/1.7 "Helvetica Neue", Helvetica, Arial, sans-serif; + padding: 0 8px; } + form[role=search] .tt-suggestion span { + display: table-cell; + white-space: nowrap; } + form[role=search] .tt-suggestion .doc-parent-name { + width: 100%; + text-align: right; + font-weight: normal; + font-size: 0.9em; + padding-left: 16px; } +form[role=search] .tt-suggestion:hover, +form[role=search] .tt-suggestion.tt-cursor { + cursor: pointer; + background-color: #4183c4; + color: #fff; } +form[role=search] .tt-suggestion:hover .doc-parent-name, +form[role=search] .tt-suggestion.tt-cursor .doc-parent-name { + color: #fff; } diff --git a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/img/spinner.gif b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/img/spinner.gif new file mode 100644 index 00000000..e3038d0a Binary files /dev/null and b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/img/spinner.gif differ diff --git a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/index.html b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/index.html index 23e1202d..51987387 100644 --- a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/index.html +++ b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/index.html @@ -8,6 +8,9 @@ + + + @@ -19,7 +22,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

    + +

    +

    + +

    @@ -121,6 +130,9 @@

    + @@ -330,7 +342,7 @@ so some difference in speed is expected.

    diff --git a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/js/jazzy.js b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/js/jazzy.js index e2b491dc..009c80d3 100755 --- a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/js/jazzy.js +++ b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/js/jazzy.js @@ -35,3 +35,9 @@ $(".token").click(function(event) { } event.preventDefault(); }); + +// Dumb down quotes within code blocks that delimit strings instead of quotations +// https://github.com/realm/jazzy/issues/714 +$("code q").replaceWith(function () { + return ["\"", $(this).contents(), "\""]; +}); diff --git a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/js/jazzy.search.js b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/js/jazzy.search.js new file mode 100644 index 00000000..54be83cf --- /dev/null +++ b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/js/jazzy.search.js @@ -0,0 +1,62 @@ +$(function(){ + var searchIndex = lunr(function() { + this.ref('url'); + this.field('name'); + }); + + var $typeahead = $('[data-typeahead]'); + var $form = $typeahead.parents('form'); + var searchURL = $form.attr('action'); + + function displayTemplate(result) { + return result.name; + } + + function suggestionTemplate(result) { + var t = '
    '; + t += '' + result.name + ''; + if (result.parent_name) { + t += '' + result.parent_name + ''; + } + t += '
    '; + return t; + } + + $typeahead.one('focus', function() { + $form.addClass('loading'); + + $.getJSON(searchURL).then(function(searchData) { + $.each(searchData, function (url, doc) { + searchIndex.add({url: url, name: doc.name}); + }); + + $typeahead.typeahead( + { + highlight: true, + minLength: 3 + }, + { + limit: 10, + display: displayTemplate, + templates: { suggestion: suggestionTemplate }, + source: function(query, sync) { + var results = searchIndex.search(query).map(function(result) { + var doc = searchData[result.ref]; + doc.url = result.ref; + return doc; + }); + sync(results); + } + } + ); + $form.removeClass('loading'); + $typeahead.trigger('focus'); + }); + }); + + var baseURL = searchURL.slice(0, -"search.json".length); + + $typeahead.on('typeahead:select', function(e, result) { + window.location = baseURL + result.url; + }); +}); diff --git a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/js/lunr.min.js b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/js/lunr.min.js new file mode 100755 index 00000000..22776bb8 --- /dev/null +++ b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/js/lunr.min.js @@ -0,0 +1,6 @@ +/** + * lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 0.7.2 + * Copyright (C) 2016 Oliver Nightingale + * @license MIT + */ +!function(){var t=function(e){var n=new t.Index;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),e&&e.call(n,n),n};t.version="0.7.2",t.utils={},t.utils.warn=function(t){return function(e){t.console&&console.warn&&console.warn(e)}}(this),t.utils.asString=function(t){return void 0===t||null===t?"":t.toString()},t.EventEmitter=function(){this.events={}},t.EventEmitter.prototype.addListener=function(){var t=Array.prototype.slice.call(arguments),e=t.pop(),n=t;if("function"!=typeof e)throw new TypeError("last argument must be a function");n.forEach(function(t){this.hasHandler(t)||(this.events[t]=[]),this.events[t].push(e)},this)},t.EventEmitter.prototype.removeListener=function(t,e){if(this.hasHandler(t)){var n=this.events[t].indexOf(e);this.events[t].splice(n,1),this.events[t].length||delete this.events[t]}},t.EventEmitter.prototype.emit=function(t){if(this.hasHandler(t)){var e=Array.prototype.slice.call(arguments,1);this.events[t].forEach(function(t){t.apply(void 0,e)})}},t.EventEmitter.prototype.hasHandler=function(t){return t in this.events},t.tokenizer=function(e){if(!arguments.length||null==e||void 0==e)return[];if(Array.isArray(e))return e.map(function(e){return t.utils.asString(e).toLowerCase()});var n=t.tokenizer.seperator||t.tokenizer.separator;return e.toString().trim().toLowerCase().split(n)},t.tokenizer.seperator=!1,t.tokenizer.separator=/[\s\-]+/,t.tokenizer.load=function(t){var e=this.registeredFunctions[t];if(!e)throw new Error("Cannot load un-registered function: "+t);return e},t.tokenizer.label="default",t.tokenizer.registeredFunctions={"default":t.tokenizer},t.tokenizer.registerFunction=function(e,n){n in this.registeredFunctions&&t.utils.warn("Overwriting existing tokenizer: "+n),e.label=n,this.registeredFunctions[n]=e},t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions={},t.Pipeline.registerFunction=function(e,n){n in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(e){var i=t.Pipeline.registeredFunctions[e];if(!i)throw new Error("Cannot load un-registered function: "+e);n.add(i)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(e){t.Pipeline.warnIfFunctionNotRegistered(e),this._stack.push(e)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var i=this._stack.indexOf(e);if(-1==i)throw new Error("Cannot find existingFn");i+=1,this._stack.splice(i,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var i=this._stack.indexOf(e);if(-1==i)throw new Error("Cannot find existingFn");this._stack.splice(i,0,n)},t.Pipeline.prototype.remove=function(t){var e=this._stack.indexOf(t);-1!=e&&this._stack.splice(e,1)},t.Pipeline.prototype.run=function(t){for(var e=[],n=t.length,i=this._stack.length,r=0;n>r;r++){for(var o=t[r],s=0;i>s&&(o=this._stack[s](o,r,t),void 0!==o&&""!==o);s++);void 0!==o&&""!==o&&e.push(o)}return e},t.Pipeline.prototype.reset=function(){this._stack=[]},t.Pipeline.prototype.toJSON=function(){return this._stack.map(function(e){return t.Pipeline.warnIfFunctionNotRegistered(e),e.label})},t.Vector=function(){this._magnitude=null,this.list=void 0,this.length=0},t.Vector.Node=function(t,e,n){this.idx=t,this.val=e,this.next=n},t.Vector.prototype.insert=function(e,n){this._magnitude=void 0;var i=this.list;if(!i)return this.list=new t.Vector.Node(e,n,i),this.length++;if(en.idx?n=n.next:(i+=e.val*n.val,e=e.next,n=n.next);return i},t.Vector.prototype.similarity=function(t){return this.dot(t)/(this.magnitude()*t.magnitude())},t.SortedSet=function(){this.length=0,this.elements=[]},t.SortedSet.load=function(t){var e=new this;return e.elements=t,e.length=t.length,e},t.SortedSet.prototype.add=function(){var t,e;for(t=0;t1;){if(o===t)return r;t>o&&(e=r),o>t&&(n=r),i=n-e,r=e+Math.floor(i/2),o=this.elements[r]}return o===t?r:-1},t.SortedSet.prototype.locationFor=function(t){for(var e=0,n=this.elements.length,i=n-e,r=e+Math.floor(i/2),o=this.elements[r];i>1;)t>o&&(e=r),o>t&&(n=r),i=n-e,r=e+Math.floor(i/2),o=this.elements[r];return o>t?r:t>o?r+1:void 0},t.SortedSet.prototype.intersect=function(e){for(var n=new t.SortedSet,i=0,r=0,o=this.length,s=e.length,a=this.elements,h=e.elements;;){if(i>o-1||r>s-1)break;a[i]!==h[r]?a[i]h[r]&&r++:(n.add(a[i]),i++,r++)}return n},t.SortedSet.prototype.clone=function(){var e=new t.SortedSet;return e.elements=this.toArray(),e.length=e.elements.length,e},t.SortedSet.prototype.union=function(t){var e,n,i;this.length>=t.length?(e=this,n=t):(e=t,n=this),i=e.clone();for(var r=0,o=n.toArray();rp;p++)c[p]===a&&d++;h+=d/f*l.boost}}this.tokenStore.add(a,{ref:o,tf:h})}n&&this.eventEmitter.emit("add",e,this)},t.Index.prototype.remove=function(t,e){var n=t[this._ref],e=void 0===e?!0:e;if(this.documentStore.has(n)){var i=this.documentStore.get(n);this.documentStore.remove(n),i.forEach(function(t){this.tokenStore.remove(t,n)},this),e&&this.eventEmitter.emit("remove",t,this)}},t.Index.prototype.update=function(t,e){var e=void 0===e?!0:e;this.remove(t,!1),this.add(t,!1),e&&this.eventEmitter.emit("update",t,this)},t.Index.prototype.idf=function(t){var e="@"+t;if(Object.prototype.hasOwnProperty.call(this._idfCache,e))return this._idfCache[e];var n=this.tokenStore.count(t),i=1;return n>0&&(i=1+Math.log(this.documentStore.length/n)),this._idfCache[e]=i},t.Index.prototype.search=function(e){var n=this.pipeline.run(this.tokenizerFn(e)),i=new t.Vector,r=[],o=this._fields.reduce(function(t,e){return t+e.boost},0),s=n.some(function(t){return this.tokenStore.has(t)},this);if(!s)return[];n.forEach(function(e,n,s){var a=1/s.length*this._fields.length*o,h=this,u=this.tokenStore.expand(e).reduce(function(n,r){var o=h.corpusTokens.indexOf(r),s=h.idf(r),u=1,l=new t.SortedSet;if(r!==e){var c=Math.max(3,r.length-e.length);u=1/Math.log(c)}o>-1&&i.insert(o,a*s*u);for(var f=h.tokenStore.get(r),d=Object.keys(f),p=d.length,v=0;p>v;v++)l.add(f[d[v]].ref);return n.union(l)},new t.SortedSet);r.push(u)},this);var a=r.reduce(function(t,e){return t.intersect(e)});return a.map(function(t){return{ref:t,score:i.similarity(this.documentVector(t))}},this).sort(function(t,e){return e.score-t.score})},t.Index.prototype.documentVector=function(e){for(var n=this.documentStore.get(e),i=n.length,r=new t.Vector,o=0;i>o;o++){var s=n.elements[o],a=this.tokenStore.get(s)[e].tf,h=this.idf(s);r.insert(this.corpusTokens.indexOf(s),a*h)}return r},t.Index.prototype.toJSON=function(){return{version:t.version,fields:this._fields,ref:this._ref,tokenizer:this.tokenizerFn.label,documentStore:this.documentStore.toJSON(),tokenStore:this.tokenStore.toJSON(),corpusTokens:this.corpusTokens.toJSON(),pipeline:this.pipeline.toJSON()}},t.Index.prototype.use=function(t){var e=Array.prototype.slice.call(arguments,1);e.unshift(this),t.apply(this,e)},t.Store=function(){this.store={},this.length=0},t.Store.load=function(e){var n=new this;return n.length=e.length,n.store=Object.keys(e.store).reduce(function(n,i){return n[i]=t.SortedSet.load(e.store[i]),n},{}),n},t.Store.prototype.set=function(t,e){this.has(t)||this.length++,this.store[t]=e},t.Store.prototype.get=function(t){return this.store[t]},t.Store.prototype.has=function(t){return t in this.store},t.Store.prototype.remove=function(t){this.has(t)&&(delete this.store[t],this.length--)},t.Store.prototype.toJSON=function(){return{store:this.store,length:this.length}},t.stemmer=function(){var t={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},e={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},n="[^aeiou]",i="[aeiouy]",r=n+"[^aeiouy]*",o=i+"[aeiou]*",s="^("+r+")?"+o+r,a="^("+r+")?"+o+r+"("+o+")?$",h="^("+r+")?"+o+r+o+r,u="^("+r+")?"+i,l=new RegExp(s),c=new RegExp(h),f=new RegExp(a),d=new RegExp(u),p=/^(.+?)(ss|i)es$/,v=/^(.+?)([^s])s$/,g=/^(.+?)eed$/,m=/^(.+?)(ed|ing)$/,y=/.$/,S=/(at|bl|iz)$/,w=new RegExp("([^aeiouylsz])\\1$"),k=new RegExp("^"+r+i+"[^aeiouwxy]$"),x=/^(.+?[^aeiou])y$/,b=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,E=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,F=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,_=/^(.+?)(s|t)(ion)$/,z=/^(.+?)e$/,O=/ll$/,P=new RegExp("^"+r+i+"[^aeiouwxy]$"),T=function(n){var i,r,o,s,a,h,u;if(n.length<3)return n;if(o=n.substr(0,1),"y"==o&&(n=o.toUpperCase()+n.substr(1)),s=p,a=v,s.test(n)?n=n.replace(s,"$1$2"):a.test(n)&&(n=n.replace(a,"$1$2")),s=g,a=m,s.test(n)){var T=s.exec(n);s=l,s.test(T[1])&&(s=y,n=n.replace(s,""))}else if(a.test(n)){var T=a.exec(n);i=T[1],a=d,a.test(i)&&(n=i,a=S,h=w,u=k,a.test(n)?n+="e":h.test(n)?(s=y,n=n.replace(s,"")):u.test(n)&&(n+="e"))}if(s=x,s.test(n)){var T=s.exec(n);i=T[1],n=i+"i"}if(s=b,s.test(n)){var T=s.exec(n);i=T[1],r=T[2],s=l,s.test(i)&&(n=i+t[r])}if(s=E,s.test(n)){var T=s.exec(n);i=T[1],r=T[2],s=l,s.test(i)&&(n=i+e[r])}if(s=F,a=_,s.test(n)){var T=s.exec(n);i=T[1],s=c,s.test(i)&&(n=i)}else if(a.test(n)){var T=a.exec(n);i=T[1]+T[2],a=c,a.test(i)&&(n=i)}if(s=z,s.test(n)){var T=s.exec(n);i=T[1],s=c,a=f,h=P,(s.test(i)||a.test(i)&&!h.test(i))&&(n=i)}return s=O,a=c,s.test(n)&&a.test(n)&&(s=y,n=n.replace(s,"")),"y"==o&&(n=o.toLowerCase()+n.substr(1)),n};return T}(),t.Pipeline.registerFunction(t.stemmer,"stemmer"),t.generateStopWordFilter=function(t){var e=t.reduce(function(t,e){return t[e]=e,t},{});return function(t){return t&&e[t]!==t?t:void 0}},t.stopWordFilter=t.generateStopWordFilter(["a","able","about","across","after","all","almost","also","am","among","an","and","any","are","as","at","be","because","been","but","by","can","cannot","could","dear","did","do","does","either","else","ever","every","for","from","get","got","had","has","have","he","her","hers","him","his","how","however","i","if","in","into","is","it","its","just","least","let","like","likely","may","me","might","most","must","my","neither","no","nor","not","of","off","often","on","only","or","other","our","own","rather","said","say","says","she","should","since","so","some","than","that","the","their","them","then","there","these","they","this","tis","to","too","twas","us","wants","was","we","were","what","when","where","which","while","who","whom","why","will","with","would","yet","you","your"]),t.Pipeline.registerFunction(t.stopWordFilter,"stopWordFilter"),t.trimmer=function(t){return t.replace(/^\W+/,"").replace(/\W+$/,"")},t.Pipeline.registerFunction(t.trimmer,"trimmer"),t.TokenStore=function(){this.root={docs:{}},this.length=0},t.TokenStore.load=function(t){var e=new this;return e.root=t.root,e.length=t.length,e},t.TokenStore.prototype.add=function(t,e,n){var n=n||this.root,i=t.charAt(0),r=t.slice(1);return i in n||(n[i]={docs:{}}),0===r.length?(n[i].docs[e.ref]=e,void(this.length+=1)):this.add(r,e,n[i])},t.TokenStore.prototype.has=function(t){if(!t)return!1;for(var e=this.root,n=0;n', + menu: '
    ' + }; + } + function buildSelectors(classes) { + var selectors = {}; + _.each(classes, function(v, k) { + selectors[k] = "." + v; + }); + return selectors; + } + function buildCss() { + var css = { + wrapper: { + position: "relative", + display: "inline-block" + }, + hint: { + position: "absolute", + top: "0", + left: "0", + borderColor: "transparent", + boxShadow: "none", + opacity: "1" + }, + input: { + position: "relative", + verticalAlign: "top", + backgroundColor: "transparent" + }, + inputWithNoHint: { + position: "relative", + verticalAlign: "top" + }, + menu: { + position: "absolute", + top: "100%", + left: "0", + zIndex: "100", + display: "none" + }, + ltr: { + left: "0", + right: "auto" + }, + rtl: { + left: "auto", + right: " 0" + } + }; + if (_.isMsie()) { + _.mixin(css.input, { + backgroundImage: "url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)" + }); + } + return css; + } + }(); + var EventBus = function() { + "use strict"; + var namespace, deprecationMap; + namespace = "typeahead:"; + deprecationMap = { + render: "rendered", + cursorchange: "cursorchanged", + select: "selected", + autocomplete: "autocompleted" + }; + function EventBus(o) { + if (!o || !o.el) { + $.error("EventBus initialized without el"); + } + this.$el = $(o.el); + } + _.mixin(EventBus.prototype, { + _trigger: function(type, args) { + var $e; + $e = $.Event(namespace + type); + (args = args || []).unshift($e); + this.$el.trigger.apply(this.$el, args); + return $e; + }, + before: function(type) { + var args, $e; + args = [].slice.call(arguments, 1); + $e = this._trigger("before" + type, args); + return $e.isDefaultPrevented(); + }, + trigger: function(type) { + var deprecatedType; + this._trigger(type, [].slice.call(arguments, 1)); + if (deprecatedType = deprecationMap[type]) { + this._trigger(deprecatedType, [].slice.call(arguments, 1)); + } + } + }); + return EventBus; + }(); + var EventEmitter = function() { + "use strict"; + var splitter = /\s+/, nextTick = getNextTick(); + return { + onSync: onSync, + onAsync: onAsync, + off: off, + trigger: trigger + }; + function on(method, types, cb, context) { + var type; + if (!cb) { + return this; + } + types = types.split(splitter); + cb = context ? bindContext(cb, context) : cb; + this._callbacks = this._callbacks || {}; + while (type = types.shift()) { + this._callbacks[type] = this._callbacks[type] || { + sync: [], + async: [] + }; + this._callbacks[type][method].push(cb); + } + return this; + } + function onAsync(types, cb, context) { + return on.call(this, "async", types, cb, context); + } + function onSync(types, cb, context) { + return on.call(this, "sync", types, cb, context); + } + function off(types) { + var type; + if (!this._callbacks) { + return this; + } + types = types.split(splitter); + while (type = types.shift()) { + delete this._callbacks[type]; + } + return this; + } + function trigger(types) { + var type, callbacks, args, syncFlush, asyncFlush; + if (!this._callbacks) { + return this; + } + types = types.split(splitter); + args = [].slice.call(arguments, 1); + while ((type = types.shift()) && (callbacks = this._callbacks[type])) { + syncFlush = getFlush(callbacks.sync, this, [ type ].concat(args)); + asyncFlush = getFlush(callbacks.async, this, [ type ].concat(args)); + syncFlush() && nextTick(asyncFlush); + } + return this; + } + function getFlush(callbacks, context, args) { + return flush; + function flush() { + var cancelled; + for (var i = 0, len = callbacks.length; !cancelled && i < len; i += 1) { + cancelled = callbacks[i].apply(context, args) === false; + } + return !cancelled; + } + } + function getNextTick() { + var nextTickFn; + if (window.setImmediate) { + nextTickFn = function nextTickSetImmediate(fn) { + setImmediate(function() { + fn(); + }); + }; + } else { + nextTickFn = function nextTickSetTimeout(fn) { + setTimeout(function() { + fn(); + }, 0); + }; + } + return nextTickFn; + } + function bindContext(fn, context) { + return fn.bind ? fn.bind(context) : function() { + fn.apply(context, [].slice.call(arguments, 0)); + }; + } + }(); + var highlight = function(doc) { + "use strict"; + var defaults = { + node: null, + pattern: null, + tagName: "strong", + className: null, + wordsOnly: false, + caseSensitive: false + }; + return function hightlight(o) { + var regex; + o = _.mixin({}, defaults, o); + if (!o.node || !o.pattern) { + return; + } + o.pattern = _.isArray(o.pattern) ? o.pattern : [ o.pattern ]; + regex = getRegex(o.pattern, o.caseSensitive, o.wordsOnly); + traverse(o.node, hightlightTextNode); + function hightlightTextNode(textNode) { + var match, patternNode, wrapperNode; + if (match = regex.exec(textNode.data)) { + wrapperNode = doc.createElement(o.tagName); + o.className && (wrapperNode.className = o.className); + patternNode = textNode.splitText(match.index); + patternNode.splitText(match[0].length); + wrapperNode.appendChild(patternNode.cloneNode(true)); + textNode.parentNode.replaceChild(wrapperNode, patternNode); + } + return !!match; + } + function traverse(el, hightlightTextNode) { + var childNode, TEXT_NODE_TYPE = 3; + for (var i = 0; i < el.childNodes.length; i++) { + childNode = el.childNodes[i]; + if (childNode.nodeType === TEXT_NODE_TYPE) { + i += hightlightTextNode(childNode) ? 1 : 0; + } else { + traverse(childNode, hightlightTextNode); + } + } + } + }; + function getRegex(patterns, caseSensitive, wordsOnly) { + var escapedPatterns = [], regexStr; + for (var i = 0, len = patterns.length; i < len; i++) { + escapedPatterns.push(_.escapeRegExChars(patterns[i])); + } + regexStr = wordsOnly ? "\\b(" + escapedPatterns.join("|") + ")\\b" : "(" + escapedPatterns.join("|") + ")"; + return caseSensitive ? new RegExp(regexStr) : new RegExp(regexStr, "i"); + } + }(window.document); + var Input = function() { + "use strict"; + var specialKeyCodeMap; + specialKeyCodeMap = { + 9: "tab", + 27: "esc", + 37: "left", + 39: "right", + 13: "enter", + 38: "up", + 40: "down" + }; + function Input(o, www) { + o = o || {}; + if (!o.input) { + $.error("input is missing"); + } + www.mixin(this); + this.$hint = $(o.hint); + this.$input = $(o.input); + this.query = this.$input.val(); + this.queryWhenFocused = this.hasFocus() ? this.query : null; + this.$overflowHelper = buildOverflowHelper(this.$input); + this._checkLanguageDirection(); + if (this.$hint.length === 0) { + this.setHint = this.getHint = this.clearHint = this.clearHintIfInvalid = _.noop; + } + } + Input.normalizeQuery = function(str) { + return _.toStr(str).replace(/^\s*/g, "").replace(/\s{2,}/g, " "); + }; + _.mixin(Input.prototype, EventEmitter, { + _onBlur: function onBlur() { + this.resetInputValue(); + this.trigger("blurred"); + }, + _onFocus: function onFocus() { + this.queryWhenFocused = this.query; + this.trigger("focused"); + }, + _onKeydown: function onKeydown($e) { + var keyName = specialKeyCodeMap[$e.which || $e.keyCode]; + this._managePreventDefault(keyName, $e); + if (keyName && this._shouldTrigger(keyName, $e)) { + this.trigger(keyName + "Keyed", $e); + } + }, + _onInput: function onInput() { + this._setQuery(this.getInputValue()); + this.clearHintIfInvalid(); + this._checkLanguageDirection(); + }, + _managePreventDefault: function managePreventDefault(keyName, $e) { + var preventDefault; + switch (keyName) { + case "up": + case "down": + preventDefault = !withModifier($e); + break; + + default: + preventDefault = false; + } + preventDefault && $e.preventDefault(); + }, + _shouldTrigger: function shouldTrigger(keyName, $e) { + var trigger; + switch (keyName) { + case "tab": + trigger = !withModifier($e); + break; + + default: + trigger = true; + } + return trigger; + }, + _checkLanguageDirection: function checkLanguageDirection() { + var dir = (this.$input.css("direction") || "ltr").toLowerCase(); + if (this.dir !== dir) { + this.dir = dir; + this.$hint.attr("dir", dir); + this.trigger("langDirChanged", dir); + } + }, + _setQuery: function setQuery(val, silent) { + var areEquivalent, hasDifferentWhitespace; + areEquivalent = areQueriesEquivalent(val, this.query); + hasDifferentWhitespace = areEquivalent ? this.query.length !== val.length : false; + this.query = val; + if (!silent && !areEquivalent) { + this.trigger("queryChanged", this.query); + } else if (!silent && hasDifferentWhitespace) { + this.trigger("whitespaceChanged", this.query); + } + }, + bind: function() { + var that = this, onBlur, onFocus, onKeydown, onInput; + onBlur = _.bind(this._onBlur, this); + onFocus = _.bind(this._onFocus, this); + onKeydown = _.bind(this._onKeydown, this); + onInput = _.bind(this._onInput, this); + this.$input.on("blur.tt", onBlur).on("focus.tt", onFocus).on("keydown.tt", onKeydown); + if (!_.isMsie() || _.isMsie() > 9) { + this.$input.on("input.tt", onInput); + } else { + this.$input.on("keydown.tt keypress.tt cut.tt paste.tt", function($e) { + if (specialKeyCodeMap[$e.which || $e.keyCode]) { + return; + } + _.defer(_.bind(that._onInput, that, $e)); + }); + } + return this; + }, + focus: function focus() { + this.$input.focus(); + }, + blur: function blur() { + this.$input.blur(); + }, + getLangDir: function getLangDir() { + return this.dir; + }, + getQuery: function getQuery() { + return this.query || ""; + }, + setQuery: function setQuery(val, silent) { + this.setInputValue(val); + this._setQuery(val, silent); + }, + hasQueryChangedSinceLastFocus: function hasQueryChangedSinceLastFocus() { + return this.query !== this.queryWhenFocused; + }, + getInputValue: function getInputValue() { + return this.$input.val(); + }, + setInputValue: function setInputValue(value) { + this.$input.val(value); + this.clearHintIfInvalid(); + this._checkLanguageDirection(); + }, + resetInputValue: function resetInputValue() { + this.setInputValue(this.query); + }, + getHint: function getHint() { + return this.$hint.val(); + }, + setHint: function setHint(value) { + this.$hint.val(value); + }, + clearHint: function clearHint() { + this.setHint(""); + }, + clearHintIfInvalid: function clearHintIfInvalid() { + var val, hint, valIsPrefixOfHint, isValid; + val = this.getInputValue(); + hint = this.getHint(); + valIsPrefixOfHint = val !== hint && hint.indexOf(val) === 0; + isValid = val !== "" && valIsPrefixOfHint && !this.hasOverflow(); + !isValid && this.clearHint(); + }, + hasFocus: function hasFocus() { + return this.$input.is(":focus"); + }, + hasOverflow: function hasOverflow() { + var constraint = this.$input.width() - 2; + this.$overflowHelper.text(this.getInputValue()); + return this.$overflowHelper.width() >= constraint; + }, + isCursorAtEnd: function() { + var valueLength, selectionStart, range; + valueLength = this.$input.val().length; + selectionStart = this.$input[0].selectionStart; + if (_.isNumber(selectionStart)) { + return selectionStart === valueLength; + } else if (document.selection) { + range = document.selection.createRange(); + range.moveStart("character", -valueLength); + return valueLength === range.text.length; + } + return true; + }, + destroy: function destroy() { + this.$hint.off(".tt"); + this.$input.off(".tt"); + this.$overflowHelper.remove(); + this.$hint = this.$input = this.$overflowHelper = $("
    "); + } + }); + return Input; + function buildOverflowHelper($input) { + return $('').css({ + position: "absolute", + visibility: "hidden", + whiteSpace: "pre", + fontFamily: $input.css("font-family"), + fontSize: $input.css("font-size"), + fontStyle: $input.css("font-style"), + fontVariant: $input.css("font-variant"), + fontWeight: $input.css("font-weight"), + wordSpacing: $input.css("word-spacing"), + letterSpacing: $input.css("letter-spacing"), + textIndent: $input.css("text-indent"), + textRendering: $input.css("text-rendering"), + textTransform: $input.css("text-transform") + }).insertAfter($input); + } + function areQueriesEquivalent(a, b) { + return Input.normalizeQuery(a) === Input.normalizeQuery(b); + } + function withModifier($e) { + return $e.altKey || $e.ctrlKey || $e.metaKey || $e.shiftKey; + } + }(); + var Dataset = function() { + "use strict"; + var keys, nameGenerator; + keys = { + val: "tt-selectable-display", + obj: "tt-selectable-object" + }; + nameGenerator = _.getIdGenerator(); + function Dataset(o, www) { + o = o || {}; + o.templates = o.templates || {}; + o.templates.notFound = o.templates.notFound || o.templates.empty; + if (!o.source) { + $.error("missing source"); + } + if (!o.node) { + $.error("missing node"); + } + if (o.name && !isValidName(o.name)) { + $.error("invalid dataset name: " + o.name); + } + www.mixin(this); + this.highlight = !!o.highlight; + this.name = o.name || nameGenerator(); + this.limit = o.limit || 5; + this.displayFn = getDisplayFn(o.display || o.displayKey); + this.templates = getTemplates(o.templates, this.displayFn); + this.source = o.source.__ttAdapter ? o.source.__ttAdapter() : o.source; + this.async = _.isUndefined(o.async) ? this.source.length > 2 : !!o.async; + this._resetLastSuggestion(); + this.$el = $(o.node).addClass(this.classes.dataset).addClass(this.classes.dataset + "-" + this.name); + } + Dataset.extractData = function extractData(el) { + var $el = $(el); + if ($el.data(keys.obj)) { + return { + val: $el.data(keys.val) || "", + obj: $el.data(keys.obj) || null + }; + } + return null; + }; + _.mixin(Dataset.prototype, EventEmitter, { + _overwrite: function overwrite(query, suggestions) { + suggestions = suggestions || []; + if (suggestions.length) { + this._renderSuggestions(query, suggestions); + } else if (this.async && this.templates.pending) { + this._renderPending(query); + } else if (!this.async && this.templates.notFound) { + this._renderNotFound(query); + } else { + this._empty(); + } + this.trigger("rendered", this.name, suggestions, false); + }, + _append: function append(query, suggestions) { + suggestions = suggestions || []; + if (suggestions.length && this.$lastSuggestion.length) { + this._appendSuggestions(query, suggestions); + } else if (suggestions.length) { + this._renderSuggestions(query, suggestions); + } else if (!this.$lastSuggestion.length && this.templates.notFound) { + this._renderNotFound(query); + } + this.trigger("rendered", this.name, suggestions, true); + }, + _renderSuggestions: function renderSuggestions(query, suggestions) { + var $fragment; + $fragment = this._getSuggestionsFragment(query, suggestions); + this.$lastSuggestion = $fragment.children().last(); + this.$el.html($fragment).prepend(this._getHeader(query, suggestions)).append(this._getFooter(query, suggestions)); + }, + _appendSuggestions: function appendSuggestions(query, suggestions) { + var $fragment, $lastSuggestion; + $fragment = this._getSuggestionsFragment(query, suggestions); + $lastSuggestion = $fragment.children().last(); + this.$lastSuggestion.after($fragment); + this.$lastSuggestion = $lastSuggestion; + }, + _renderPending: function renderPending(query) { + var template = this.templates.pending; + this._resetLastSuggestion(); + template && this.$el.html(template({ + query: query, + dataset: this.name + })); + }, + _renderNotFound: function renderNotFound(query) { + var template = this.templates.notFound; + this._resetLastSuggestion(); + template && this.$el.html(template({ + query: query, + dataset: this.name + })); + }, + _empty: function empty() { + this.$el.empty(); + this._resetLastSuggestion(); + }, + _getSuggestionsFragment: function getSuggestionsFragment(query, suggestions) { + var that = this, fragment; + fragment = document.createDocumentFragment(); + _.each(suggestions, function getSuggestionNode(suggestion) { + var $el, context; + context = that._injectQuery(query, suggestion); + $el = $(that.templates.suggestion(context)).data(keys.obj, suggestion).data(keys.val, that.displayFn(suggestion)).addClass(that.classes.suggestion + " " + that.classes.selectable); + fragment.appendChild($el[0]); + }); + this.highlight && highlight({ + className: this.classes.highlight, + node: fragment, + pattern: query + }); + return $(fragment); + }, + _getFooter: function getFooter(query, suggestions) { + return this.templates.footer ? this.templates.footer({ + query: query, + suggestions: suggestions, + dataset: this.name + }) : null; + }, + _getHeader: function getHeader(query, suggestions) { + return this.templates.header ? this.templates.header({ + query: query, + suggestions: suggestions, + dataset: this.name + }) : null; + }, + _resetLastSuggestion: function resetLastSuggestion() { + this.$lastSuggestion = $(); + }, + _injectQuery: function injectQuery(query, obj) { + return _.isObject(obj) ? _.mixin({ + _query: query + }, obj) : obj; + }, + update: function update(query) { + var that = this, canceled = false, syncCalled = false, rendered = 0; + this.cancel(); + this.cancel = function cancel() { + canceled = true; + that.cancel = $.noop; + that.async && that.trigger("asyncCanceled", query); + }; + this.source(query, sync, async); + !syncCalled && sync([]); + function sync(suggestions) { + if (syncCalled) { + return; + } + syncCalled = true; + suggestions = (suggestions || []).slice(0, that.limit); + rendered = suggestions.length; + that._overwrite(query, suggestions); + if (rendered < that.limit && that.async) { + that.trigger("asyncRequested", query); + } + } + function async(suggestions) { + suggestions = suggestions || []; + if (!canceled && rendered < that.limit) { + that.cancel = $.noop; + rendered += suggestions.length; + that._append(query, suggestions.slice(0, that.limit - rendered)); + that.async && that.trigger("asyncReceived", query); + } + } + }, + cancel: $.noop, + clear: function clear() { + this._empty(); + this.cancel(); + this.trigger("cleared"); + }, + isEmpty: function isEmpty() { + return this.$el.is(":empty"); + }, + destroy: function destroy() { + this.$el = $("
    "); + } + }); + return Dataset; + function getDisplayFn(display) { + display = display || _.stringify; + return _.isFunction(display) ? display : displayFn; + function displayFn(obj) { + return obj[display]; + } + } + function getTemplates(templates, displayFn) { + return { + notFound: templates.notFound && _.templatify(templates.notFound), + pending: templates.pending && _.templatify(templates.pending), + header: templates.header && _.templatify(templates.header), + footer: templates.footer && _.templatify(templates.footer), + suggestion: templates.suggestion || suggestionTemplate + }; + function suggestionTemplate(context) { + return $("
    ").text(displayFn(context)); + } + } + function isValidName(str) { + return /^[_a-zA-Z0-9-]+$/.test(str); + } + }(); + var Menu = function() { + "use strict"; + function Menu(o, www) { + var that = this; + o = o || {}; + if (!o.node) { + $.error("node is required"); + } + www.mixin(this); + this.$node = $(o.node); + this.query = null; + this.datasets = _.map(o.datasets, initializeDataset); + function initializeDataset(oDataset) { + var node = that.$node.find(oDataset.node).first(); + oDataset.node = node.length ? node : $("
    ").appendTo(that.$node); + return new Dataset(oDataset, www); + } + } + _.mixin(Menu.prototype, EventEmitter, { + _onSelectableClick: function onSelectableClick($e) { + this.trigger("selectableClicked", $($e.currentTarget)); + }, + _onRendered: function onRendered(type, dataset, suggestions, async) { + this.$node.toggleClass(this.classes.empty, this._allDatasetsEmpty()); + this.trigger("datasetRendered", dataset, suggestions, async); + }, + _onCleared: function onCleared() { + this.$node.toggleClass(this.classes.empty, this._allDatasetsEmpty()); + this.trigger("datasetCleared"); + }, + _propagate: function propagate() { + this.trigger.apply(this, arguments); + }, + _allDatasetsEmpty: function allDatasetsEmpty() { + return _.every(this.datasets, isDatasetEmpty); + function isDatasetEmpty(dataset) { + return dataset.isEmpty(); + } + }, + _getSelectables: function getSelectables() { + return this.$node.find(this.selectors.selectable); + }, + _removeCursor: function _removeCursor() { + var $selectable = this.getActiveSelectable(); + $selectable && $selectable.removeClass(this.classes.cursor); + }, + _ensureVisible: function ensureVisible($el) { + var elTop, elBottom, nodeScrollTop, nodeHeight; + elTop = $el.position().top; + elBottom = elTop + $el.outerHeight(true); + nodeScrollTop = this.$node.scrollTop(); + nodeHeight = this.$node.height() + parseInt(this.$node.css("paddingTop"), 10) + parseInt(this.$node.css("paddingBottom"), 10); + if (elTop < 0) { + this.$node.scrollTop(nodeScrollTop + elTop); + } else if (nodeHeight < elBottom) { + this.$node.scrollTop(nodeScrollTop + (elBottom - nodeHeight)); + } + }, + bind: function() { + var that = this, onSelectableClick; + onSelectableClick = _.bind(this._onSelectableClick, this); + this.$node.on("click.tt", this.selectors.selectable, onSelectableClick); + _.each(this.datasets, function(dataset) { + dataset.onSync("asyncRequested", that._propagate, that).onSync("asyncCanceled", that._propagate, that).onSync("asyncReceived", that._propagate, that).onSync("rendered", that._onRendered, that).onSync("cleared", that._onCleared, that); + }); + return this; + }, + isOpen: function isOpen() { + return this.$node.hasClass(this.classes.open); + }, + open: function open() { + this.$node.addClass(this.classes.open); + }, + close: function close() { + this.$node.removeClass(this.classes.open); + this._removeCursor(); + }, + setLanguageDirection: function setLanguageDirection(dir) { + this.$node.attr("dir", dir); + }, + selectableRelativeToCursor: function selectableRelativeToCursor(delta) { + var $selectables, $oldCursor, oldIndex, newIndex; + $oldCursor = this.getActiveSelectable(); + $selectables = this._getSelectables(); + oldIndex = $oldCursor ? $selectables.index($oldCursor) : -1; + newIndex = oldIndex + delta; + newIndex = (newIndex + 1) % ($selectables.length + 1) - 1; + newIndex = newIndex < -1 ? $selectables.length - 1 : newIndex; + return newIndex === -1 ? null : $selectables.eq(newIndex); + }, + setCursor: function setCursor($selectable) { + this._removeCursor(); + if ($selectable = $selectable && $selectable.first()) { + $selectable.addClass(this.classes.cursor); + this._ensureVisible($selectable); + } + }, + getSelectableData: function getSelectableData($el) { + return $el && $el.length ? Dataset.extractData($el) : null; + }, + getActiveSelectable: function getActiveSelectable() { + var $selectable = this._getSelectables().filter(this.selectors.cursor).first(); + return $selectable.length ? $selectable : null; + }, + getTopSelectable: function getTopSelectable() { + var $selectable = this._getSelectables().first(); + return $selectable.length ? $selectable : null; + }, + update: function update(query) { + var isValidUpdate = query !== this.query; + if (isValidUpdate) { + this.query = query; + _.each(this.datasets, updateDataset); + } + return isValidUpdate; + function updateDataset(dataset) { + dataset.update(query); + } + }, + empty: function empty() { + _.each(this.datasets, clearDataset); + this.query = null; + this.$node.addClass(this.classes.empty); + function clearDataset(dataset) { + dataset.clear(); + } + }, + destroy: function destroy() { + this.$node.off(".tt"); + this.$node = $("
    "); + _.each(this.datasets, destroyDataset); + function destroyDataset(dataset) { + dataset.destroy(); + } + } + }); + return Menu; + }(); + var DefaultMenu = function() { + "use strict"; + var s = Menu.prototype; + function DefaultMenu() { + Menu.apply(this, [].slice.call(arguments, 0)); + } + _.mixin(DefaultMenu.prototype, Menu.prototype, { + open: function open() { + !this._allDatasetsEmpty() && this._show(); + return s.open.apply(this, [].slice.call(arguments, 0)); + }, + close: function close() { + this._hide(); + return s.close.apply(this, [].slice.call(arguments, 0)); + }, + _onRendered: function onRendered() { + if (this._allDatasetsEmpty()) { + this._hide(); + } else { + this.isOpen() && this._show(); + } + return s._onRendered.apply(this, [].slice.call(arguments, 0)); + }, + _onCleared: function onCleared() { + if (this._allDatasetsEmpty()) { + this._hide(); + } else { + this.isOpen() && this._show(); + } + return s._onCleared.apply(this, [].slice.call(arguments, 0)); + }, + setLanguageDirection: function setLanguageDirection(dir) { + this.$node.css(dir === "ltr" ? this.css.ltr : this.css.rtl); + return s.setLanguageDirection.apply(this, [].slice.call(arguments, 0)); + }, + _hide: function hide() { + this.$node.hide(); + }, + _show: function show() { + this.$node.css("display", "block"); + } + }); + return DefaultMenu; + }(); + var Typeahead = function() { + "use strict"; + function Typeahead(o, www) { + var onFocused, onBlurred, onEnterKeyed, onTabKeyed, onEscKeyed, onUpKeyed, onDownKeyed, onLeftKeyed, onRightKeyed, onQueryChanged, onWhitespaceChanged; + o = o || {}; + if (!o.input) { + $.error("missing input"); + } + if (!o.menu) { + $.error("missing menu"); + } + if (!o.eventBus) { + $.error("missing event bus"); + } + www.mixin(this); + this.eventBus = o.eventBus; + this.minLength = _.isNumber(o.minLength) ? o.minLength : 1; + this.input = o.input; + this.menu = o.menu; + this.enabled = true; + this.active = false; + this.input.hasFocus() && this.activate(); + this.dir = this.input.getLangDir(); + this._hacks(); + this.menu.bind().onSync("selectableClicked", this._onSelectableClicked, this).onSync("asyncRequested", this._onAsyncRequested, this).onSync("asyncCanceled", this._onAsyncCanceled, this).onSync("asyncReceived", this._onAsyncReceived, this).onSync("datasetRendered", this._onDatasetRendered, this).onSync("datasetCleared", this._onDatasetCleared, this); + onFocused = c(this, "activate", "open", "_onFocused"); + onBlurred = c(this, "deactivate", "_onBlurred"); + onEnterKeyed = c(this, "isActive", "isOpen", "_onEnterKeyed"); + onTabKeyed = c(this, "isActive", "isOpen", "_onTabKeyed"); + onEscKeyed = c(this, "isActive", "_onEscKeyed"); + onUpKeyed = c(this, "isActive", "open", "_onUpKeyed"); + onDownKeyed = c(this, "isActive", "open", "_onDownKeyed"); + onLeftKeyed = c(this, "isActive", "isOpen", "_onLeftKeyed"); + onRightKeyed = c(this, "isActive", "isOpen", "_onRightKeyed"); + onQueryChanged = c(this, "_openIfActive", "_onQueryChanged"); + onWhitespaceChanged = c(this, "_openIfActive", "_onWhitespaceChanged"); + this.input.bind().onSync("focused", onFocused, this).onSync("blurred", onBlurred, this).onSync("enterKeyed", onEnterKeyed, this).onSync("tabKeyed", onTabKeyed, this).onSync("escKeyed", onEscKeyed, this).onSync("upKeyed", onUpKeyed, this).onSync("downKeyed", onDownKeyed, this).onSync("leftKeyed", onLeftKeyed, this).onSync("rightKeyed", onRightKeyed, this).onSync("queryChanged", onQueryChanged, this).onSync("whitespaceChanged", onWhitespaceChanged, this).onSync("langDirChanged", this._onLangDirChanged, this); + } + _.mixin(Typeahead.prototype, { + _hacks: function hacks() { + var $input, $menu; + $input = this.input.$input || $("
    "); + $menu = this.menu.$node || $("
    "); + $input.on("blur.tt", function($e) { + var active, isActive, hasActive; + active = document.activeElement; + isActive = $menu.is(active); + hasActive = $menu.has(active).length > 0; + if (_.isMsie() && (isActive || hasActive)) { + $e.preventDefault(); + $e.stopImmediatePropagation(); + _.defer(function() { + $input.focus(); + }); + } + }); + $menu.on("mousedown.tt", function($e) { + $e.preventDefault(); + }); + }, + _onSelectableClicked: function onSelectableClicked(type, $el) { + this.select($el); + }, + _onDatasetCleared: function onDatasetCleared() { + this._updateHint(); + }, + _onDatasetRendered: function onDatasetRendered(type, dataset, suggestions, async) { + this._updateHint(); + this.eventBus.trigger("render", suggestions, async, dataset); + }, + _onAsyncRequested: function onAsyncRequested(type, dataset, query) { + this.eventBus.trigger("asyncrequest", query, dataset); + }, + _onAsyncCanceled: function onAsyncCanceled(type, dataset, query) { + this.eventBus.trigger("asynccancel", query, dataset); + }, + _onAsyncReceived: function onAsyncReceived(type, dataset, query) { + this.eventBus.trigger("asyncreceive", query, dataset); + }, + _onFocused: function onFocused() { + this._minLengthMet() && this.menu.update(this.input.getQuery()); + }, + _onBlurred: function onBlurred() { + if (this.input.hasQueryChangedSinceLastFocus()) { + this.eventBus.trigger("change", this.input.getQuery()); + } + }, + _onEnterKeyed: function onEnterKeyed(type, $e) { + var $selectable; + if ($selectable = this.menu.getActiveSelectable()) { + this.select($selectable) && $e.preventDefault(); + } + }, + _onTabKeyed: function onTabKeyed(type, $e) { + var $selectable; + if ($selectable = this.menu.getActiveSelectable()) { + this.select($selectable) && $e.preventDefault(); + } else if ($selectable = this.menu.getTopSelectable()) { + this.autocomplete($selectable) && $e.preventDefault(); + } + }, + _onEscKeyed: function onEscKeyed() { + this.close(); + }, + _onUpKeyed: function onUpKeyed() { + this.moveCursor(-1); + }, + _onDownKeyed: function onDownKeyed() { + this.moveCursor(+1); + }, + _onLeftKeyed: function onLeftKeyed() { + if (this.dir === "rtl" && this.input.isCursorAtEnd()) { + this.autocomplete(this.menu.getTopSelectable()); + } + }, + _onRightKeyed: function onRightKeyed() { + if (this.dir === "ltr" && this.input.isCursorAtEnd()) { + this.autocomplete(this.menu.getTopSelectable()); + } + }, + _onQueryChanged: function onQueryChanged(e, query) { + this._minLengthMet(query) ? this.menu.update(query) : this.menu.empty(); + }, + _onWhitespaceChanged: function onWhitespaceChanged() { + this._updateHint(); + }, + _onLangDirChanged: function onLangDirChanged(e, dir) { + if (this.dir !== dir) { + this.dir = dir; + this.menu.setLanguageDirection(dir); + } + }, + _openIfActive: function openIfActive() { + this.isActive() && this.open(); + }, + _minLengthMet: function minLengthMet(query) { + query = _.isString(query) ? query : this.input.getQuery() || ""; + return query.length >= this.minLength; + }, + _updateHint: function updateHint() { + var $selectable, data, val, query, escapedQuery, frontMatchRegEx, match; + $selectable = this.menu.getTopSelectable(); + data = this.menu.getSelectableData($selectable); + val = this.input.getInputValue(); + if (data && !_.isBlankString(val) && !this.input.hasOverflow()) { + query = Input.normalizeQuery(val); + escapedQuery = _.escapeRegExChars(query); + frontMatchRegEx = new RegExp("^(?:" + escapedQuery + ")(.+$)", "i"); + match = frontMatchRegEx.exec(data.val); + match && this.input.setHint(val + match[1]); + } else { + this.input.clearHint(); + } + }, + isEnabled: function isEnabled() { + return this.enabled; + }, + enable: function enable() { + this.enabled = true; + }, + disable: function disable() { + this.enabled = false; + }, + isActive: function isActive() { + return this.active; + }, + activate: function activate() { + if (this.isActive()) { + return true; + } else if (!this.isEnabled() || this.eventBus.before("active")) { + return false; + } else { + this.active = true; + this.eventBus.trigger("active"); + return true; + } + }, + deactivate: function deactivate() { + if (!this.isActive()) { + return true; + } else if (this.eventBus.before("idle")) { + return false; + } else { + this.active = false; + this.close(); + this.eventBus.trigger("idle"); + return true; + } + }, + isOpen: function isOpen() { + return this.menu.isOpen(); + }, + open: function open() { + if (!this.isOpen() && !this.eventBus.before("open")) { + this.menu.open(); + this._updateHint(); + this.eventBus.trigger("open"); + } + return this.isOpen(); + }, + close: function close() { + if (this.isOpen() && !this.eventBus.before("close")) { + this.menu.close(); + this.input.clearHint(); + this.input.resetInputValue(); + this.eventBus.trigger("close"); + } + return !this.isOpen(); + }, + setVal: function setVal(val) { + this.input.setQuery(_.toStr(val)); + }, + getVal: function getVal() { + return this.input.getQuery(); + }, + select: function select($selectable) { + var data = this.menu.getSelectableData($selectable); + if (data && !this.eventBus.before("select", data.obj)) { + this.input.setQuery(data.val, true); + this.eventBus.trigger("select", data.obj); + this.close(); + return true; + } + return false; + }, + autocomplete: function autocomplete($selectable) { + var query, data, isValid; + query = this.input.getQuery(); + data = this.menu.getSelectableData($selectable); + isValid = data && query !== data.val; + if (isValid && !this.eventBus.before("autocomplete", data.obj)) { + this.input.setQuery(data.val); + this.eventBus.trigger("autocomplete", data.obj); + return true; + } + return false; + }, + moveCursor: function moveCursor(delta) { + var query, $candidate, data, payload, cancelMove; + query = this.input.getQuery(); + $candidate = this.menu.selectableRelativeToCursor(delta); + data = this.menu.getSelectableData($candidate); + payload = data ? data.obj : null; + cancelMove = this._minLengthMet() && this.menu.update(query); + if (!cancelMove && !this.eventBus.before("cursorchange", payload)) { + this.menu.setCursor($candidate); + if (data) { + this.input.setInputValue(data.val); + } else { + this.input.resetInputValue(); + this._updateHint(); + } + this.eventBus.trigger("cursorchange", payload); + return true; + } + return false; + }, + destroy: function destroy() { + this.input.destroy(); + this.menu.destroy(); + } + }); + return Typeahead; + function c(ctx) { + var methods = [].slice.call(arguments, 1); + return function() { + var args = [].slice.call(arguments); + _.each(methods, function(method) { + return ctx[method].apply(ctx, args); + }); + }; + } + }(); + (function() { + "use strict"; + var old, keys, methods; + old = $.fn.typeahead; + keys = { + www: "tt-www", + attrs: "tt-attrs", + typeahead: "tt-typeahead" + }; + methods = { + initialize: function initialize(o, datasets) { + var www; + datasets = _.isArray(datasets) ? datasets : [].slice.call(arguments, 1); + o = o || {}; + www = WWW(o.classNames); + return this.each(attach); + function attach() { + var $input, $wrapper, $hint, $menu, defaultHint, defaultMenu, eventBus, input, menu, typeahead, MenuConstructor; + _.each(datasets, function(d) { + d.highlight = !!o.highlight; + }); + $input = $(this); + $wrapper = $(www.html.wrapper); + $hint = $elOrNull(o.hint); + $menu = $elOrNull(o.menu); + defaultHint = o.hint !== false && !$hint; + defaultMenu = o.menu !== false && !$menu; + defaultHint && ($hint = buildHintFromInput($input, www)); + defaultMenu && ($menu = $(www.html.menu).css(www.css.menu)); + $hint && $hint.val(""); + $input = prepInput($input, www); + if (defaultHint || defaultMenu) { + $wrapper.css(www.css.wrapper); + $input.css(defaultHint ? www.css.input : www.css.inputWithNoHint); + $input.wrap($wrapper).parent().prepend(defaultHint ? $hint : null).append(defaultMenu ? $menu : null); + } + MenuConstructor = defaultMenu ? DefaultMenu : Menu; + eventBus = new EventBus({ + el: $input + }); + input = new Input({ + hint: $hint, + input: $input + }, www); + menu = new MenuConstructor({ + node: $menu, + datasets: datasets + }, www); + typeahead = new Typeahead({ + input: input, + menu: menu, + eventBus: eventBus, + minLength: o.minLength + }, www); + $input.data(keys.www, www); + $input.data(keys.typeahead, typeahead); + } + }, + isEnabled: function isEnabled() { + var enabled; + ttEach(this.first(), function(t) { + enabled = t.isEnabled(); + }); + return enabled; + }, + enable: function enable() { + ttEach(this, function(t) { + t.enable(); + }); + return this; + }, + disable: function disable() { + ttEach(this, function(t) { + t.disable(); + }); + return this; + }, + isActive: function isActive() { + var active; + ttEach(this.first(), function(t) { + active = t.isActive(); + }); + return active; + }, + activate: function activate() { + ttEach(this, function(t) { + t.activate(); + }); + return this; + }, + deactivate: function deactivate() { + ttEach(this, function(t) { + t.deactivate(); + }); + return this; + }, + isOpen: function isOpen() { + var open; + ttEach(this.first(), function(t) { + open = t.isOpen(); + }); + return open; + }, + open: function open() { + ttEach(this, function(t) { + t.open(); + }); + return this; + }, + close: function close() { + ttEach(this, function(t) { + t.close(); + }); + return this; + }, + select: function select(el) { + var success = false, $el = $(el); + ttEach(this.first(), function(t) { + success = t.select($el); + }); + return success; + }, + autocomplete: function autocomplete(el) { + var success = false, $el = $(el); + ttEach(this.first(), function(t) { + success = t.autocomplete($el); + }); + return success; + }, + moveCursor: function moveCursoe(delta) { + var success = false; + ttEach(this.first(), function(t) { + success = t.moveCursor(delta); + }); + return success; + }, + val: function val(newVal) { + var query; + if (!arguments.length) { + ttEach(this.first(), function(t) { + query = t.getVal(); + }); + return query; + } else { + ttEach(this, function(t) { + t.setVal(newVal); + }); + return this; + } + }, + destroy: function destroy() { + ttEach(this, function(typeahead, $input) { + revert($input); + typeahead.destroy(); + }); + return this; + } + }; + $.fn.typeahead = function(method) { + if (methods[method]) { + return methods[method].apply(this, [].slice.call(arguments, 1)); + } else { + return methods.initialize.apply(this, arguments); + } + }; + $.fn.typeahead.noConflict = function noConflict() { + $.fn.typeahead = old; + return this; + }; + function ttEach($els, fn) { + $els.each(function() { + var $input = $(this), typeahead; + (typeahead = $input.data(keys.typeahead)) && fn(typeahead, $input); + }); + } + function buildHintFromInput($input, www) { + return $input.clone().addClass(www.classes.hint).removeData().css(www.css.hint).css(getBackgroundStyles($input)).prop("readonly", true).removeAttr("id name placeholder required").attr({ + autocomplete: "off", + spellcheck: "false", + tabindex: -1 + }); + } + function prepInput($input, www) { + $input.data(keys.attrs, { + dir: $input.attr("dir"), + autocomplete: $input.attr("autocomplete"), + spellcheck: $input.attr("spellcheck"), + style: $input.attr("style") + }); + $input.addClass(www.classes.input).attr({ + autocomplete: "off", + spellcheck: false + }); + try { + !$input.attr("dir") && $input.attr("dir", "auto"); + } catch (e) {} + return $input; + } + function getBackgroundStyles($el) { + return { + backgroundAttachment: $el.css("background-attachment"), + backgroundClip: $el.css("background-clip"), + backgroundColor: $el.css("background-color"), + backgroundImage: $el.css("background-image"), + backgroundOrigin: $el.css("background-origin"), + backgroundPosition: $el.css("background-position"), + backgroundRepeat: $el.css("background-repeat"), + backgroundSize: $el.css("background-size") + }; + } + function revert($input) { + var www, $wrapper; + www = $input.data(keys.www); + $wrapper = $input.parent().filter(www.selectors.wrapper); + _.each($input.data(keys.attrs), function(val, key) { + _.isUndefined(val) ? $input.removeAttr(key) : $input.attr(key, val); + }); + $input.removeData(keys.typeahead).removeData(keys.www).removeData(keys.attr).removeClass(www.classes.input); + if ($wrapper.length) { + $input.detach().insertAfter($wrapper); + $wrapper.remove(); + } + } + function $elOrNull(obj) { + var isValid, $el; + isValid = _.isJQuery(obj) || _.isElement(obj); + $el = isValid ? $(obj).first() : []; + return $el.length ? $el : null; + } + })(); +}); \ No newline at end of file diff --git a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/search.json b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/search.json new file mode 100644 index 00000000..6c9f1b12 --- /dev/null +++ b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/search.json @@ -0,0 +1 @@ +{"Structs/ZlibHeader/CompressionLevel.html#/s:FOV13SWCompression10ZlibHeader16CompressionLevel16fastestAlgorithmFMS1_S1_":{"name":"fastestAlgorithm","abstract":"

    Fastest algorithm.

    ","parent_name":"CompressionLevel"},"Structs/ZlibHeader/CompressionLevel.html#/s:FOV13SWCompression10ZlibHeader16CompressionLevel13fastAlgorithmFMS1_S1_":{"name":"fastAlgorithm","abstract":"

    Fast algorithm.

    ","parent_name":"CompressionLevel"},"Structs/ZlibHeader/CompressionLevel.html#/s:FOV13SWCompression10ZlibHeader16CompressionLevel16defaultAlgorithmFMS1_S1_":{"name":"defaultAlgorithm","abstract":"

    Default algorithm.

    ","parent_name":"CompressionLevel"},"Structs/ZlibHeader/CompressionLevel.html#/s:FOV13SWCompression10ZlibHeader16CompressionLevel13slowAlgorithmFMS1_S1_":{"name":"slowAlgorithm","abstract":"

    Slowest algorithm but with maximum compression.

    ","parent_name":"CompressionLevel"},"Structs/ZlibHeader/CompressionMethod.html#/s:FOV13SWCompression10ZlibHeader17CompressionMethod7deflateFMS1_S1_":{"name":"deflate","abstract":"

    The only one supported compression method (Deflate).

    ","parent_name":"CompressionMethod"},"Structs/ZlibHeader/CompressionMethod.html":{"name":"CompressionMethod","abstract":"

    Supported compression methods in zlib archive.

    ","parent_name":"ZlibHeader"},"Structs/ZlibHeader/CompressionLevel.html":{"name":"CompressionLevel","abstract":"

    Levels of compression which can be used to create zlib archive.

    ","parent_name":"ZlibHeader"},"Structs/ZlibHeader.html#/s:vV13SWCompression10ZlibHeader17compressionMethodOS0_17CompressionMethod":{"name":"compressionMethod","abstract":"

    Compression method of archive. Always equals to .deflate.

    ","parent_name":"ZlibHeader"},"Structs/ZlibHeader.html#/s:vV13SWCompression10ZlibHeader16compressionLevelOS0_16CompressionLevel":{"name":"compressionLevel","abstract":"

    Level of compression in the archive.

    ","parent_name":"ZlibHeader"},"Structs/ZlibHeader.html#/s:vV13SWCompression10ZlibHeader10windowSizeSi":{"name":"windowSize","abstract":"

    Size of ‘window’: moving interval of data which was used to make the archive

    ","parent_name":"ZlibHeader"},"Structs/ZlibHeader.html#/s:FV13SWCompression10ZlibHeadercFzT11archiveDataV10Foundation4Data_S0_":{"name":"init(archiveData:)","abstract":"

    Initializes the structure with the values from zlib archive presented in archiveData.

    ","parent_name":"ZlibHeader"},"Structs/ZipEntry.html#/s:vV13SWCompression8ZipEntry8fileNameGSqSS_":{"name":"fileName","abstract":"Undocumented","parent_name":"ZipEntry"},"Structs/ZipEntry.html#/s:vV13SWCompression8ZipEntry11fileCommentGSqSS_":{"name":"fileComment","abstract":"Undocumented","parent_name":"ZipEntry"},"Structs/ZipEntry.html#/s:vV13SWCompression8ZipEntry14fileAttributesVs6UInt32":{"name":"fileAttributes","abstract":"Undocumented","parent_name":"ZipEntry"},"Structs/GzipHeader/FileSystemType.html#/s:FOV13SWCompression10GzipHeader14FileSystemType4unixFMS1_S1_":{"name":"unix","abstract":"

    One of many Linux systems. (It seems like modern macOS systems also fall into this category).

    ","parent_name":"FileSystemType"},"Structs/GzipHeader/FileSystemType.html#/s:FOV13SWCompression10GzipHeader14FileSystemType9macintoshFMS1_S1_":{"name":"macintosh","abstract":"

    Older Macintosh (Mac OS, OS X) systems.

    ","parent_name":"FileSystemType"},"Structs/GzipHeader/FileSystemType.html#/s:FOV13SWCompression10GzipHeader14FileSystemType4ntfsFMS1_S1_":{"name":"ntfs","abstract":"

    File system used in Microsoft™®© Windows™®©.

    ","parent_name":"FileSystemType"},"Structs/GzipHeader/FileSystemType.html#/s:FOV13SWCompression10GzipHeader14FileSystemType7unknownFMS1_S1_":{"name":"unknown","abstract":"

    File system was unknown to the archiver.

    ","parent_name":"FileSystemType"},"Structs/GzipHeader/FileSystemType.html#/s:FOV13SWCompression10GzipHeader14FileSystemType5otherFMS1_S1_":{"name":"other","abstract":"

    File system was one of the rare systems..

    ","parent_name":"FileSystemType"},"Structs/GzipHeader/CompressionMethod.html#/s:FOV13SWCompression10GzipHeader17CompressionMethod7deflateFMS1_S1_":{"name":"deflate","abstract":"

    The only one supported compression method (Deflate).

    ","parent_name":"CompressionMethod"},"Structs/GzipHeader/CompressionMethod.html":{"name":"CompressionMethod","abstract":"

    Supported compression methods in gzip archive.

    ","parent_name":"GzipHeader"},"Structs/GzipHeader/FileSystemType.html":{"name":"FileSystemType","abstract":"

    Type of file system on which gzip archive was created.

    ","parent_name":"GzipHeader"},"Structs/GzipHeader.html#/s:vV13SWCompression10GzipHeader17compressionMethodOS0_17CompressionMethod":{"name":"compressionMethod","abstract":"

    Compression method of archive. Always equals to .deflate.

    ","parent_name":"GzipHeader"},"Structs/GzipHeader.html#/s:vV13SWCompression10GzipHeader16modificationTimeV10Foundation4Date":{"name":"modificationTime","abstract":"

    The most recent modification time of the original file.

    ","parent_name":"GzipHeader"},"Structs/GzipHeader.html#/s:vV13SWCompression10GzipHeader6osTypeOS0_14FileSystemType":{"name":"osType","abstract":"

    Type of file system on which compression took place.

    ","parent_name":"GzipHeader"},"Structs/GzipHeader.html#/s:vV13SWCompression10GzipHeader16originalFileNameGSqSS_":{"name":"originalFileName","abstract":"

    Name of the original file.

    ","parent_name":"GzipHeader"},"Structs/GzipHeader.html#/s:vV13SWCompression10GzipHeader7commentGSqSS_":{"name":"comment","abstract":"

    Comment inside the archive.

    ","parent_name":"GzipHeader"},"Structs/GzipHeader.html#/s:FV13SWCompression10GzipHeadercFzT11archiveDataV10Foundation4Data_S0_":{"name":"init(archiveData:)","abstract":"

    Initializes the structure with the values of first ‘member’ in gzip archive presented in archiveData.

    ","parent_name":"GzipHeader"},"Structs/GzipHeader.html":{"name":"GzipHeader","abstract":"

    A structure which provides information about gzip archive.

    "},"Structs/ZipEntry.html":{"name":"ZipEntry","abstract":"Undocumented"},"Structs/ZlibHeader.html":{"name":"ZlibHeader","abstract":"

    A structure which provides information about zlib archive.

    "},"Protocols/DecompressionAlgorithm.html#/s:ZFP13SWCompression22DecompressionAlgorithm10decompressFzT14compressedDataV10Foundation4Data_S2_":{"name":"decompress(compressedData:)","abstract":"

    Abstract decompress function.

    ","parent_name":"DecompressionAlgorithm"},"Protocols/Archive.html#/s:ZFP13SWCompression7Archive9unarchiveFzT11archiveDataV10Foundation4Data_S2_":{"name":"unarchive(archiveData:)","abstract":"

    Abstract unarchive function.

    ","parent_name":"Archive"},"Protocols/Archive.html":{"name":"Archive","abstract":"

    Abstract archive class which supports unarchiving.

    "},"Protocols/DecompressionAlgorithm.html":{"name":"DecompressionAlgorithm","abstract":"

    Abstract decompression algorithm class which supports decompression.

    "},"Enums/XZError.html#/s:FO13SWCompression7XZError10WrongMagicFMS0_S0_":{"name":"WrongMagic","abstract":"

    Either magic number in header or footer was not equal to predefined value.

    ","parent_name":"XZError"},"Enums/XZError.html#/s:FO13SWCompression7XZError16WrongArchiveInfoFMS0_S0_":{"name":"WrongArchiveInfo","abstract":"

    One of special fields of archive had an incorrect value.

    ","parent_name":"XZError"},"Enums/XZError.html#/s:FO13SWCompression7XZError18FieldReservedValueFMS0_S0_":{"name":"FieldReservedValue","abstract":"

    One of special fields of archive had a reserved value.

    ","parent_name":"XZError"},"Enums/XZError.html#/s:FO13SWCompression7XZError12WrongInfoCRCFMS0_S0_":{"name":"WrongInfoCRC","abstract":"

    Checksum of one of special fields of archive was incorrect.

    ","parent_name":"XZError"},"Enums/XZError.html#/s:FO13SWCompression7XZError13WrongFilterIDFMS0_S0_":{"name":"WrongFilterID","abstract":"

    ID of filter(s) used in archvie was unsupported.

    ","parent_name":"XZError"},"Enums/XZError.html#/s:FO13SWCompression7XZError15CheckTypeSHA256FMS0_S0_":{"name":"CheckTypeSHA256","abstract":"

    Type of checksum of archive was SHA-256.

    ","parent_name":"XZError"},"Enums/XZError.html#/s:FO13SWCompression7XZError13WrongDataSizeFMS0_S0_":{"name":"WrongDataSize","abstract":"

    Either size of decompressed data was not equal to specified one in block header or","parent_name":"XZError"},"Enums/XZError.html#/s:FO13SWCompression7XZError10WrongCheckFMS0_FV10Foundation4DataS0_":{"name":"WrongCheck","abstract":"

    Computed checksum of uncompressed data didn’t match the value stored in the archive.","parent_name":"XZError"},"Enums/XZError.html#/s:FO13SWCompression7XZError12WrongPaddingFMS0_S0_":{"name":"WrongPadding","abstract":"

    Unsupported padding of a structure in the archive.

    ","parent_name":"XZError"},"Enums/XZError.html#/s:FO13SWCompression7XZError21MultiByteIntegerErrorFMS0_S0_":{"name":"MultiByteIntegerError","abstract":"

    Either null byte encountered or exceeded maximum amount bytes during reading multi byte number.

    ","parent_name":"XZError"},"Enums/BZip2Error.html#/s:FO13SWCompression10BZip2Error10WrongMagicFMS0_S0_":{"name":"WrongMagic","abstract":"

    Magic number was not 0x425a.

    ","parent_name":"BZip2Error"},"Enums/BZip2Error.html#/s:FO13SWCompression10BZip2Error22WrongCompressionMethodFMS0_S0_":{"name":"WrongCompressionMethod","abstract":"

    Compression method was not type ‘h’ (not Huffman).

    ","parent_name":"BZip2Error"},"Enums/BZip2Error.html#/s:FO13SWCompression10BZip2Error14WrongBlockSizeFMS0_S0_":{"name":"WrongBlockSize","abstract":"

    Unknown block size (not from ‘0’ to ‘9’).

    ","parent_name":"BZip2Error"},"Enums/BZip2Error.html#/s:FO13SWCompression10BZip2Error14WrongBlockTypeFMS0_S0_":{"name":"WrongBlockType","abstract":"

    Unknown block type (was neither ‘pi’ nor ‘sqrt(pi)’).

    ","parent_name":"BZip2Error"},"Enums/BZip2Error.html#/s:FO13SWCompression10BZip2Error15RandomizedBlockFMS0_S0_":{"name":"RandomizedBlock","abstract":"

    Block is randomized.

    ","parent_name":"BZip2Error"},"Enums/BZip2Error.html#/s:FO13SWCompression10BZip2Error18WrongHuffmanGroupsFMS0_S0_":{"name":"WrongHuffmanGroups","abstract":"

    Wrong number of Huffman tables/groups (should be between 2 and 6).

    ","parent_name":"BZip2Error"},"Enums/BZip2Error.html#/s:FO13SWCompression10BZip2Error13WrongSelectorFMS0_S0_":{"name":"WrongSelector","abstract":"

    Selector was greater than total number of Huffman tables/groups.

    ","parent_name":"BZip2Error"},"Enums/BZip2Error.html#/s:FO13SWCompression10BZip2Error22WrongHuffmanLengthCodeFMS0_S0_":{"name":"WrongHuffmanLengthCode","abstract":"

    Wrong code of Huffman length (should be between 0 and 20).

    ","parent_name":"BZip2Error"},"Enums/BZip2Error.html#/s:FO13SWCompression10BZip2Error14SymbolNotFoundFMS0_S0_":{"name":"SymbolNotFound","abstract":"

    Symbol was not found in Huffman tree.

    ","parent_name":"BZip2Error"},"Enums/DeflateError.html#/s:FO13SWCompression12DeflateError29WrongUncompressedBlockLengthsFMS0_S0_":{"name":"WrongUncompressedBlockLengths","abstract":"

    Uncompressed block’ length and nlength bytes were not compatible.

    ","parent_name":"DeflateError"},"Enums/DeflateError.html#/s:FO13SWCompression12DeflateError14WrongBlockTypeFMS0_S0_":{"name":"WrongBlockType","abstract":"

    Unknown block type (not from 0 to 2).

    ","parent_name":"DeflateError"},"Enums/DeflateError.html#/s:FO13SWCompression12DeflateError11WrongSymbolFMS0_S0_":{"name":"WrongSymbol","abstract":"

    Decoded symbol was found in Huffman tree but is unknown.

    ","parent_name":"DeflateError"},"Enums/DeflateError.html#/s:FO13SWCompression12DeflateError14SymbolNotFoundFMS0_S0_":{"name":"SymbolNotFound","abstract":"

    Symbol was not found in Huffman tree.

    ","parent_name":"DeflateError"},"Enums/ZlibError.html#/s:FO13SWCompression9ZlibError22WrongCompressionMethodFMS0_S0_":{"name":"WrongCompressionMethod","abstract":"

    Compression method was other than 8 which is the only supported one.

    ","parent_name":"ZlibError"},"Enums/ZlibError.html#/s:FO13SWCompression9ZlibError20WrongCompressionInfoFMS0_S0_":{"name":"WrongCompressionInfo","abstract":"

    Compression info was greater than 7 which is uncompatible number 8 compression method.

    ","parent_name":"ZlibError"},"Enums/ZlibError.html#/s:FO13SWCompression9ZlibError11WrongFcheckFMS0_S0_":{"name":"WrongFcheck","abstract":"

    First two bytes were inconsistent with each other.

    ","parent_name":"ZlibError"},"Enums/ZlibError.html#/s:FO13SWCompression9ZlibError21WrongCompressionLevelFMS0_S0_":{"name":"WrongCompressionLevel","abstract":"

    Compression level was other than 0, 1, 2, 3.

    ","parent_name":"ZlibError"},"Enums/ZlibError.html#/s:FO13SWCompression9ZlibError12WrongAdler32FMS0_FV10Foundation4DataS0_":{"name":"WrongAdler32","abstract":"

    Computed Adler-32 sum of uncompressed data didn’t match the value stored in the archive.","parent_name":"ZlibError"},"Enums/LZMAError.html#/s:FO13SWCompression9LZMAError15WrongPropertiesFMS0_S0_":{"name":"WrongProperties","abstract":"

    Properties byte was greater than 225.

    ","parent_name":"LZMAError"},"Enums/LZMAError.html#/s:FO13SWCompression9LZMAError21RangeDecoderInitErrorFMS0_S0_":{"name":"RangeDecoderInitError","abstract":"

    Unable to initialize RanderDecorer.

    ","parent_name":"LZMAError"},"Enums/LZMAError.html#/s:FO13SWCompression9LZMAError24ExceededUncompressedSizeFMS0_S0_":{"name":"ExceededUncompressedSize","abstract":"

    The number of uncompressed bytes hit limit in the middle of decoding.

    ","parent_name":"LZMAError"},"Enums/LZMAError.html#/s:FO13SWCompression9LZMAError13WindowIsEmptyFMS0_S0_":{"name":"WindowIsEmpty","abstract":"

    Unable to perfrom repeat-distance decoding because there is nothing to repeat.

    ","parent_name":"LZMAError"},"Enums/LZMAError.html#/s:FO13SWCompression9LZMAError23RangeDecoderFinishErrorFMS0_S0_":{"name":"RangeDecoderFinishError","abstract":"

    End of stream marker is reached, but range decoder is in incorrect state.

    ","parent_name":"LZMAError"},"Enums/LZMAError.html#/s:FO13SWCompression9LZMAError16RepeatWillExceedFMS0_S0_":{"name":"RepeatWillExceed","abstract":"

    The number of bytes to repeat is greater than the amount bytes that is left to decode.

    ","parent_name":"LZMAError"},"Enums/LZMAError.html#/s:FO13SWCompression9LZMAError17NotEnoughToRepeatFMS0_S0_":{"name":"NotEnoughToRepeat","abstract":"

    The amount of already decoded bytes is smaller than repeat length.

    ","parent_name":"LZMAError"},"Enums/ZipError.html#/s:FO13SWCompression8ZipError27NotFoundCentralDirectoryEndFMS0_S0_":{"name":"NotFoundCentralDirectoryEnd","abstract":"

    End of Central Directoty record was not found.

    ","parent_name":"ZipError"},"Enums/ZipError.html#/s:FO13SWCompression8ZipError14WrongSignatureFMS0_S0_":{"name":"WrongSignature","abstract":"

    Wrong signature of one of ZIP container’s structures.

    ","parent_name":"ZipError"},"Enums/ZipError.html#/s:FO13SWCompression8ZipError9WrongSizeFMS0_S0_":{"name":"WrongSize","abstract":"

    Wrong either compressed or uncompressed size of a ZIP container’s entry.

    ","parent_name":"ZipError"},"Enums/ZipError.html#/s:FO13SWCompression8ZipError12WrongVersionFMS0_S0_":{"name":"WrongVersion","abstract":"

    Wrong number of version needed to extract ZIP container.

    ","parent_name":"ZipError"},"Enums/ZipError.html#/s:FO13SWCompression8ZipError24MultiVolumesNotSupportedFMS0_S0_":{"name":"MultiVolumesNotSupported","abstract":"

    Archive either spanned or consists of several volumes. This feature is not supported.

    ","parent_name":"ZipError"},"Enums/ZipError.html#/s:FO13SWCompression8ZipError22EncryptionNotSupportedFMS0_S0_":{"name":"EncryptionNotSupported","abstract":"

    Entry or record is encrypted. This feature is not supported.

    ","parent_name":"ZipError"},"Enums/ZipError.html#/s:FO13SWCompression8ZipError20PatchingNotSupportedFMS0_S0_":{"name":"PatchingNotSupported","abstract":"

    Entry contains patched data. This feature is not supported.

    ","parent_name":"ZipError"},"Enums/ZipError.html#/s:FO13SWCompression8ZipError23CompressionNotSupportedFMS0_S0_":{"name":"CompressionNotSupported","abstract":"

    Wrong compression method of an entry.

    ","parent_name":"ZipError"},"Enums/ZipError.html#/s:FO13SWCompression8ZipError16WrongLocalHeaderFMS0_S0_":{"name":"WrongLocalHeader","abstract":"

    Wrong local header of an entry.

    ","parent_name":"ZipError"},"Enums/ZipError.html#/s:FO13SWCompression8ZipError10WrongCRC32FMS0_S0_":{"name":"WrongCRC32","abstract":"

    Wrong computed CRC32 of an entry.

    ","parent_name":"ZipError"},"Enums/GzipError.html#/s:FO13SWCompression9GzipError10WrongMagicFMS0_S0_":{"name":"WrongMagic","abstract":"

    First two bytes of archive were not 31 and 139.

    ","parent_name":"GzipError"},"Enums/GzipError.html#/s:FO13SWCompression9GzipError22WrongCompressionMethodFMS0_S0_":{"name":"WrongCompressionMethod","abstract":"

    Compression method was other than 8 which is the only supported one.

    ","parent_name":"GzipError"},"Enums/GzipError.html#/s:FO13SWCompression9GzipError10WrongFlagsFMS0_S0_":{"name":"WrongFlags","abstract":"

    Reserved flags bits were not equal to 0.

    ","parent_name":"GzipError"},"Enums/GzipError.html#/s:FO13SWCompression9GzipError14WrongHeaderCRCFMS0_S0_":{"name":"WrongHeaderCRC","abstract":"

    Computed CRC of header didn’t match the value stored in the archive.

    ","parent_name":"GzipError"},"Enums/GzipError.html#/s:FO13SWCompression9GzipError8WrongCRCFMS0_FV10Foundation4DataS0_":{"name":"WrongCRC","abstract":"

    Computed CRC of uncompressed data didn’t match the value stored in the archive.","parent_name":"GzipError"},"Enums/GzipError.html#/s:FO13SWCompression9GzipError10WrongISizeFMS0_S0_":{"name":"WrongISize","abstract":"

    Computed isize didn’t match the value stored in the archive.

    ","parent_name":"GzipError"},"Enums/LZMA2Error.html#/s:FO13SWCompression10LZMA2Error15WrongPropertiesFMS0_S0_":{"name":"WrongProperties","abstract":"

    Reserved bits of LZMA2 properties byte were not equal to zero.

    ","parent_name":"LZMA2Error"},"Enums/LZMA2Error.html#/s:FO13SWCompression10LZMA2Error19WrongDictionarySizeFMS0_S0_":{"name":"WrongDictionarySize","abstract":"

    Dictionary size was too big.

    ","parent_name":"LZMA2Error"},"Enums/LZMA2Error.html#/s:FO13SWCompression10LZMA2Error16WrongControlByteFMS0_S0_":{"name":"WrongControlByte","abstract":"

    Unknown conrol byte value of LZMA2 packet.

    ","parent_name":"LZMA2Error"},"Enums/LZMA2Error.html#/s:FO13SWCompression10LZMA2Error10WrongResetFMS0_S0_":{"name":"WrongReset","abstract":"

    Unknown reset instruction encounetered in LZMA2 packet.

    ","parent_name":"LZMA2Error"},"Enums/LZMA2Error.html#/s:FO13SWCompression10LZMA2Error10WrongSizesFMS0_S0_":{"name":"WrongSizes","abstract":"

    Either size of decompressed data was not equal to specified one in LZMA2 packet or","parent_name":"LZMA2Error"},"Enums/LZMA2Error.html":{"name":"LZMA2Error","abstract":"

    Error happened during LZMA2 decompression."},"Enums/GzipError.html":{"name":"GzipError","abstract":"

    Error happened during unarchiving gzip archive."},"Enums/ZipError.html":{"name":"ZipError","abstract":"

    Error happened during processing ZIP archive (container)."},"Enums/LZMAError.html":{"name":"LZMAError","abstract":"

    Error happened during LZMA decompression."},"Enums/ZlibError.html":{"name":"ZlibError","abstract":"

    Error happened during unarchiving Zlib archive."},"Enums/DeflateError.html":{"name":"DeflateError","abstract":"

    Error happened during deflate decompression."},"Enums/BZip2Error.html":{"name":"BZip2Error","abstract":"

    Error happened during bzip2 decompression."},"Enums/XZError.html":{"name":"XZError","abstract":"

    Error happened during unarchiving XZ archive."},"Classes/XZArchive.html#/s:ZFC13SWCompression9XZArchive9unarchiveFzT11archiveDataV10Foundation4Data_S2_":{"name":"unarchive(archiveData:)","abstract":"

    Unarchives xz archive stored in archiveData.

    ","parent_name":"XZArchive"},"Classes/BZip2.html#/s:ZFC13SWCompression5BZip210decompressFzT14compressedDataV10Foundation4Data_S2_":{"name":"decompress(compressedData:)","abstract":"

    Decompresses compressedData with BZip2 algortihm.

    ","parent_name":"BZip2"},"Classes/Deflate.html#/s:ZFC13SWCompression7Deflate10decompressFzT14compressedDataV10Foundation4Data_S2_":{"name":"decompress(compressedData:)","abstract":"

    Decompresses compressedData with DEFLATE algortihm.

    ","parent_name":"Deflate"},"Classes/Deflate.html#/s:ZFC13SWCompression7Deflate8compressFzT4dataV10Foundation4Data_S2_":{"name":"compress(data:)","abstract":"Undocumented","parent_name":"Deflate"},"Classes/ZlibArchive.html#/s:ZFC13SWCompression11ZlibArchive9unarchiveFzT11archiveDataV10Foundation4Data_S2_":{"name":"unarchive(archiveData:)","abstract":"

    Unarchives Zlib archive stored in archiveData.

    ","parent_name":"ZlibArchive"},"Classes/LZMA.html#/s:ZFC13SWCompression4LZMA10decompressFzT14compressedDataV10Foundation4Data_S2_":{"name":"decompress(compressedData:)","abstract":"

    Decompresses compressedData with LZMA algortihm.

    ","parent_name":"LZMA"},"Classes/ZipContainer.html#/s:vC13SWCompression12ZipContainer7entriesGSaVS_8ZipEntry_":{"name":"entries","abstract":"Undocumented","parent_name":"ZipContainer"},"Classes/ZipContainer.html#/s:FC13SWCompression12ZipContainercFzT13containerDataV10Foundation4Data_S0_":{"name":"init(containerData:)","abstract":"Undocumented","parent_name":"ZipContainer"},"Classes/ZipContainer.html#/s:FC13SWCompression12ZipContainer4dataFzT3forVS_8ZipEntry_V10Foundation4Data":{"name":"data(for:)","abstract":"Undocumented","parent_name":"ZipContainer"},"Classes/ZipContainer.html#/s:ZFC13SWCompression12ZipContainer4openFzT13containerDataV10Foundation4Data_GSaT9entryNameSS9entryDataS2___":{"name":"open(containerData:)","abstract":"

    Processes ZIP archive (container) and returns an array of tuples (String, Data).","parent_name":"ZipContainer"},"Classes/GzipArchive.html#/s:ZFC13SWCompression11GzipArchive9unarchiveFzT11archiveDataV10Foundation4Data_S2_":{"name":"unarchive(archiveData:)","abstract":"

    Unarchives gzip archive stored in archiveData.

    ","parent_name":"GzipArchive"},"Classes/LZMA2.html#/s:ZFC13SWCompression5LZMA210decompressFzT14compressedDataV10Foundation4Data_S2_":{"name":"decompress(compressedData:)","abstract":"

    Decompresses compressedData with LZMA2 algortihm. LZMA2 is a modification of LZMA.

    ","parent_name":"LZMA2"},"Classes/LZMA2.html":{"name":"LZMA2","abstract":"

    Provides function to decompress data, which were compressed with LZMA2

    "},"Classes/GzipArchive.html":{"name":"GzipArchive","abstract":"

    Provides unarchive function for GZip archives.

    "},"Classes/ZipContainer.html":{"name":"ZipContainer","abstract":"

    Provides function to open ZIP archives (containers).

    "},"Classes/LZMA.html":{"name":"LZMA","abstract":"

    Provides function to decompress data, which were compressed with LZMA

    "},"Classes/ZlibArchive.html":{"name":"ZlibArchive","abstract":"

    Provides unarchive function for Zlib archives.

    "},"Classes/Deflate.html":{"name":"Deflate","abstract":"

    Provides function to decompress data, which were compressed with DEFLATE.

    "},"Classes/BZip2.html":{"name":"BZip2","abstract":"

    Provides function to decompress data, which were compressed using BZip2.

    "},"Classes/XZArchive.html":{"name":"XZArchive","abstract":"

    Provides unarchive function for XZ archives.

    "},"Classes.html":{"name":"Classes","abstract":"The following classes are available globally."},"Enums.html":{"name":"Enums","abstract":"The following enums are available globally."},"Protocols.html":{"name":"Protocols","abstract":"The following protocols are available globally."},"Structs.html":{"name":"Structs","abstract":"The following structs are available globally."}} \ No newline at end of file diff --git a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/undocumented.json b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/undocumented.json index 1862018e..704c4204 100644 --- a/docs/docsets/SWCompression.docset/Contents/Resources/Documents/undocumented.json +++ b/docs/docsets/SWCompression.docset/Contents/Resources/Documents/undocumented.json @@ -1,6 +1,61 @@ { "warnings": [ - + { + "file": "/Users/timofeysolomko/Developer/SWCompression/Sources/Deflate.swift", + "line": 228, + "symbol": "Deflate.compress(data:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/timofeysolomko/Developer/SWCompression/Sources/ZipContainer.swift", + "line": 50, + "symbol": "ZipEntry", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/timofeysolomko/Developer/SWCompression/Sources/ZipContainer.swift", + "line": 54, + "symbol": "ZipEntry.fileName", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/timofeysolomko/Developer/SWCompression/Sources/ZipContainer.swift", + "line": 58, + "symbol": "ZipEntry.fileComment", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/timofeysolomko/Developer/SWCompression/Sources/ZipContainer.swift", + "line": 62, + "symbol": "ZipEntry.fileAttributes", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/timofeysolomko/Developer/SWCompression/Sources/ZipContainer.swift", + "line": 77, + "symbol": "ZipContainer.entries", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/timofeysolomko/Developer/SWCompression/Sources/ZipContainer.swift", + "line": 79, + "symbol": "ZipContainer.init(containerData:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/timofeysolomko/Developer/SWCompression/Sources/ZipContainer.swift", + "line": 110, + "symbol": "ZipContainer.data(for:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + } ], "source_directory": "/Users/timofeysolomko/Developer/SWCompression" } \ No newline at end of file diff --git a/docs/docsets/SWCompression.docset/Contents/Resources/docSet.dsidx b/docs/docsets/SWCompression.docset/Contents/Resources/docSet.dsidx index 8536ab2c..f2888278 100644 Binary files a/docs/docsets/SWCompression.docset/Contents/Resources/docSet.dsidx and b/docs/docsets/SWCompression.docset/Contents/Resources/docSet.dsidx differ diff --git a/docs/docsets/SWCompression.tgz b/docs/docsets/SWCompression.tgz index f6823754..34d37626 100644 Binary files a/docs/docsets/SWCompression.tgz and b/docs/docsets/SWCompression.tgz differ diff --git a/docs/img/spinner.gif b/docs/img/spinner.gif new file mode 100644 index 00000000..e3038d0a Binary files /dev/null and b/docs/img/spinner.gif differ diff --git a/docs/index.html b/docs/index.html index 23e1202d..51987387 100644 --- a/docs/index.html +++ b/docs/index.html @@ -8,6 +8,9 @@ + + + @@ -19,7 +22,13 @@ SWCompression Docs - (100% documented) + (93% documented) +

    + +

    +

    + +

    @@ -121,6 +130,9 @@

    + @@ -330,7 +342,7 @@ so some difference in speed is expected.

    diff --git a/docs/js/jazzy.js b/docs/js/jazzy.js index e2b491dc..009c80d3 100755 --- a/docs/js/jazzy.js +++ b/docs/js/jazzy.js @@ -35,3 +35,9 @@ $(".token").click(function(event) { } event.preventDefault(); }); + +// Dumb down quotes within code blocks that delimit strings instead of quotations +// https://github.com/realm/jazzy/issues/714 +$("code q").replaceWith(function () { + return ["\"", $(this).contents(), "\""]; +}); diff --git a/docs/js/jazzy.search.js b/docs/js/jazzy.search.js new file mode 100644 index 00000000..54be83cf --- /dev/null +++ b/docs/js/jazzy.search.js @@ -0,0 +1,62 @@ +$(function(){ + var searchIndex = lunr(function() { + this.ref('url'); + this.field('name'); + }); + + var $typeahead = $('[data-typeahead]'); + var $form = $typeahead.parents('form'); + var searchURL = $form.attr('action'); + + function displayTemplate(result) { + return result.name; + } + + function suggestionTemplate(result) { + var t = '
    '; + t += '' + result.name + ''; + if (result.parent_name) { + t += '' + result.parent_name + ''; + } + t += '
    '; + return t; + } + + $typeahead.one('focus', function() { + $form.addClass('loading'); + + $.getJSON(searchURL).then(function(searchData) { + $.each(searchData, function (url, doc) { + searchIndex.add({url: url, name: doc.name}); + }); + + $typeahead.typeahead( + { + highlight: true, + minLength: 3 + }, + { + limit: 10, + display: displayTemplate, + templates: { suggestion: suggestionTemplate }, + source: function(query, sync) { + var results = searchIndex.search(query).map(function(result) { + var doc = searchData[result.ref]; + doc.url = result.ref; + return doc; + }); + sync(results); + } + } + ); + $form.removeClass('loading'); + $typeahead.trigger('focus'); + }); + }); + + var baseURL = searchURL.slice(0, -"search.json".length); + + $typeahead.on('typeahead:select', function(e, result) { + window.location = baseURL + result.url; + }); +}); diff --git a/docs/js/lunr.min.js b/docs/js/lunr.min.js new file mode 100755 index 00000000..22776bb8 --- /dev/null +++ b/docs/js/lunr.min.js @@ -0,0 +1,6 @@ +/** + * lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 0.7.2 + * Copyright (C) 2016 Oliver Nightingale + * @license MIT + */ +!function(){var t=function(e){var n=new t.Index;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),e&&e.call(n,n),n};t.version="0.7.2",t.utils={},t.utils.warn=function(t){return function(e){t.console&&console.warn&&console.warn(e)}}(this),t.utils.asString=function(t){return void 0===t||null===t?"":t.toString()},t.EventEmitter=function(){this.events={}},t.EventEmitter.prototype.addListener=function(){var t=Array.prototype.slice.call(arguments),e=t.pop(),n=t;if("function"!=typeof e)throw new TypeError("last argument must be a function");n.forEach(function(t){this.hasHandler(t)||(this.events[t]=[]),this.events[t].push(e)},this)},t.EventEmitter.prototype.removeListener=function(t,e){if(this.hasHandler(t)){var n=this.events[t].indexOf(e);this.events[t].splice(n,1),this.events[t].length||delete this.events[t]}},t.EventEmitter.prototype.emit=function(t){if(this.hasHandler(t)){var e=Array.prototype.slice.call(arguments,1);this.events[t].forEach(function(t){t.apply(void 0,e)})}},t.EventEmitter.prototype.hasHandler=function(t){return t in this.events},t.tokenizer=function(e){if(!arguments.length||null==e||void 0==e)return[];if(Array.isArray(e))return e.map(function(e){return t.utils.asString(e).toLowerCase()});var n=t.tokenizer.seperator||t.tokenizer.separator;return e.toString().trim().toLowerCase().split(n)},t.tokenizer.seperator=!1,t.tokenizer.separator=/[\s\-]+/,t.tokenizer.load=function(t){var e=this.registeredFunctions[t];if(!e)throw new Error("Cannot load un-registered function: "+t);return e},t.tokenizer.label="default",t.tokenizer.registeredFunctions={"default":t.tokenizer},t.tokenizer.registerFunction=function(e,n){n in this.registeredFunctions&&t.utils.warn("Overwriting existing tokenizer: "+n),e.label=n,this.registeredFunctions[n]=e},t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions={},t.Pipeline.registerFunction=function(e,n){n in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(e){var i=t.Pipeline.registeredFunctions[e];if(!i)throw new Error("Cannot load un-registered function: "+e);n.add(i)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(e){t.Pipeline.warnIfFunctionNotRegistered(e),this._stack.push(e)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var i=this._stack.indexOf(e);if(-1==i)throw new Error("Cannot find existingFn");i+=1,this._stack.splice(i,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var i=this._stack.indexOf(e);if(-1==i)throw new Error("Cannot find existingFn");this._stack.splice(i,0,n)},t.Pipeline.prototype.remove=function(t){var e=this._stack.indexOf(t);-1!=e&&this._stack.splice(e,1)},t.Pipeline.prototype.run=function(t){for(var e=[],n=t.length,i=this._stack.length,r=0;n>r;r++){for(var o=t[r],s=0;i>s&&(o=this._stack[s](o,r,t),void 0!==o&&""!==o);s++);void 0!==o&&""!==o&&e.push(o)}return e},t.Pipeline.prototype.reset=function(){this._stack=[]},t.Pipeline.prototype.toJSON=function(){return this._stack.map(function(e){return t.Pipeline.warnIfFunctionNotRegistered(e),e.label})},t.Vector=function(){this._magnitude=null,this.list=void 0,this.length=0},t.Vector.Node=function(t,e,n){this.idx=t,this.val=e,this.next=n},t.Vector.prototype.insert=function(e,n){this._magnitude=void 0;var i=this.list;if(!i)return this.list=new t.Vector.Node(e,n,i),this.length++;if(en.idx?n=n.next:(i+=e.val*n.val,e=e.next,n=n.next);return i},t.Vector.prototype.similarity=function(t){return this.dot(t)/(this.magnitude()*t.magnitude())},t.SortedSet=function(){this.length=0,this.elements=[]},t.SortedSet.load=function(t){var e=new this;return e.elements=t,e.length=t.length,e},t.SortedSet.prototype.add=function(){var t,e;for(t=0;t1;){if(o===t)return r;t>o&&(e=r),o>t&&(n=r),i=n-e,r=e+Math.floor(i/2),o=this.elements[r]}return o===t?r:-1},t.SortedSet.prototype.locationFor=function(t){for(var e=0,n=this.elements.length,i=n-e,r=e+Math.floor(i/2),o=this.elements[r];i>1;)t>o&&(e=r),o>t&&(n=r),i=n-e,r=e+Math.floor(i/2),o=this.elements[r];return o>t?r:t>o?r+1:void 0},t.SortedSet.prototype.intersect=function(e){for(var n=new t.SortedSet,i=0,r=0,o=this.length,s=e.length,a=this.elements,h=e.elements;;){if(i>o-1||r>s-1)break;a[i]!==h[r]?a[i]h[r]&&r++:(n.add(a[i]),i++,r++)}return n},t.SortedSet.prototype.clone=function(){var e=new t.SortedSet;return e.elements=this.toArray(),e.length=e.elements.length,e},t.SortedSet.prototype.union=function(t){var e,n,i;this.length>=t.length?(e=this,n=t):(e=t,n=this),i=e.clone();for(var r=0,o=n.toArray();rp;p++)c[p]===a&&d++;h+=d/f*l.boost}}this.tokenStore.add(a,{ref:o,tf:h})}n&&this.eventEmitter.emit("add",e,this)},t.Index.prototype.remove=function(t,e){var n=t[this._ref],e=void 0===e?!0:e;if(this.documentStore.has(n)){var i=this.documentStore.get(n);this.documentStore.remove(n),i.forEach(function(t){this.tokenStore.remove(t,n)},this),e&&this.eventEmitter.emit("remove",t,this)}},t.Index.prototype.update=function(t,e){var e=void 0===e?!0:e;this.remove(t,!1),this.add(t,!1),e&&this.eventEmitter.emit("update",t,this)},t.Index.prototype.idf=function(t){var e="@"+t;if(Object.prototype.hasOwnProperty.call(this._idfCache,e))return this._idfCache[e];var n=this.tokenStore.count(t),i=1;return n>0&&(i=1+Math.log(this.documentStore.length/n)),this._idfCache[e]=i},t.Index.prototype.search=function(e){var n=this.pipeline.run(this.tokenizerFn(e)),i=new t.Vector,r=[],o=this._fields.reduce(function(t,e){return t+e.boost},0),s=n.some(function(t){return this.tokenStore.has(t)},this);if(!s)return[];n.forEach(function(e,n,s){var a=1/s.length*this._fields.length*o,h=this,u=this.tokenStore.expand(e).reduce(function(n,r){var o=h.corpusTokens.indexOf(r),s=h.idf(r),u=1,l=new t.SortedSet;if(r!==e){var c=Math.max(3,r.length-e.length);u=1/Math.log(c)}o>-1&&i.insert(o,a*s*u);for(var f=h.tokenStore.get(r),d=Object.keys(f),p=d.length,v=0;p>v;v++)l.add(f[d[v]].ref);return n.union(l)},new t.SortedSet);r.push(u)},this);var a=r.reduce(function(t,e){return t.intersect(e)});return a.map(function(t){return{ref:t,score:i.similarity(this.documentVector(t))}},this).sort(function(t,e){return e.score-t.score})},t.Index.prototype.documentVector=function(e){for(var n=this.documentStore.get(e),i=n.length,r=new t.Vector,o=0;i>o;o++){var s=n.elements[o],a=this.tokenStore.get(s)[e].tf,h=this.idf(s);r.insert(this.corpusTokens.indexOf(s),a*h)}return r},t.Index.prototype.toJSON=function(){return{version:t.version,fields:this._fields,ref:this._ref,tokenizer:this.tokenizerFn.label,documentStore:this.documentStore.toJSON(),tokenStore:this.tokenStore.toJSON(),corpusTokens:this.corpusTokens.toJSON(),pipeline:this.pipeline.toJSON()}},t.Index.prototype.use=function(t){var e=Array.prototype.slice.call(arguments,1);e.unshift(this),t.apply(this,e)},t.Store=function(){this.store={},this.length=0},t.Store.load=function(e){var n=new this;return n.length=e.length,n.store=Object.keys(e.store).reduce(function(n,i){return n[i]=t.SortedSet.load(e.store[i]),n},{}),n},t.Store.prototype.set=function(t,e){this.has(t)||this.length++,this.store[t]=e},t.Store.prototype.get=function(t){return this.store[t]},t.Store.prototype.has=function(t){return t in this.store},t.Store.prototype.remove=function(t){this.has(t)&&(delete this.store[t],this.length--)},t.Store.prototype.toJSON=function(){return{store:this.store,length:this.length}},t.stemmer=function(){var t={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},e={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},n="[^aeiou]",i="[aeiouy]",r=n+"[^aeiouy]*",o=i+"[aeiou]*",s="^("+r+")?"+o+r,a="^("+r+")?"+o+r+"("+o+")?$",h="^("+r+")?"+o+r+o+r,u="^("+r+")?"+i,l=new RegExp(s),c=new RegExp(h),f=new RegExp(a),d=new RegExp(u),p=/^(.+?)(ss|i)es$/,v=/^(.+?)([^s])s$/,g=/^(.+?)eed$/,m=/^(.+?)(ed|ing)$/,y=/.$/,S=/(at|bl|iz)$/,w=new RegExp("([^aeiouylsz])\\1$"),k=new RegExp("^"+r+i+"[^aeiouwxy]$"),x=/^(.+?[^aeiou])y$/,b=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,E=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,F=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,_=/^(.+?)(s|t)(ion)$/,z=/^(.+?)e$/,O=/ll$/,P=new RegExp("^"+r+i+"[^aeiouwxy]$"),T=function(n){var i,r,o,s,a,h,u;if(n.length<3)return n;if(o=n.substr(0,1),"y"==o&&(n=o.toUpperCase()+n.substr(1)),s=p,a=v,s.test(n)?n=n.replace(s,"$1$2"):a.test(n)&&(n=n.replace(a,"$1$2")),s=g,a=m,s.test(n)){var T=s.exec(n);s=l,s.test(T[1])&&(s=y,n=n.replace(s,""))}else if(a.test(n)){var T=a.exec(n);i=T[1],a=d,a.test(i)&&(n=i,a=S,h=w,u=k,a.test(n)?n+="e":h.test(n)?(s=y,n=n.replace(s,"")):u.test(n)&&(n+="e"))}if(s=x,s.test(n)){var T=s.exec(n);i=T[1],n=i+"i"}if(s=b,s.test(n)){var T=s.exec(n);i=T[1],r=T[2],s=l,s.test(i)&&(n=i+t[r])}if(s=E,s.test(n)){var T=s.exec(n);i=T[1],r=T[2],s=l,s.test(i)&&(n=i+e[r])}if(s=F,a=_,s.test(n)){var T=s.exec(n);i=T[1],s=c,s.test(i)&&(n=i)}else if(a.test(n)){var T=a.exec(n);i=T[1]+T[2],a=c,a.test(i)&&(n=i)}if(s=z,s.test(n)){var T=s.exec(n);i=T[1],s=c,a=f,h=P,(s.test(i)||a.test(i)&&!h.test(i))&&(n=i)}return s=O,a=c,s.test(n)&&a.test(n)&&(s=y,n=n.replace(s,"")),"y"==o&&(n=o.toLowerCase()+n.substr(1)),n};return T}(),t.Pipeline.registerFunction(t.stemmer,"stemmer"),t.generateStopWordFilter=function(t){var e=t.reduce(function(t,e){return t[e]=e,t},{});return function(t){return t&&e[t]!==t?t:void 0}},t.stopWordFilter=t.generateStopWordFilter(["a","able","about","across","after","all","almost","also","am","among","an","and","any","are","as","at","be","because","been","but","by","can","cannot","could","dear","did","do","does","either","else","ever","every","for","from","get","got","had","has","have","he","her","hers","him","his","how","however","i","if","in","into","is","it","its","just","least","let","like","likely","may","me","might","most","must","my","neither","no","nor","not","of","off","often","on","only","or","other","our","own","rather","said","say","says","she","should","since","so","some","than","that","the","their","them","then","there","these","they","this","tis","to","too","twas","us","wants","was","we","were","what","when","where","which","while","who","whom","why","will","with","would","yet","you","your"]),t.Pipeline.registerFunction(t.stopWordFilter,"stopWordFilter"),t.trimmer=function(t){return t.replace(/^\W+/,"").replace(/\W+$/,"")},t.Pipeline.registerFunction(t.trimmer,"trimmer"),t.TokenStore=function(){this.root={docs:{}},this.length=0},t.TokenStore.load=function(t){var e=new this;return e.root=t.root,e.length=t.length,e},t.TokenStore.prototype.add=function(t,e,n){var n=n||this.root,i=t.charAt(0),r=t.slice(1);return i in n||(n[i]={docs:{}}),0===r.length?(n[i].docs[e.ref]=e,void(this.length+=1)):this.add(r,e,n[i])},t.TokenStore.prototype.has=function(t){if(!t)return!1;for(var e=this.root,n=0;n', + menu: '
    ' + }; + } + function buildSelectors(classes) { + var selectors = {}; + _.each(classes, function(v, k) { + selectors[k] = "." + v; + }); + return selectors; + } + function buildCss() { + var css = { + wrapper: { + position: "relative", + display: "inline-block" + }, + hint: { + position: "absolute", + top: "0", + left: "0", + borderColor: "transparent", + boxShadow: "none", + opacity: "1" + }, + input: { + position: "relative", + verticalAlign: "top", + backgroundColor: "transparent" + }, + inputWithNoHint: { + position: "relative", + verticalAlign: "top" + }, + menu: { + position: "absolute", + top: "100%", + left: "0", + zIndex: "100", + display: "none" + }, + ltr: { + left: "0", + right: "auto" + }, + rtl: { + left: "auto", + right: " 0" + } + }; + if (_.isMsie()) { + _.mixin(css.input, { + backgroundImage: "url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)" + }); + } + return css; + } + }(); + var EventBus = function() { + "use strict"; + var namespace, deprecationMap; + namespace = "typeahead:"; + deprecationMap = { + render: "rendered", + cursorchange: "cursorchanged", + select: "selected", + autocomplete: "autocompleted" + }; + function EventBus(o) { + if (!o || !o.el) { + $.error("EventBus initialized without el"); + } + this.$el = $(o.el); + } + _.mixin(EventBus.prototype, { + _trigger: function(type, args) { + var $e; + $e = $.Event(namespace + type); + (args = args || []).unshift($e); + this.$el.trigger.apply(this.$el, args); + return $e; + }, + before: function(type) { + var args, $e; + args = [].slice.call(arguments, 1); + $e = this._trigger("before" + type, args); + return $e.isDefaultPrevented(); + }, + trigger: function(type) { + var deprecatedType; + this._trigger(type, [].slice.call(arguments, 1)); + if (deprecatedType = deprecationMap[type]) { + this._trigger(deprecatedType, [].slice.call(arguments, 1)); + } + } + }); + return EventBus; + }(); + var EventEmitter = function() { + "use strict"; + var splitter = /\s+/, nextTick = getNextTick(); + return { + onSync: onSync, + onAsync: onAsync, + off: off, + trigger: trigger + }; + function on(method, types, cb, context) { + var type; + if (!cb) { + return this; + } + types = types.split(splitter); + cb = context ? bindContext(cb, context) : cb; + this._callbacks = this._callbacks || {}; + while (type = types.shift()) { + this._callbacks[type] = this._callbacks[type] || { + sync: [], + async: [] + }; + this._callbacks[type][method].push(cb); + } + return this; + } + function onAsync(types, cb, context) { + return on.call(this, "async", types, cb, context); + } + function onSync(types, cb, context) { + return on.call(this, "sync", types, cb, context); + } + function off(types) { + var type; + if (!this._callbacks) { + return this; + } + types = types.split(splitter); + while (type = types.shift()) { + delete this._callbacks[type]; + } + return this; + } + function trigger(types) { + var type, callbacks, args, syncFlush, asyncFlush; + if (!this._callbacks) { + return this; + } + types = types.split(splitter); + args = [].slice.call(arguments, 1); + while ((type = types.shift()) && (callbacks = this._callbacks[type])) { + syncFlush = getFlush(callbacks.sync, this, [ type ].concat(args)); + asyncFlush = getFlush(callbacks.async, this, [ type ].concat(args)); + syncFlush() && nextTick(asyncFlush); + } + return this; + } + function getFlush(callbacks, context, args) { + return flush; + function flush() { + var cancelled; + for (var i = 0, len = callbacks.length; !cancelled && i < len; i += 1) { + cancelled = callbacks[i].apply(context, args) === false; + } + return !cancelled; + } + } + function getNextTick() { + var nextTickFn; + if (window.setImmediate) { + nextTickFn = function nextTickSetImmediate(fn) { + setImmediate(function() { + fn(); + }); + }; + } else { + nextTickFn = function nextTickSetTimeout(fn) { + setTimeout(function() { + fn(); + }, 0); + }; + } + return nextTickFn; + } + function bindContext(fn, context) { + return fn.bind ? fn.bind(context) : function() { + fn.apply(context, [].slice.call(arguments, 0)); + }; + } + }(); + var highlight = function(doc) { + "use strict"; + var defaults = { + node: null, + pattern: null, + tagName: "strong", + className: null, + wordsOnly: false, + caseSensitive: false + }; + return function hightlight(o) { + var regex; + o = _.mixin({}, defaults, o); + if (!o.node || !o.pattern) { + return; + } + o.pattern = _.isArray(o.pattern) ? o.pattern : [ o.pattern ]; + regex = getRegex(o.pattern, o.caseSensitive, o.wordsOnly); + traverse(o.node, hightlightTextNode); + function hightlightTextNode(textNode) { + var match, patternNode, wrapperNode; + if (match = regex.exec(textNode.data)) { + wrapperNode = doc.createElement(o.tagName); + o.className && (wrapperNode.className = o.className); + patternNode = textNode.splitText(match.index); + patternNode.splitText(match[0].length); + wrapperNode.appendChild(patternNode.cloneNode(true)); + textNode.parentNode.replaceChild(wrapperNode, patternNode); + } + return !!match; + } + function traverse(el, hightlightTextNode) { + var childNode, TEXT_NODE_TYPE = 3; + for (var i = 0; i < el.childNodes.length; i++) { + childNode = el.childNodes[i]; + if (childNode.nodeType === TEXT_NODE_TYPE) { + i += hightlightTextNode(childNode) ? 1 : 0; + } else { + traverse(childNode, hightlightTextNode); + } + } + } + }; + function getRegex(patterns, caseSensitive, wordsOnly) { + var escapedPatterns = [], regexStr; + for (var i = 0, len = patterns.length; i < len; i++) { + escapedPatterns.push(_.escapeRegExChars(patterns[i])); + } + regexStr = wordsOnly ? "\\b(" + escapedPatterns.join("|") + ")\\b" : "(" + escapedPatterns.join("|") + ")"; + return caseSensitive ? new RegExp(regexStr) : new RegExp(regexStr, "i"); + } + }(window.document); + var Input = function() { + "use strict"; + var specialKeyCodeMap; + specialKeyCodeMap = { + 9: "tab", + 27: "esc", + 37: "left", + 39: "right", + 13: "enter", + 38: "up", + 40: "down" + }; + function Input(o, www) { + o = o || {}; + if (!o.input) { + $.error("input is missing"); + } + www.mixin(this); + this.$hint = $(o.hint); + this.$input = $(o.input); + this.query = this.$input.val(); + this.queryWhenFocused = this.hasFocus() ? this.query : null; + this.$overflowHelper = buildOverflowHelper(this.$input); + this._checkLanguageDirection(); + if (this.$hint.length === 0) { + this.setHint = this.getHint = this.clearHint = this.clearHintIfInvalid = _.noop; + } + } + Input.normalizeQuery = function(str) { + return _.toStr(str).replace(/^\s*/g, "").replace(/\s{2,}/g, " "); + }; + _.mixin(Input.prototype, EventEmitter, { + _onBlur: function onBlur() { + this.resetInputValue(); + this.trigger("blurred"); + }, + _onFocus: function onFocus() { + this.queryWhenFocused = this.query; + this.trigger("focused"); + }, + _onKeydown: function onKeydown($e) { + var keyName = specialKeyCodeMap[$e.which || $e.keyCode]; + this._managePreventDefault(keyName, $e); + if (keyName && this._shouldTrigger(keyName, $e)) { + this.trigger(keyName + "Keyed", $e); + } + }, + _onInput: function onInput() { + this._setQuery(this.getInputValue()); + this.clearHintIfInvalid(); + this._checkLanguageDirection(); + }, + _managePreventDefault: function managePreventDefault(keyName, $e) { + var preventDefault; + switch (keyName) { + case "up": + case "down": + preventDefault = !withModifier($e); + break; + + default: + preventDefault = false; + } + preventDefault && $e.preventDefault(); + }, + _shouldTrigger: function shouldTrigger(keyName, $e) { + var trigger; + switch (keyName) { + case "tab": + trigger = !withModifier($e); + break; + + default: + trigger = true; + } + return trigger; + }, + _checkLanguageDirection: function checkLanguageDirection() { + var dir = (this.$input.css("direction") || "ltr").toLowerCase(); + if (this.dir !== dir) { + this.dir = dir; + this.$hint.attr("dir", dir); + this.trigger("langDirChanged", dir); + } + }, + _setQuery: function setQuery(val, silent) { + var areEquivalent, hasDifferentWhitespace; + areEquivalent = areQueriesEquivalent(val, this.query); + hasDifferentWhitespace = areEquivalent ? this.query.length !== val.length : false; + this.query = val; + if (!silent && !areEquivalent) { + this.trigger("queryChanged", this.query); + } else if (!silent && hasDifferentWhitespace) { + this.trigger("whitespaceChanged", this.query); + } + }, + bind: function() { + var that = this, onBlur, onFocus, onKeydown, onInput; + onBlur = _.bind(this._onBlur, this); + onFocus = _.bind(this._onFocus, this); + onKeydown = _.bind(this._onKeydown, this); + onInput = _.bind(this._onInput, this); + this.$input.on("blur.tt", onBlur).on("focus.tt", onFocus).on("keydown.tt", onKeydown); + if (!_.isMsie() || _.isMsie() > 9) { + this.$input.on("input.tt", onInput); + } else { + this.$input.on("keydown.tt keypress.tt cut.tt paste.tt", function($e) { + if (specialKeyCodeMap[$e.which || $e.keyCode]) { + return; + } + _.defer(_.bind(that._onInput, that, $e)); + }); + } + return this; + }, + focus: function focus() { + this.$input.focus(); + }, + blur: function blur() { + this.$input.blur(); + }, + getLangDir: function getLangDir() { + return this.dir; + }, + getQuery: function getQuery() { + return this.query || ""; + }, + setQuery: function setQuery(val, silent) { + this.setInputValue(val); + this._setQuery(val, silent); + }, + hasQueryChangedSinceLastFocus: function hasQueryChangedSinceLastFocus() { + return this.query !== this.queryWhenFocused; + }, + getInputValue: function getInputValue() { + return this.$input.val(); + }, + setInputValue: function setInputValue(value) { + this.$input.val(value); + this.clearHintIfInvalid(); + this._checkLanguageDirection(); + }, + resetInputValue: function resetInputValue() { + this.setInputValue(this.query); + }, + getHint: function getHint() { + return this.$hint.val(); + }, + setHint: function setHint(value) { + this.$hint.val(value); + }, + clearHint: function clearHint() { + this.setHint(""); + }, + clearHintIfInvalid: function clearHintIfInvalid() { + var val, hint, valIsPrefixOfHint, isValid; + val = this.getInputValue(); + hint = this.getHint(); + valIsPrefixOfHint = val !== hint && hint.indexOf(val) === 0; + isValid = val !== "" && valIsPrefixOfHint && !this.hasOverflow(); + !isValid && this.clearHint(); + }, + hasFocus: function hasFocus() { + return this.$input.is(":focus"); + }, + hasOverflow: function hasOverflow() { + var constraint = this.$input.width() - 2; + this.$overflowHelper.text(this.getInputValue()); + return this.$overflowHelper.width() >= constraint; + }, + isCursorAtEnd: function() { + var valueLength, selectionStart, range; + valueLength = this.$input.val().length; + selectionStart = this.$input[0].selectionStart; + if (_.isNumber(selectionStart)) { + return selectionStart === valueLength; + } else if (document.selection) { + range = document.selection.createRange(); + range.moveStart("character", -valueLength); + return valueLength === range.text.length; + } + return true; + }, + destroy: function destroy() { + this.$hint.off(".tt"); + this.$input.off(".tt"); + this.$overflowHelper.remove(); + this.$hint = this.$input = this.$overflowHelper = $("
    "); + } + }); + return Input; + function buildOverflowHelper($input) { + return $('').css({ + position: "absolute", + visibility: "hidden", + whiteSpace: "pre", + fontFamily: $input.css("font-family"), + fontSize: $input.css("font-size"), + fontStyle: $input.css("font-style"), + fontVariant: $input.css("font-variant"), + fontWeight: $input.css("font-weight"), + wordSpacing: $input.css("word-spacing"), + letterSpacing: $input.css("letter-spacing"), + textIndent: $input.css("text-indent"), + textRendering: $input.css("text-rendering"), + textTransform: $input.css("text-transform") + }).insertAfter($input); + } + function areQueriesEquivalent(a, b) { + return Input.normalizeQuery(a) === Input.normalizeQuery(b); + } + function withModifier($e) { + return $e.altKey || $e.ctrlKey || $e.metaKey || $e.shiftKey; + } + }(); + var Dataset = function() { + "use strict"; + var keys, nameGenerator; + keys = { + val: "tt-selectable-display", + obj: "tt-selectable-object" + }; + nameGenerator = _.getIdGenerator(); + function Dataset(o, www) { + o = o || {}; + o.templates = o.templates || {}; + o.templates.notFound = o.templates.notFound || o.templates.empty; + if (!o.source) { + $.error("missing source"); + } + if (!o.node) { + $.error("missing node"); + } + if (o.name && !isValidName(o.name)) { + $.error("invalid dataset name: " + o.name); + } + www.mixin(this); + this.highlight = !!o.highlight; + this.name = o.name || nameGenerator(); + this.limit = o.limit || 5; + this.displayFn = getDisplayFn(o.display || o.displayKey); + this.templates = getTemplates(o.templates, this.displayFn); + this.source = o.source.__ttAdapter ? o.source.__ttAdapter() : o.source; + this.async = _.isUndefined(o.async) ? this.source.length > 2 : !!o.async; + this._resetLastSuggestion(); + this.$el = $(o.node).addClass(this.classes.dataset).addClass(this.classes.dataset + "-" + this.name); + } + Dataset.extractData = function extractData(el) { + var $el = $(el); + if ($el.data(keys.obj)) { + return { + val: $el.data(keys.val) || "", + obj: $el.data(keys.obj) || null + }; + } + return null; + }; + _.mixin(Dataset.prototype, EventEmitter, { + _overwrite: function overwrite(query, suggestions) { + suggestions = suggestions || []; + if (suggestions.length) { + this._renderSuggestions(query, suggestions); + } else if (this.async && this.templates.pending) { + this._renderPending(query); + } else if (!this.async && this.templates.notFound) { + this._renderNotFound(query); + } else { + this._empty(); + } + this.trigger("rendered", this.name, suggestions, false); + }, + _append: function append(query, suggestions) { + suggestions = suggestions || []; + if (suggestions.length && this.$lastSuggestion.length) { + this._appendSuggestions(query, suggestions); + } else if (suggestions.length) { + this._renderSuggestions(query, suggestions); + } else if (!this.$lastSuggestion.length && this.templates.notFound) { + this._renderNotFound(query); + } + this.trigger("rendered", this.name, suggestions, true); + }, + _renderSuggestions: function renderSuggestions(query, suggestions) { + var $fragment; + $fragment = this._getSuggestionsFragment(query, suggestions); + this.$lastSuggestion = $fragment.children().last(); + this.$el.html($fragment).prepend(this._getHeader(query, suggestions)).append(this._getFooter(query, suggestions)); + }, + _appendSuggestions: function appendSuggestions(query, suggestions) { + var $fragment, $lastSuggestion; + $fragment = this._getSuggestionsFragment(query, suggestions); + $lastSuggestion = $fragment.children().last(); + this.$lastSuggestion.after($fragment); + this.$lastSuggestion = $lastSuggestion; + }, + _renderPending: function renderPending(query) { + var template = this.templates.pending; + this._resetLastSuggestion(); + template && this.$el.html(template({ + query: query, + dataset: this.name + })); + }, + _renderNotFound: function renderNotFound(query) { + var template = this.templates.notFound; + this._resetLastSuggestion(); + template && this.$el.html(template({ + query: query, + dataset: this.name + })); + }, + _empty: function empty() { + this.$el.empty(); + this._resetLastSuggestion(); + }, + _getSuggestionsFragment: function getSuggestionsFragment(query, suggestions) { + var that = this, fragment; + fragment = document.createDocumentFragment(); + _.each(suggestions, function getSuggestionNode(suggestion) { + var $el, context; + context = that._injectQuery(query, suggestion); + $el = $(that.templates.suggestion(context)).data(keys.obj, suggestion).data(keys.val, that.displayFn(suggestion)).addClass(that.classes.suggestion + " " + that.classes.selectable); + fragment.appendChild($el[0]); + }); + this.highlight && highlight({ + className: this.classes.highlight, + node: fragment, + pattern: query + }); + return $(fragment); + }, + _getFooter: function getFooter(query, suggestions) { + return this.templates.footer ? this.templates.footer({ + query: query, + suggestions: suggestions, + dataset: this.name + }) : null; + }, + _getHeader: function getHeader(query, suggestions) { + return this.templates.header ? this.templates.header({ + query: query, + suggestions: suggestions, + dataset: this.name + }) : null; + }, + _resetLastSuggestion: function resetLastSuggestion() { + this.$lastSuggestion = $(); + }, + _injectQuery: function injectQuery(query, obj) { + return _.isObject(obj) ? _.mixin({ + _query: query + }, obj) : obj; + }, + update: function update(query) { + var that = this, canceled = false, syncCalled = false, rendered = 0; + this.cancel(); + this.cancel = function cancel() { + canceled = true; + that.cancel = $.noop; + that.async && that.trigger("asyncCanceled", query); + }; + this.source(query, sync, async); + !syncCalled && sync([]); + function sync(suggestions) { + if (syncCalled) { + return; + } + syncCalled = true; + suggestions = (suggestions || []).slice(0, that.limit); + rendered = suggestions.length; + that._overwrite(query, suggestions); + if (rendered < that.limit && that.async) { + that.trigger("asyncRequested", query); + } + } + function async(suggestions) { + suggestions = suggestions || []; + if (!canceled && rendered < that.limit) { + that.cancel = $.noop; + rendered += suggestions.length; + that._append(query, suggestions.slice(0, that.limit - rendered)); + that.async && that.trigger("asyncReceived", query); + } + } + }, + cancel: $.noop, + clear: function clear() { + this._empty(); + this.cancel(); + this.trigger("cleared"); + }, + isEmpty: function isEmpty() { + return this.$el.is(":empty"); + }, + destroy: function destroy() { + this.$el = $("
    "); + } + }); + return Dataset; + function getDisplayFn(display) { + display = display || _.stringify; + return _.isFunction(display) ? display : displayFn; + function displayFn(obj) { + return obj[display]; + } + } + function getTemplates(templates, displayFn) { + return { + notFound: templates.notFound && _.templatify(templates.notFound), + pending: templates.pending && _.templatify(templates.pending), + header: templates.header && _.templatify(templates.header), + footer: templates.footer && _.templatify(templates.footer), + suggestion: templates.suggestion || suggestionTemplate + }; + function suggestionTemplate(context) { + return $("
    ").text(displayFn(context)); + } + } + function isValidName(str) { + return /^[_a-zA-Z0-9-]+$/.test(str); + } + }(); + var Menu = function() { + "use strict"; + function Menu(o, www) { + var that = this; + o = o || {}; + if (!o.node) { + $.error("node is required"); + } + www.mixin(this); + this.$node = $(o.node); + this.query = null; + this.datasets = _.map(o.datasets, initializeDataset); + function initializeDataset(oDataset) { + var node = that.$node.find(oDataset.node).first(); + oDataset.node = node.length ? node : $("
    ").appendTo(that.$node); + return new Dataset(oDataset, www); + } + } + _.mixin(Menu.prototype, EventEmitter, { + _onSelectableClick: function onSelectableClick($e) { + this.trigger("selectableClicked", $($e.currentTarget)); + }, + _onRendered: function onRendered(type, dataset, suggestions, async) { + this.$node.toggleClass(this.classes.empty, this._allDatasetsEmpty()); + this.trigger("datasetRendered", dataset, suggestions, async); + }, + _onCleared: function onCleared() { + this.$node.toggleClass(this.classes.empty, this._allDatasetsEmpty()); + this.trigger("datasetCleared"); + }, + _propagate: function propagate() { + this.trigger.apply(this, arguments); + }, + _allDatasetsEmpty: function allDatasetsEmpty() { + return _.every(this.datasets, isDatasetEmpty); + function isDatasetEmpty(dataset) { + return dataset.isEmpty(); + } + }, + _getSelectables: function getSelectables() { + return this.$node.find(this.selectors.selectable); + }, + _removeCursor: function _removeCursor() { + var $selectable = this.getActiveSelectable(); + $selectable && $selectable.removeClass(this.classes.cursor); + }, + _ensureVisible: function ensureVisible($el) { + var elTop, elBottom, nodeScrollTop, nodeHeight; + elTop = $el.position().top; + elBottom = elTop + $el.outerHeight(true); + nodeScrollTop = this.$node.scrollTop(); + nodeHeight = this.$node.height() + parseInt(this.$node.css("paddingTop"), 10) + parseInt(this.$node.css("paddingBottom"), 10); + if (elTop < 0) { + this.$node.scrollTop(nodeScrollTop + elTop); + } else if (nodeHeight < elBottom) { + this.$node.scrollTop(nodeScrollTop + (elBottom - nodeHeight)); + } + }, + bind: function() { + var that = this, onSelectableClick; + onSelectableClick = _.bind(this._onSelectableClick, this); + this.$node.on("click.tt", this.selectors.selectable, onSelectableClick); + _.each(this.datasets, function(dataset) { + dataset.onSync("asyncRequested", that._propagate, that).onSync("asyncCanceled", that._propagate, that).onSync("asyncReceived", that._propagate, that).onSync("rendered", that._onRendered, that).onSync("cleared", that._onCleared, that); + }); + return this; + }, + isOpen: function isOpen() { + return this.$node.hasClass(this.classes.open); + }, + open: function open() { + this.$node.addClass(this.classes.open); + }, + close: function close() { + this.$node.removeClass(this.classes.open); + this._removeCursor(); + }, + setLanguageDirection: function setLanguageDirection(dir) { + this.$node.attr("dir", dir); + }, + selectableRelativeToCursor: function selectableRelativeToCursor(delta) { + var $selectables, $oldCursor, oldIndex, newIndex; + $oldCursor = this.getActiveSelectable(); + $selectables = this._getSelectables(); + oldIndex = $oldCursor ? $selectables.index($oldCursor) : -1; + newIndex = oldIndex + delta; + newIndex = (newIndex + 1) % ($selectables.length + 1) - 1; + newIndex = newIndex < -1 ? $selectables.length - 1 : newIndex; + return newIndex === -1 ? null : $selectables.eq(newIndex); + }, + setCursor: function setCursor($selectable) { + this._removeCursor(); + if ($selectable = $selectable && $selectable.first()) { + $selectable.addClass(this.classes.cursor); + this._ensureVisible($selectable); + } + }, + getSelectableData: function getSelectableData($el) { + return $el && $el.length ? Dataset.extractData($el) : null; + }, + getActiveSelectable: function getActiveSelectable() { + var $selectable = this._getSelectables().filter(this.selectors.cursor).first(); + return $selectable.length ? $selectable : null; + }, + getTopSelectable: function getTopSelectable() { + var $selectable = this._getSelectables().first(); + return $selectable.length ? $selectable : null; + }, + update: function update(query) { + var isValidUpdate = query !== this.query; + if (isValidUpdate) { + this.query = query; + _.each(this.datasets, updateDataset); + } + return isValidUpdate; + function updateDataset(dataset) { + dataset.update(query); + } + }, + empty: function empty() { + _.each(this.datasets, clearDataset); + this.query = null; + this.$node.addClass(this.classes.empty); + function clearDataset(dataset) { + dataset.clear(); + } + }, + destroy: function destroy() { + this.$node.off(".tt"); + this.$node = $("
    "); + _.each(this.datasets, destroyDataset); + function destroyDataset(dataset) { + dataset.destroy(); + } + } + }); + return Menu; + }(); + var DefaultMenu = function() { + "use strict"; + var s = Menu.prototype; + function DefaultMenu() { + Menu.apply(this, [].slice.call(arguments, 0)); + } + _.mixin(DefaultMenu.prototype, Menu.prototype, { + open: function open() { + !this._allDatasetsEmpty() && this._show(); + return s.open.apply(this, [].slice.call(arguments, 0)); + }, + close: function close() { + this._hide(); + return s.close.apply(this, [].slice.call(arguments, 0)); + }, + _onRendered: function onRendered() { + if (this._allDatasetsEmpty()) { + this._hide(); + } else { + this.isOpen() && this._show(); + } + return s._onRendered.apply(this, [].slice.call(arguments, 0)); + }, + _onCleared: function onCleared() { + if (this._allDatasetsEmpty()) { + this._hide(); + } else { + this.isOpen() && this._show(); + } + return s._onCleared.apply(this, [].slice.call(arguments, 0)); + }, + setLanguageDirection: function setLanguageDirection(dir) { + this.$node.css(dir === "ltr" ? this.css.ltr : this.css.rtl); + return s.setLanguageDirection.apply(this, [].slice.call(arguments, 0)); + }, + _hide: function hide() { + this.$node.hide(); + }, + _show: function show() { + this.$node.css("display", "block"); + } + }); + return DefaultMenu; + }(); + var Typeahead = function() { + "use strict"; + function Typeahead(o, www) { + var onFocused, onBlurred, onEnterKeyed, onTabKeyed, onEscKeyed, onUpKeyed, onDownKeyed, onLeftKeyed, onRightKeyed, onQueryChanged, onWhitespaceChanged; + o = o || {}; + if (!o.input) { + $.error("missing input"); + } + if (!o.menu) { + $.error("missing menu"); + } + if (!o.eventBus) { + $.error("missing event bus"); + } + www.mixin(this); + this.eventBus = o.eventBus; + this.minLength = _.isNumber(o.minLength) ? o.minLength : 1; + this.input = o.input; + this.menu = o.menu; + this.enabled = true; + this.active = false; + this.input.hasFocus() && this.activate(); + this.dir = this.input.getLangDir(); + this._hacks(); + this.menu.bind().onSync("selectableClicked", this._onSelectableClicked, this).onSync("asyncRequested", this._onAsyncRequested, this).onSync("asyncCanceled", this._onAsyncCanceled, this).onSync("asyncReceived", this._onAsyncReceived, this).onSync("datasetRendered", this._onDatasetRendered, this).onSync("datasetCleared", this._onDatasetCleared, this); + onFocused = c(this, "activate", "open", "_onFocused"); + onBlurred = c(this, "deactivate", "_onBlurred"); + onEnterKeyed = c(this, "isActive", "isOpen", "_onEnterKeyed"); + onTabKeyed = c(this, "isActive", "isOpen", "_onTabKeyed"); + onEscKeyed = c(this, "isActive", "_onEscKeyed"); + onUpKeyed = c(this, "isActive", "open", "_onUpKeyed"); + onDownKeyed = c(this, "isActive", "open", "_onDownKeyed"); + onLeftKeyed = c(this, "isActive", "isOpen", "_onLeftKeyed"); + onRightKeyed = c(this, "isActive", "isOpen", "_onRightKeyed"); + onQueryChanged = c(this, "_openIfActive", "_onQueryChanged"); + onWhitespaceChanged = c(this, "_openIfActive", "_onWhitespaceChanged"); + this.input.bind().onSync("focused", onFocused, this).onSync("blurred", onBlurred, this).onSync("enterKeyed", onEnterKeyed, this).onSync("tabKeyed", onTabKeyed, this).onSync("escKeyed", onEscKeyed, this).onSync("upKeyed", onUpKeyed, this).onSync("downKeyed", onDownKeyed, this).onSync("leftKeyed", onLeftKeyed, this).onSync("rightKeyed", onRightKeyed, this).onSync("queryChanged", onQueryChanged, this).onSync("whitespaceChanged", onWhitespaceChanged, this).onSync("langDirChanged", this._onLangDirChanged, this); + } + _.mixin(Typeahead.prototype, { + _hacks: function hacks() { + var $input, $menu; + $input = this.input.$input || $("
    "); + $menu = this.menu.$node || $("
    "); + $input.on("blur.tt", function($e) { + var active, isActive, hasActive; + active = document.activeElement; + isActive = $menu.is(active); + hasActive = $menu.has(active).length > 0; + if (_.isMsie() && (isActive || hasActive)) { + $e.preventDefault(); + $e.stopImmediatePropagation(); + _.defer(function() { + $input.focus(); + }); + } + }); + $menu.on("mousedown.tt", function($e) { + $e.preventDefault(); + }); + }, + _onSelectableClicked: function onSelectableClicked(type, $el) { + this.select($el); + }, + _onDatasetCleared: function onDatasetCleared() { + this._updateHint(); + }, + _onDatasetRendered: function onDatasetRendered(type, dataset, suggestions, async) { + this._updateHint(); + this.eventBus.trigger("render", suggestions, async, dataset); + }, + _onAsyncRequested: function onAsyncRequested(type, dataset, query) { + this.eventBus.trigger("asyncrequest", query, dataset); + }, + _onAsyncCanceled: function onAsyncCanceled(type, dataset, query) { + this.eventBus.trigger("asynccancel", query, dataset); + }, + _onAsyncReceived: function onAsyncReceived(type, dataset, query) { + this.eventBus.trigger("asyncreceive", query, dataset); + }, + _onFocused: function onFocused() { + this._minLengthMet() && this.menu.update(this.input.getQuery()); + }, + _onBlurred: function onBlurred() { + if (this.input.hasQueryChangedSinceLastFocus()) { + this.eventBus.trigger("change", this.input.getQuery()); + } + }, + _onEnterKeyed: function onEnterKeyed(type, $e) { + var $selectable; + if ($selectable = this.menu.getActiveSelectable()) { + this.select($selectable) && $e.preventDefault(); + } + }, + _onTabKeyed: function onTabKeyed(type, $e) { + var $selectable; + if ($selectable = this.menu.getActiveSelectable()) { + this.select($selectable) && $e.preventDefault(); + } else if ($selectable = this.menu.getTopSelectable()) { + this.autocomplete($selectable) && $e.preventDefault(); + } + }, + _onEscKeyed: function onEscKeyed() { + this.close(); + }, + _onUpKeyed: function onUpKeyed() { + this.moveCursor(-1); + }, + _onDownKeyed: function onDownKeyed() { + this.moveCursor(+1); + }, + _onLeftKeyed: function onLeftKeyed() { + if (this.dir === "rtl" && this.input.isCursorAtEnd()) { + this.autocomplete(this.menu.getTopSelectable()); + } + }, + _onRightKeyed: function onRightKeyed() { + if (this.dir === "ltr" && this.input.isCursorAtEnd()) { + this.autocomplete(this.menu.getTopSelectable()); + } + }, + _onQueryChanged: function onQueryChanged(e, query) { + this._minLengthMet(query) ? this.menu.update(query) : this.menu.empty(); + }, + _onWhitespaceChanged: function onWhitespaceChanged() { + this._updateHint(); + }, + _onLangDirChanged: function onLangDirChanged(e, dir) { + if (this.dir !== dir) { + this.dir = dir; + this.menu.setLanguageDirection(dir); + } + }, + _openIfActive: function openIfActive() { + this.isActive() && this.open(); + }, + _minLengthMet: function minLengthMet(query) { + query = _.isString(query) ? query : this.input.getQuery() || ""; + return query.length >= this.minLength; + }, + _updateHint: function updateHint() { + var $selectable, data, val, query, escapedQuery, frontMatchRegEx, match; + $selectable = this.menu.getTopSelectable(); + data = this.menu.getSelectableData($selectable); + val = this.input.getInputValue(); + if (data && !_.isBlankString(val) && !this.input.hasOverflow()) { + query = Input.normalizeQuery(val); + escapedQuery = _.escapeRegExChars(query); + frontMatchRegEx = new RegExp("^(?:" + escapedQuery + ")(.+$)", "i"); + match = frontMatchRegEx.exec(data.val); + match && this.input.setHint(val + match[1]); + } else { + this.input.clearHint(); + } + }, + isEnabled: function isEnabled() { + return this.enabled; + }, + enable: function enable() { + this.enabled = true; + }, + disable: function disable() { + this.enabled = false; + }, + isActive: function isActive() { + return this.active; + }, + activate: function activate() { + if (this.isActive()) { + return true; + } else if (!this.isEnabled() || this.eventBus.before("active")) { + return false; + } else { + this.active = true; + this.eventBus.trigger("active"); + return true; + } + }, + deactivate: function deactivate() { + if (!this.isActive()) { + return true; + } else if (this.eventBus.before("idle")) { + return false; + } else { + this.active = false; + this.close(); + this.eventBus.trigger("idle"); + return true; + } + }, + isOpen: function isOpen() { + return this.menu.isOpen(); + }, + open: function open() { + if (!this.isOpen() && !this.eventBus.before("open")) { + this.menu.open(); + this._updateHint(); + this.eventBus.trigger("open"); + } + return this.isOpen(); + }, + close: function close() { + if (this.isOpen() && !this.eventBus.before("close")) { + this.menu.close(); + this.input.clearHint(); + this.input.resetInputValue(); + this.eventBus.trigger("close"); + } + return !this.isOpen(); + }, + setVal: function setVal(val) { + this.input.setQuery(_.toStr(val)); + }, + getVal: function getVal() { + return this.input.getQuery(); + }, + select: function select($selectable) { + var data = this.menu.getSelectableData($selectable); + if (data && !this.eventBus.before("select", data.obj)) { + this.input.setQuery(data.val, true); + this.eventBus.trigger("select", data.obj); + this.close(); + return true; + } + return false; + }, + autocomplete: function autocomplete($selectable) { + var query, data, isValid; + query = this.input.getQuery(); + data = this.menu.getSelectableData($selectable); + isValid = data && query !== data.val; + if (isValid && !this.eventBus.before("autocomplete", data.obj)) { + this.input.setQuery(data.val); + this.eventBus.trigger("autocomplete", data.obj); + return true; + } + return false; + }, + moveCursor: function moveCursor(delta) { + var query, $candidate, data, payload, cancelMove; + query = this.input.getQuery(); + $candidate = this.menu.selectableRelativeToCursor(delta); + data = this.menu.getSelectableData($candidate); + payload = data ? data.obj : null; + cancelMove = this._minLengthMet() && this.menu.update(query); + if (!cancelMove && !this.eventBus.before("cursorchange", payload)) { + this.menu.setCursor($candidate); + if (data) { + this.input.setInputValue(data.val); + } else { + this.input.resetInputValue(); + this._updateHint(); + } + this.eventBus.trigger("cursorchange", payload); + return true; + } + return false; + }, + destroy: function destroy() { + this.input.destroy(); + this.menu.destroy(); + } + }); + return Typeahead; + function c(ctx) { + var methods = [].slice.call(arguments, 1); + return function() { + var args = [].slice.call(arguments); + _.each(methods, function(method) { + return ctx[method].apply(ctx, args); + }); + }; + } + }(); + (function() { + "use strict"; + var old, keys, methods; + old = $.fn.typeahead; + keys = { + www: "tt-www", + attrs: "tt-attrs", + typeahead: "tt-typeahead" + }; + methods = { + initialize: function initialize(o, datasets) { + var www; + datasets = _.isArray(datasets) ? datasets : [].slice.call(arguments, 1); + o = o || {}; + www = WWW(o.classNames); + return this.each(attach); + function attach() { + var $input, $wrapper, $hint, $menu, defaultHint, defaultMenu, eventBus, input, menu, typeahead, MenuConstructor; + _.each(datasets, function(d) { + d.highlight = !!o.highlight; + }); + $input = $(this); + $wrapper = $(www.html.wrapper); + $hint = $elOrNull(o.hint); + $menu = $elOrNull(o.menu); + defaultHint = o.hint !== false && !$hint; + defaultMenu = o.menu !== false && !$menu; + defaultHint && ($hint = buildHintFromInput($input, www)); + defaultMenu && ($menu = $(www.html.menu).css(www.css.menu)); + $hint && $hint.val(""); + $input = prepInput($input, www); + if (defaultHint || defaultMenu) { + $wrapper.css(www.css.wrapper); + $input.css(defaultHint ? www.css.input : www.css.inputWithNoHint); + $input.wrap($wrapper).parent().prepend(defaultHint ? $hint : null).append(defaultMenu ? $menu : null); + } + MenuConstructor = defaultMenu ? DefaultMenu : Menu; + eventBus = new EventBus({ + el: $input + }); + input = new Input({ + hint: $hint, + input: $input + }, www); + menu = new MenuConstructor({ + node: $menu, + datasets: datasets + }, www); + typeahead = new Typeahead({ + input: input, + menu: menu, + eventBus: eventBus, + minLength: o.minLength + }, www); + $input.data(keys.www, www); + $input.data(keys.typeahead, typeahead); + } + }, + isEnabled: function isEnabled() { + var enabled; + ttEach(this.first(), function(t) { + enabled = t.isEnabled(); + }); + return enabled; + }, + enable: function enable() { + ttEach(this, function(t) { + t.enable(); + }); + return this; + }, + disable: function disable() { + ttEach(this, function(t) { + t.disable(); + }); + return this; + }, + isActive: function isActive() { + var active; + ttEach(this.first(), function(t) { + active = t.isActive(); + }); + return active; + }, + activate: function activate() { + ttEach(this, function(t) { + t.activate(); + }); + return this; + }, + deactivate: function deactivate() { + ttEach(this, function(t) { + t.deactivate(); + }); + return this; + }, + isOpen: function isOpen() { + var open; + ttEach(this.first(), function(t) { + open = t.isOpen(); + }); + return open; + }, + open: function open() { + ttEach(this, function(t) { + t.open(); + }); + return this; + }, + close: function close() { + ttEach(this, function(t) { + t.close(); + }); + return this; + }, + select: function select(el) { + var success = false, $el = $(el); + ttEach(this.first(), function(t) { + success = t.select($el); + }); + return success; + }, + autocomplete: function autocomplete(el) { + var success = false, $el = $(el); + ttEach(this.first(), function(t) { + success = t.autocomplete($el); + }); + return success; + }, + moveCursor: function moveCursoe(delta) { + var success = false; + ttEach(this.first(), function(t) { + success = t.moveCursor(delta); + }); + return success; + }, + val: function val(newVal) { + var query; + if (!arguments.length) { + ttEach(this.first(), function(t) { + query = t.getVal(); + }); + return query; + } else { + ttEach(this, function(t) { + t.setVal(newVal); + }); + return this; + } + }, + destroy: function destroy() { + ttEach(this, function(typeahead, $input) { + revert($input); + typeahead.destroy(); + }); + return this; + } + }; + $.fn.typeahead = function(method) { + if (methods[method]) { + return methods[method].apply(this, [].slice.call(arguments, 1)); + } else { + return methods.initialize.apply(this, arguments); + } + }; + $.fn.typeahead.noConflict = function noConflict() { + $.fn.typeahead = old; + return this; + }; + function ttEach($els, fn) { + $els.each(function() { + var $input = $(this), typeahead; + (typeahead = $input.data(keys.typeahead)) && fn(typeahead, $input); + }); + } + function buildHintFromInput($input, www) { + return $input.clone().addClass(www.classes.hint).removeData().css(www.css.hint).css(getBackgroundStyles($input)).prop("readonly", true).removeAttr("id name placeholder required").attr({ + autocomplete: "off", + spellcheck: "false", + tabindex: -1 + }); + } + function prepInput($input, www) { + $input.data(keys.attrs, { + dir: $input.attr("dir"), + autocomplete: $input.attr("autocomplete"), + spellcheck: $input.attr("spellcheck"), + style: $input.attr("style") + }); + $input.addClass(www.classes.input).attr({ + autocomplete: "off", + spellcheck: false + }); + try { + !$input.attr("dir") && $input.attr("dir", "auto"); + } catch (e) {} + return $input; + } + function getBackgroundStyles($el) { + return { + backgroundAttachment: $el.css("background-attachment"), + backgroundClip: $el.css("background-clip"), + backgroundColor: $el.css("background-color"), + backgroundImage: $el.css("background-image"), + backgroundOrigin: $el.css("background-origin"), + backgroundPosition: $el.css("background-position"), + backgroundRepeat: $el.css("background-repeat"), + backgroundSize: $el.css("background-size") + }; + } + function revert($input) { + var www, $wrapper; + www = $input.data(keys.www); + $wrapper = $input.parent().filter(www.selectors.wrapper); + _.each($input.data(keys.attrs), function(val, key) { + _.isUndefined(val) ? $input.removeAttr(key) : $input.attr(key, val); + }); + $input.removeData(keys.typeahead).removeData(keys.www).removeData(keys.attr).removeClass(www.classes.input); + if ($wrapper.length) { + $input.detach().insertAfter($wrapper); + $wrapper.remove(); + } + } + function $elOrNull(obj) { + var isValid, $el; + isValid = _.isJQuery(obj) || _.isElement(obj); + $el = isValid ? $(obj).first() : []; + return $el.length ? $el : null; + } + })(); +}); \ No newline at end of file diff --git a/docs/search.json b/docs/search.json new file mode 100644 index 00000000..6c9f1b12 --- /dev/null +++ b/docs/search.json @@ -0,0 +1 @@ +{"Structs/ZlibHeader/CompressionLevel.html#/s:FOV13SWCompression10ZlibHeader16CompressionLevel16fastestAlgorithmFMS1_S1_":{"name":"fastestAlgorithm","abstract":"

    Fastest algorithm.

    ","parent_name":"CompressionLevel"},"Structs/ZlibHeader/CompressionLevel.html#/s:FOV13SWCompression10ZlibHeader16CompressionLevel13fastAlgorithmFMS1_S1_":{"name":"fastAlgorithm","abstract":"

    Fast algorithm.

    ","parent_name":"CompressionLevel"},"Structs/ZlibHeader/CompressionLevel.html#/s:FOV13SWCompression10ZlibHeader16CompressionLevel16defaultAlgorithmFMS1_S1_":{"name":"defaultAlgorithm","abstract":"

    Default algorithm.

    ","parent_name":"CompressionLevel"},"Structs/ZlibHeader/CompressionLevel.html#/s:FOV13SWCompression10ZlibHeader16CompressionLevel13slowAlgorithmFMS1_S1_":{"name":"slowAlgorithm","abstract":"

    Slowest algorithm but with maximum compression.

    ","parent_name":"CompressionLevel"},"Structs/ZlibHeader/CompressionMethod.html#/s:FOV13SWCompression10ZlibHeader17CompressionMethod7deflateFMS1_S1_":{"name":"deflate","abstract":"

    The only one supported compression method (Deflate).

    ","parent_name":"CompressionMethod"},"Structs/ZlibHeader/CompressionMethod.html":{"name":"CompressionMethod","abstract":"

    Supported compression methods in zlib archive.

    ","parent_name":"ZlibHeader"},"Structs/ZlibHeader/CompressionLevel.html":{"name":"CompressionLevel","abstract":"

    Levels of compression which can be used to create zlib archive.

    ","parent_name":"ZlibHeader"},"Structs/ZlibHeader.html#/s:vV13SWCompression10ZlibHeader17compressionMethodOS0_17CompressionMethod":{"name":"compressionMethod","abstract":"

    Compression method of archive. Always equals to .deflate.

    ","parent_name":"ZlibHeader"},"Structs/ZlibHeader.html#/s:vV13SWCompression10ZlibHeader16compressionLevelOS0_16CompressionLevel":{"name":"compressionLevel","abstract":"

    Level of compression in the archive.

    ","parent_name":"ZlibHeader"},"Structs/ZlibHeader.html#/s:vV13SWCompression10ZlibHeader10windowSizeSi":{"name":"windowSize","abstract":"

    Size of ‘window’: moving interval of data which was used to make the archive

    ","parent_name":"ZlibHeader"},"Structs/ZlibHeader.html#/s:FV13SWCompression10ZlibHeadercFzT11archiveDataV10Foundation4Data_S0_":{"name":"init(archiveData:)","abstract":"

    Initializes the structure with the values from zlib archive presented in archiveData.

    ","parent_name":"ZlibHeader"},"Structs/ZipEntry.html#/s:vV13SWCompression8ZipEntry8fileNameGSqSS_":{"name":"fileName","abstract":"Undocumented","parent_name":"ZipEntry"},"Structs/ZipEntry.html#/s:vV13SWCompression8ZipEntry11fileCommentGSqSS_":{"name":"fileComment","abstract":"Undocumented","parent_name":"ZipEntry"},"Structs/ZipEntry.html#/s:vV13SWCompression8ZipEntry14fileAttributesVs6UInt32":{"name":"fileAttributes","abstract":"Undocumented","parent_name":"ZipEntry"},"Structs/GzipHeader/FileSystemType.html#/s:FOV13SWCompression10GzipHeader14FileSystemType4unixFMS1_S1_":{"name":"unix","abstract":"

    One of many Linux systems. (It seems like modern macOS systems also fall into this category).

    ","parent_name":"FileSystemType"},"Structs/GzipHeader/FileSystemType.html#/s:FOV13SWCompression10GzipHeader14FileSystemType9macintoshFMS1_S1_":{"name":"macintosh","abstract":"

    Older Macintosh (Mac OS, OS X) systems.

    ","parent_name":"FileSystemType"},"Structs/GzipHeader/FileSystemType.html#/s:FOV13SWCompression10GzipHeader14FileSystemType4ntfsFMS1_S1_":{"name":"ntfs","abstract":"

    File system used in Microsoft™®© Windows™®©.

    ","parent_name":"FileSystemType"},"Structs/GzipHeader/FileSystemType.html#/s:FOV13SWCompression10GzipHeader14FileSystemType7unknownFMS1_S1_":{"name":"unknown","abstract":"

    File system was unknown to the archiver.

    ","parent_name":"FileSystemType"},"Structs/GzipHeader/FileSystemType.html#/s:FOV13SWCompression10GzipHeader14FileSystemType5otherFMS1_S1_":{"name":"other","abstract":"

    File system was one of the rare systems..

    ","parent_name":"FileSystemType"},"Structs/GzipHeader/CompressionMethod.html#/s:FOV13SWCompression10GzipHeader17CompressionMethod7deflateFMS1_S1_":{"name":"deflate","abstract":"

    The only one supported compression method (Deflate).

    ","parent_name":"CompressionMethod"},"Structs/GzipHeader/CompressionMethod.html":{"name":"CompressionMethod","abstract":"

    Supported compression methods in gzip archive.

    ","parent_name":"GzipHeader"},"Structs/GzipHeader/FileSystemType.html":{"name":"FileSystemType","abstract":"

    Type of file system on which gzip archive was created.

    ","parent_name":"GzipHeader"},"Structs/GzipHeader.html#/s:vV13SWCompression10GzipHeader17compressionMethodOS0_17CompressionMethod":{"name":"compressionMethod","abstract":"

    Compression method of archive. Always equals to .deflate.

    ","parent_name":"GzipHeader"},"Structs/GzipHeader.html#/s:vV13SWCompression10GzipHeader16modificationTimeV10Foundation4Date":{"name":"modificationTime","abstract":"

    The most recent modification time of the original file.

    ","parent_name":"GzipHeader"},"Structs/GzipHeader.html#/s:vV13SWCompression10GzipHeader6osTypeOS0_14FileSystemType":{"name":"osType","abstract":"

    Type of file system on which compression took place.

    ","parent_name":"GzipHeader"},"Structs/GzipHeader.html#/s:vV13SWCompression10GzipHeader16originalFileNameGSqSS_":{"name":"originalFileName","abstract":"

    Name of the original file.

    ","parent_name":"GzipHeader"},"Structs/GzipHeader.html#/s:vV13SWCompression10GzipHeader7commentGSqSS_":{"name":"comment","abstract":"

    Comment inside the archive.

    ","parent_name":"GzipHeader"},"Structs/GzipHeader.html#/s:FV13SWCompression10GzipHeadercFzT11archiveDataV10Foundation4Data_S0_":{"name":"init(archiveData:)","abstract":"

    Initializes the structure with the values of first ‘member’ in gzip archive presented in archiveData.

    ","parent_name":"GzipHeader"},"Structs/GzipHeader.html":{"name":"GzipHeader","abstract":"

    A structure which provides information about gzip archive.

    "},"Structs/ZipEntry.html":{"name":"ZipEntry","abstract":"Undocumented"},"Structs/ZlibHeader.html":{"name":"ZlibHeader","abstract":"

    A structure which provides information about zlib archive.

    "},"Protocols/DecompressionAlgorithm.html#/s:ZFP13SWCompression22DecompressionAlgorithm10decompressFzT14compressedDataV10Foundation4Data_S2_":{"name":"decompress(compressedData:)","abstract":"

    Abstract decompress function.

    ","parent_name":"DecompressionAlgorithm"},"Protocols/Archive.html#/s:ZFP13SWCompression7Archive9unarchiveFzT11archiveDataV10Foundation4Data_S2_":{"name":"unarchive(archiveData:)","abstract":"

    Abstract unarchive function.

    ","parent_name":"Archive"},"Protocols/Archive.html":{"name":"Archive","abstract":"

    Abstract archive class which supports unarchiving.

    "},"Protocols/DecompressionAlgorithm.html":{"name":"DecompressionAlgorithm","abstract":"

    Abstract decompression algorithm class which supports decompression.

    "},"Enums/XZError.html#/s:FO13SWCompression7XZError10WrongMagicFMS0_S0_":{"name":"WrongMagic","abstract":"

    Either magic number in header or footer was not equal to predefined value.

    ","parent_name":"XZError"},"Enums/XZError.html#/s:FO13SWCompression7XZError16WrongArchiveInfoFMS0_S0_":{"name":"WrongArchiveInfo","abstract":"

    One of special fields of archive had an incorrect value.

    ","parent_name":"XZError"},"Enums/XZError.html#/s:FO13SWCompression7XZError18FieldReservedValueFMS0_S0_":{"name":"FieldReservedValue","abstract":"

    One of special fields of archive had a reserved value.

    ","parent_name":"XZError"},"Enums/XZError.html#/s:FO13SWCompression7XZError12WrongInfoCRCFMS0_S0_":{"name":"WrongInfoCRC","abstract":"

    Checksum of one of special fields of archive was incorrect.

    ","parent_name":"XZError"},"Enums/XZError.html#/s:FO13SWCompression7XZError13WrongFilterIDFMS0_S0_":{"name":"WrongFilterID","abstract":"

    ID of filter(s) used in archvie was unsupported.

    ","parent_name":"XZError"},"Enums/XZError.html#/s:FO13SWCompression7XZError15CheckTypeSHA256FMS0_S0_":{"name":"CheckTypeSHA256","abstract":"

    Type of checksum of archive was SHA-256.

    ","parent_name":"XZError"},"Enums/XZError.html#/s:FO13SWCompression7XZError13WrongDataSizeFMS0_S0_":{"name":"WrongDataSize","abstract":"

    Either size of decompressed data was not equal to specified one in block header or","parent_name":"XZError"},"Enums/XZError.html#/s:FO13SWCompression7XZError10WrongCheckFMS0_FV10Foundation4DataS0_":{"name":"WrongCheck","abstract":"

    Computed checksum of uncompressed data didn’t match the value stored in the archive.","parent_name":"XZError"},"Enums/XZError.html#/s:FO13SWCompression7XZError12WrongPaddingFMS0_S0_":{"name":"WrongPadding","abstract":"

    Unsupported padding of a structure in the archive.

    ","parent_name":"XZError"},"Enums/XZError.html#/s:FO13SWCompression7XZError21MultiByteIntegerErrorFMS0_S0_":{"name":"MultiByteIntegerError","abstract":"

    Either null byte encountered or exceeded maximum amount bytes during reading multi byte number.

    ","parent_name":"XZError"},"Enums/BZip2Error.html#/s:FO13SWCompression10BZip2Error10WrongMagicFMS0_S0_":{"name":"WrongMagic","abstract":"

    Magic number was not 0x425a.

    ","parent_name":"BZip2Error"},"Enums/BZip2Error.html#/s:FO13SWCompression10BZip2Error22WrongCompressionMethodFMS0_S0_":{"name":"WrongCompressionMethod","abstract":"

    Compression method was not type ‘h’ (not Huffman).

    ","parent_name":"BZip2Error"},"Enums/BZip2Error.html#/s:FO13SWCompression10BZip2Error14WrongBlockSizeFMS0_S0_":{"name":"WrongBlockSize","abstract":"

    Unknown block size (not from ‘0’ to ‘9’).

    ","parent_name":"BZip2Error"},"Enums/BZip2Error.html#/s:FO13SWCompression10BZip2Error14WrongBlockTypeFMS0_S0_":{"name":"WrongBlockType","abstract":"

    Unknown block type (was neither ‘pi’ nor ‘sqrt(pi)’).

    ","parent_name":"BZip2Error"},"Enums/BZip2Error.html#/s:FO13SWCompression10BZip2Error15RandomizedBlockFMS0_S0_":{"name":"RandomizedBlock","abstract":"

    Block is randomized.

    ","parent_name":"BZip2Error"},"Enums/BZip2Error.html#/s:FO13SWCompression10BZip2Error18WrongHuffmanGroupsFMS0_S0_":{"name":"WrongHuffmanGroups","abstract":"

    Wrong number of Huffman tables/groups (should be between 2 and 6).

    ","parent_name":"BZip2Error"},"Enums/BZip2Error.html#/s:FO13SWCompression10BZip2Error13WrongSelectorFMS0_S0_":{"name":"WrongSelector","abstract":"

    Selector was greater than total number of Huffman tables/groups.

    ","parent_name":"BZip2Error"},"Enums/BZip2Error.html#/s:FO13SWCompression10BZip2Error22WrongHuffmanLengthCodeFMS0_S0_":{"name":"WrongHuffmanLengthCode","abstract":"

    Wrong code of Huffman length (should be between 0 and 20).

    ","parent_name":"BZip2Error"},"Enums/BZip2Error.html#/s:FO13SWCompression10BZip2Error14SymbolNotFoundFMS0_S0_":{"name":"SymbolNotFound","abstract":"

    Symbol was not found in Huffman tree.

    ","parent_name":"BZip2Error"},"Enums/DeflateError.html#/s:FO13SWCompression12DeflateError29WrongUncompressedBlockLengthsFMS0_S0_":{"name":"WrongUncompressedBlockLengths","abstract":"

    Uncompressed block’ length and nlength bytes were not compatible.

    ","parent_name":"DeflateError"},"Enums/DeflateError.html#/s:FO13SWCompression12DeflateError14WrongBlockTypeFMS0_S0_":{"name":"WrongBlockType","abstract":"

    Unknown block type (not from 0 to 2).

    ","parent_name":"DeflateError"},"Enums/DeflateError.html#/s:FO13SWCompression12DeflateError11WrongSymbolFMS0_S0_":{"name":"WrongSymbol","abstract":"

    Decoded symbol was found in Huffman tree but is unknown.

    ","parent_name":"DeflateError"},"Enums/DeflateError.html#/s:FO13SWCompression12DeflateError14SymbolNotFoundFMS0_S0_":{"name":"SymbolNotFound","abstract":"

    Symbol was not found in Huffman tree.

    ","parent_name":"DeflateError"},"Enums/ZlibError.html#/s:FO13SWCompression9ZlibError22WrongCompressionMethodFMS0_S0_":{"name":"WrongCompressionMethod","abstract":"

    Compression method was other than 8 which is the only supported one.

    ","parent_name":"ZlibError"},"Enums/ZlibError.html#/s:FO13SWCompression9ZlibError20WrongCompressionInfoFMS0_S0_":{"name":"WrongCompressionInfo","abstract":"

    Compression info was greater than 7 which is uncompatible number 8 compression method.

    ","parent_name":"ZlibError"},"Enums/ZlibError.html#/s:FO13SWCompression9ZlibError11WrongFcheckFMS0_S0_":{"name":"WrongFcheck","abstract":"

    First two bytes were inconsistent with each other.

    ","parent_name":"ZlibError"},"Enums/ZlibError.html#/s:FO13SWCompression9ZlibError21WrongCompressionLevelFMS0_S0_":{"name":"WrongCompressionLevel","abstract":"

    Compression level was other than 0, 1, 2, 3.

    ","parent_name":"ZlibError"},"Enums/ZlibError.html#/s:FO13SWCompression9ZlibError12WrongAdler32FMS0_FV10Foundation4DataS0_":{"name":"WrongAdler32","abstract":"

    Computed Adler-32 sum of uncompressed data didn’t match the value stored in the archive.","parent_name":"ZlibError"},"Enums/LZMAError.html#/s:FO13SWCompression9LZMAError15WrongPropertiesFMS0_S0_":{"name":"WrongProperties","abstract":"

    Properties byte was greater than 225.

    ","parent_name":"LZMAError"},"Enums/LZMAError.html#/s:FO13SWCompression9LZMAError21RangeDecoderInitErrorFMS0_S0_":{"name":"RangeDecoderInitError","abstract":"

    Unable to initialize RanderDecorer.

    ","parent_name":"LZMAError"},"Enums/LZMAError.html#/s:FO13SWCompression9LZMAError24ExceededUncompressedSizeFMS0_S0_":{"name":"ExceededUncompressedSize","abstract":"

    The number of uncompressed bytes hit limit in the middle of decoding.

    ","parent_name":"LZMAError"},"Enums/LZMAError.html#/s:FO13SWCompression9LZMAError13WindowIsEmptyFMS0_S0_":{"name":"WindowIsEmpty","abstract":"

    Unable to perfrom repeat-distance decoding because there is nothing to repeat.

    ","parent_name":"LZMAError"},"Enums/LZMAError.html#/s:FO13SWCompression9LZMAError23RangeDecoderFinishErrorFMS0_S0_":{"name":"RangeDecoderFinishError","abstract":"

    End of stream marker is reached, but range decoder is in incorrect state.

    ","parent_name":"LZMAError"},"Enums/LZMAError.html#/s:FO13SWCompression9LZMAError16RepeatWillExceedFMS0_S0_":{"name":"RepeatWillExceed","abstract":"

    The number of bytes to repeat is greater than the amount bytes that is left to decode.

    ","parent_name":"LZMAError"},"Enums/LZMAError.html#/s:FO13SWCompression9LZMAError17NotEnoughToRepeatFMS0_S0_":{"name":"NotEnoughToRepeat","abstract":"

    The amount of already decoded bytes is smaller than repeat length.

    ","parent_name":"LZMAError"},"Enums/ZipError.html#/s:FO13SWCompression8ZipError27NotFoundCentralDirectoryEndFMS0_S0_":{"name":"NotFoundCentralDirectoryEnd","abstract":"

    End of Central Directoty record was not found.

    ","parent_name":"ZipError"},"Enums/ZipError.html#/s:FO13SWCompression8ZipError14WrongSignatureFMS0_S0_":{"name":"WrongSignature","abstract":"

    Wrong signature of one of ZIP container’s structures.

    ","parent_name":"ZipError"},"Enums/ZipError.html#/s:FO13SWCompression8ZipError9WrongSizeFMS0_S0_":{"name":"WrongSize","abstract":"

    Wrong either compressed or uncompressed size of a ZIP container’s entry.

    ","parent_name":"ZipError"},"Enums/ZipError.html#/s:FO13SWCompression8ZipError12WrongVersionFMS0_S0_":{"name":"WrongVersion","abstract":"

    Wrong number of version needed to extract ZIP container.

    ","parent_name":"ZipError"},"Enums/ZipError.html#/s:FO13SWCompression8ZipError24MultiVolumesNotSupportedFMS0_S0_":{"name":"MultiVolumesNotSupported","abstract":"

    Archive either spanned or consists of several volumes. This feature is not supported.

    ","parent_name":"ZipError"},"Enums/ZipError.html#/s:FO13SWCompression8ZipError22EncryptionNotSupportedFMS0_S0_":{"name":"EncryptionNotSupported","abstract":"

    Entry or record is encrypted. This feature is not supported.

    ","parent_name":"ZipError"},"Enums/ZipError.html#/s:FO13SWCompression8ZipError20PatchingNotSupportedFMS0_S0_":{"name":"PatchingNotSupported","abstract":"

    Entry contains patched data. This feature is not supported.

    ","parent_name":"ZipError"},"Enums/ZipError.html#/s:FO13SWCompression8ZipError23CompressionNotSupportedFMS0_S0_":{"name":"CompressionNotSupported","abstract":"

    Wrong compression method of an entry.

    ","parent_name":"ZipError"},"Enums/ZipError.html#/s:FO13SWCompression8ZipError16WrongLocalHeaderFMS0_S0_":{"name":"WrongLocalHeader","abstract":"

    Wrong local header of an entry.

    ","parent_name":"ZipError"},"Enums/ZipError.html#/s:FO13SWCompression8ZipError10WrongCRC32FMS0_S0_":{"name":"WrongCRC32","abstract":"

    Wrong computed CRC32 of an entry.

    ","parent_name":"ZipError"},"Enums/GzipError.html#/s:FO13SWCompression9GzipError10WrongMagicFMS0_S0_":{"name":"WrongMagic","abstract":"

    First two bytes of archive were not 31 and 139.

    ","parent_name":"GzipError"},"Enums/GzipError.html#/s:FO13SWCompression9GzipError22WrongCompressionMethodFMS0_S0_":{"name":"WrongCompressionMethod","abstract":"

    Compression method was other than 8 which is the only supported one.

    ","parent_name":"GzipError"},"Enums/GzipError.html#/s:FO13SWCompression9GzipError10WrongFlagsFMS0_S0_":{"name":"WrongFlags","abstract":"

    Reserved flags bits were not equal to 0.

    ","parent_name":"GzipError"},"Enums/GzipError.html#/s:FO13SWCompression9GzipError14WrongHeaderCRCFMS0_S0_":{"name":"WrongHeaderCRC","abstract":"

    Computed CRC of header didn’t match the value stored in the archive.

    ","parent_name":"GzipError"},"Enums/GzipError.html#/s:FO13SWCompression9GzipError8WrongCRCFMS0_FV10Foundation4DataS0_":{"name":"WrongCRC","abstract":"

    Computed CRC of uncompressed data didn’t match the value stored in the archive.","parent_name":"GzipError"},"Enums/GzipError.html#/s:FO13SWCompression9GzipError10WrongISizeFMS0_S0_":{"name":"WrongISize","abstract":"

    Computed isize didn’t match the value stored in the archive.

    ","parent_name":"GzipError"},"Enums/LZMA2Error.html#/s:FO13SWCompression10LZMA2Error15WrongPropertiesFMS0_S0_":{"name":"WrongProperties","abstract":"

    Reserved bits of LZMA2 properties byte were not equal to zero.

    ","parent_name":"LZMA2Error"},"Enums/LZMA2Error.html#/s:FO13SWCompression10LZMA2Error19WrongDictionarySizeFMS0_S0_":{"name":"WrongDictionarySize","abstract":"

    Dictionary size was too big.

    ","parent_name":"LZMA2Error"},"Enums/LZMA2Error.html#/s:FO13SWCompression10LZMA2Error16WrongControlByteFMS0_S0_":{"name":"WrongControlByte","abstract":"

    Unknown conrol byte value of LZMA2 packet.

    ","parent_name":"LZMA2Error"},"Enums/LZMA2Error.html#/s:FO13SWCompression10LZMA2Error10WrongResetFMS0_S0_":{"name":"WrongReset","abstract":"

    Unknown reset instruction encounetered in LZMA2 packet.

    ","parent_name":"LZMA2Error"},"Enums/LZMA2Error.html#/s:FO13SWCompression10LZMA2Error10WrongSizesFMS0_S0_":{"name":"WrongSizes","abstract":"

    Either size of decompressed data was not equal to specified one in LZMA2 packet or","parent_name":"LZMA2Error"},"Enums/LZMA2Error.html":{"name":"LZMA2Error","abstract":"

    Error happened during LZMA2 decompression."},"Enums/GzipError.html":{"name":"GzipError","abstract":"

    Error happened during unarchiving gzip archive."},"Enums/ZipError.html":{"name":"ZipError","abstract":"

    Error happened during processing ZIP archive (container)."},"Enums/LZMAError.html":{"name":"LZMAError","abstract":"

    Error happened during LZMA decompression."},"Enums/ZlibError.html":{"name":"ZlibError","abstract":"

    Error happened during unarchiving Zlib archive."},"Enums/DeflateError.html":{"name":"DeflateError","abstract":"

    Error happened during deflate decompression."},"Enums/BZip2Error.html":{"name":"BZip2Error","abstract":"

    Error happened during bzip2 decompression."},"Enums/XZError.html":{"name":"XZError","abstract":"

    Error happened during unarchiving XZ archive."},"Classes/XZArchive.html#/s:ZFC13SWCompression9XZArchive9unarchiveFzT11archiveDataV10Foundation4Data_S2_":{"name":"unarchive(archiveData:)","abstract":"

    Unarchives xz archive stored in archiveData.

    ","parent_name":"XZArchive"},"Classes/BZip2.html#/s:ZFC13SWCompression5BZip210decompressFzT14compressedDataV10Foundation4Data_S2_":{"name":"decompress(compressedData:)","abstract":"

    Decompresses compressedData with BZip2 algortihm.

    ","parent_name":"BZip2"},"Classes/Deflate.html#/s:ZFC13SWCompression7Deflate10decompressFzT14compressedDataV10Foundation4Data_S2_":{"name":"decompress(compressedData:)","abstract":"

    Decompresses compressedData with DEFLATE algortihm.

    ","parent_name":"Deflate"},"Classes/Deflate.html#/s:ZFC13SWCompression7Deflate8compressFzT4dataV10Foundation4Data_S2_":{"name":"compress(data:)","abstract":"Undocumented","parent_name":"Deflate"},"Classes/ZlibArchive.html#/s:ZFC13SWCompression11ZlibArchive9unarchiveFzT11archiveDataV10Foundation4Data_S2_":{"name":"unarchive(archiveData:)","abstract":"

    Unarchives Zlib archive stored in archiveData.

    ","parent_name":"ZlibArchive"},"Classes/LZMA.html#/s:ZFC13SWCompression4LZMA10decompressFzT14compressedDataV10Foundation4Data_S2_":{"name":"decompress(compressedData:)","abstract":"

    Decompresses compressedData with LZMA algortihm.

    ","parent_name":"LZMA"},"Classes/ZipContainer.html#/s:vC13SWCompression12ZipContainer7entriesGSaVS_8ZipEntry_":{"name":"entries","abstract":"Undocumented","parent_name":"ZipContainer"},"Classes/ZipContainer.html#/s:FC13SWCompression12ZipContainercFzT13containerDataV10Foundation4Data_S0_":{"name":"init(containerData:)","abstract":"Undocumented","parent_name":"ZipContainer"},"Classes/ZipContainer.html#/s:FC13SWCompression12ZipContainer4dataFzT3forVS_8ZipEntry_V10Foundation4Data":{"name":"data(for:)","abstract":"Undocumented","parent_name":"ZipContainer"},"Classes/ZipContainer.html#/s:ZFC13SWCompression12ZipContainer4openFzT13containerDataV10Foundation4Data_GSaT9entryNameSS9entryDataS2___":{"name":"open(containerData:)","abstract":"

    Processes ZIP archive (container) and returns an array of tuples (String, Data).","parent_name":"ZipContainer"},"Classes/GzipArchive.html#/s:ZFC13SWCompression11GzipArchive9unarchiveFzT11archiveDataV10Foundation4Data_S2_":{"name":"unarchive(archiveData:)","abstract":"

    Unarchives gzip archive stored in archiveData.

    ","parent_name":"GzipArchive"},"Classes/LZMA2.html#/s:ZFC13SWCompression5LZMA210decompressFzT14compressedDataV10Foundation4Data_S2_":{"name":"decompress(compressedData:)","abstract":"

    Decompresses compressedData with LZMA2 algortihm. LZMA2 is a modification of LZMA.

    ","parent_name":"LZMA2"},"Classes/LZMA2.html":{"name":"LZMA2","abstract":"

    Provides function to decompress data, which were compressed with LZMA2

    "},"Classes/GzipArchive.html":{"name":"GzipArchive","abstract":"

    Provides unarchive function for GZip archives.

    "},"Classes/ZipContainer.html":{"name":"ZipContainer","abstract":"

    Provides function to open ZIP archives (containers).

    "},"Classes/LZMA.html":{"name":"LZMA","abstract":"

    Provides function to decompress data, which were compressed with LZMA

    "},"Classes/ZlibArchive.html":{"name":"ZlibArchive","abstract":"

    Provides unarchive function for Zlib archives.

    "},"Classes/Deflate.html":{"name":"Deflate","abstract":"

    Provides function to decompress data, which were compressed with DEFLATE.

    "},"Classes/BZip2.html":{"name":"BZip2","abstract":"

    Provides function to decompress data, which were compressed using BZip2.

    "},"Classes/XZArchive.html":{"name":"XZArchive","abstract":"

    Provides unarchive function for XZ archives.

    "},"Classes.html":{"name":"Classes","abstract":"The following classes are available globally."},"Enums.html":{"name":"Enums","abstract":"The following enums are available globally."},"Protocols.html":{"name":"Protocols","abstract":"The following protocols are available globally."},"Structs.html":{"name":"Structs","abstract":"The following structs are available globally."}} \ No newline at end of file diff --git a/docs/undocumented.json b/docs/undocumented.json index 1862018e..704c4204 100644 --- a/docs/undocumented.json +++ b/docs/undocumented.json @@ -1,6 +1,61 @@ { "warnings": [ - + { + "file": "/Users/timofeysolomko/Developer/SWCompression/Sources/Deflate.swift", + "line": 228, + "symbol": "Deflate.compress(data:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/timofeysolomko/Developer/SWCompression/Sources/ZipContainer.swift", + "line": 50, + "symbol": "ZipEntry", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/timofeysolomko/Developer/SWCompression/Sources/ZipContainer.swift", + "line": 54, + "symbol": "ZipEntry.fileName", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/timofeysolomko/Developer/SWCompression/Sources/ZipContainer.swift", + "line": 58, + "symbol": "ZipEntry.fileComment", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/timofeysolomko/Developer/SWCompression/Sources/ZipContainer.swift", + "line": 62, + "symbol": "ZipEntry.fileAttributes", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/timofeysolomko/Developer/SWCompression/Sources/ZipContainer.swift", + "line": 77, + "symbol": "ZipContainer.entries", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/timofeysolomko/Developer/SWCompression/Sources/ZipContainer.swift", + "line": 79, + "symbol": "ZipContainer.init(containerData:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/timofeysolomko/Developer/SWCompression/Sources/ZipContainer.swift", + "line": 110, + "symbol": "ZipContainer.data(for:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + } ], "source_directory": "/Users/timofeysolomko/Developer/SWCompression" } \ No newline at end of file