diff --git a/pkg/fileembed/fileembed.go b/pkg/fileembed/fileembed.go
index 8335f12ce..7d4b8a5d9 100644
--- a/pkg/fileembed/fileembed.go
+++ b/pkg/fileembed/fileembed.go
@@ -18,7 +18,6 @@ package fileembed
import (
"errors"
- "fmt"
"io"
"io/ioutil"
"net/http"
@@ -28,8 +27,6 @@ import (
"time"
)
-var binaryModTime = statBinaryModTime()
-
type Files struct {
// Optional environment variable key to override
OverrideEnv string
@@ -42,22 +39,32 @@ type Files struct {
SlurpToMemory bool
lk sync.Mutex
- file map[string]string
+ file map[string]*staticFile
+}
+
+type staticFile struct {
+ name string
+ contents string
+ modtime time.Time
}
// Add adds a file to the file set.
-func (f *Files) Add(filename, body string) {
+func (f *Files) Add(filename, contents string, modtime time.Time) {
f.lk.Lock()
defer f.lk.Unlock()
- f.add(filename, body)
+ f.add(filename, &staticFile{
+ name: filename,
+ contents: contents,
+ modtime: modtime,
+ })
}
// f.lk must be locked
-func (f *Files) add(filename, body string) {
+func (f *Files) add(filename string, sf *staticFile) {
if f.file == nil {
- f.file = make(map[string]string)
+ f.file = make(map[string]*staticFile)
}
- f.file[filename] = body
+ f.file[filename] = sf
}
func (f *Files) Open(filename string) (http.File, error) {
@@ -66,11 +73,11 @@ func (f *Files) Open(filename string) (http.File, error) {
}
f.lk.Lock()
defer f.lk.Unlock()
- s, ok := f.file[filename]
+ sf, ok := f.file[filename]
if !ok {
return f.openFallback(filename)
}
- return &file{name: filename, s: s}, nil
+ return &fileHandle{sf: sf}, nil
}
// f.lk is held
@@ -88,22 +95,29 @@ func (f *Files) openFallback(filename string) (http.File, error) {
if err != nil {
return nil, err
}
+ fi, err := of.Stat()
+
s := string(bs)
- f.add(filename, s)
- return &file{name: filename, s: s}, nil
+ sf := &staticFile{
+ name: filename,
+ contents: s,
+ modtime: fi.ModTime(),
+ }
+ f.add(filename, sf)
+ return &fileHandle{sf: sf}, nil
}
return of, nil
}
-type file struct {
- name string
- s string
-
+type fileHandle struct {
+ sf *staticFile
off int64
closed bool
}
-func (f *file) Close() error {
+var _ http.File = (*fileHandle)(nil)
+
+func (f *fileHandle) Close() error {
if f.closed {
return os.ErrInvalid
}
@@ -111,27 +125,27 @@ func (f *file) Close() error {
return nil
}
-func (f *file) Read(p []byte) (n int, err error) {
- if f.off >= int64(len(f.s)) {
+func (f *fileHandle) Read(p []byte) (n int, err error) {
+ if f.off >= int64(len(f.sf.contents)) {
return 0, io.EOF
}
- n = copy(p, f.s[f.off:])
+ n = copy(p, f.sf.contents[f.off:])
f.off += int64(n)
return
}
-func (f *file) Readdir(int) ([]os.FileInfo, error) {
+func (f *fileHandle) Readdir(int) ([]os.FileInfo, error) {
return nil, errors.New("not directory")
}
-func (f *file) Seek(offset int64, whence int) (int64, error) {
+func (f *fileHandle) Seek(offset int64, whence int) (int64, error) {
switch whence {
case os.SEEK_SET:
f.off = offset
case os.SEEK_CUR:
f.off += offset
case os.SEEK_END:
- f.off = int64(len(f.s)) + offset
+ f.off = int64(len(f.sf.contents)) + offset
default:
return 0, os.ErrInvalid
}
@@ -141,31 +155,15 @@ func (f *file) Seek(offset int64, whence int) (int64, error) {
return f.off, nil
}
-type fileInfo struct {
- name string
- size int64
- modtime time.Time
+func (f *fileHandle) Stat() (os.FileInfo, error) {
+ return f.sf, nil
}
-func (fi *fileInfo) Name() string { return fi.name }
-func (fi *fileInfo) Size() int64 { return fi.size }
-func (fi *fileInfo) Mode() os.FileMode { return 0444 }
-func (fi *fileInfo) ModTime() time.Time { return fi.modtime }
-func (fi *fileInfo) IsDir() bool { return false }
-func (fi *fileInfo) Sys() interface{} { return nil }
+var _ os.FileInfo = (*staticFile)(nil)
-func (f *file) Stat() (os.FileInfo, error) {
- return &fileInfo{
- name: f.name,
- size: int64(len(f.s)),
- modtime: binaryModTime,
- }, nil
-}
-
-func statBinaryModTime() time.Time {
- fi, err := os.Stat(os.Args[0])
- if err != nil {
- panic(fmt.Sprintf("Failed to stat binary %q: %v", os.Args[0], err))
- }
- return fi.ModTime()
-}
+func (f *staticFile) Name() string { return f.name }
+func (f *staticFile) Size() int64 { return int64(len(f.contents)) }
+func (f *staticFile) Mode() os.FileMode { return 0444 }
+func (f *staticFile) ModTime() time.Time { return f.modtime }
+func (f *staticFile) IsDir() bool { return false }
+func (f *staticFile) Sys() interface{} { return nil }
diff --git a/pkg/fileembed/genfileembed/genfileembed.go b/pkg/fileembed/genfileembed/genfileembed.go
index 9a1160e05..cdd58eace 100644
--- a/pkg/fileembed/genfileembed/genfileembed.go
+++ b/pkg/fileembed/genfileembed/genfileembed.go
@@ -49,6 +49,7 @@ func main() {
if err != nil {
log.Fatalf("Error parsing %s/fileembed.go: %v", dir, err)
}
+
for _, fileName := range matchingFiles(filePattern) {
embedName := "zembed_" + fileName + ".go"
fi, err := os.Stat(fileName)
@@ -68,7 +69,8 @@ func main() {
fmt.Fprintf(&b, "// THIS FILE IS AUTO-GENERATED FROM %s\n", fileName)
fmt.Fprintf(&b, "// DO NOT EDIT.\n")
fmt.Fprintf(&b, "package %s\n", pkgName)
- fmt.Fprintf(&b, "func init() {\n\tFiles.Add(%q, %q);\n}\n", fileName, bs)
+ fmt.Fprintf(&b, "import \"time\"\n")
+ fmt.Fprintf(&b, "func init() {\n\tFiles.Add(%q, %q, time.Unix(0, %d));\n}\n", fileName, bs, fi.ModTime().UnixNano())
if err := ioutil.WriteFile(embedName, b.Bytes(), 0644); err != nil {
log.Fatal(err)
}
diff --git a/server/camlistored/ui/zembed_Crypto.js.go b/server/camlistored/ui/zembed_Crypto.js.go
index eb01a6590..faa9491c5 100644
--- a/server/camlistored/ui/zembed_Crypto.js.go
+++ b/server/camlistored/ui/zembed_Crypto.js.go
@@ -1,6 +1,7 @@
// THIS FILE IS AUTO-GENERATED FROM Crypto.js
// DO NOT EDIT.
package ui
+import "time"
func init() {
- Files.Add("Crypto.js", "// From http://code.google.com/p/crypto-js/\r\n// License: http://www.opensource.org/licenses/bsd-license.php\r\n//\r\n// Copyright (c) 2009, Jeff Mott. All rights reserved.\r\n// \r\n// Redistribution and use in source and binary forms, with or without\r\n// modification, are permitted provided that the following conditions are met:\r\n// \r\n// Redistributions of source code must retain the above copyright notice, this\r\n// list of conditions and the following disclaimer. Redistributions in binary\r\n// form must reproduce the above copyright notice, this list of conditions and\r\n// the following disclaimer in the documentation and/or other materials provided\r\n// with the distribution. Neither the name Crypto-JS nor the names of its\r\n// contributors may be used to endorse or promote products derived from this\r\n// software without specific prior written permission. THIS SOFTWARE IS PROVIDED\r\n// BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED\r\n// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n// EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\r\n// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\r\n// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\r\n// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\r\n// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\r\n// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r\n\r\nif (typeof Crypto == \"undefined\" || ! Crypto.util)\r\n{\r\n(function(){\r\n\r\nvar base64map = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\r\n\r\n// Global Crypto object\r\nvar Crypto = window.Crypto = {};\r\n\r\n// Crypto utilities\r\nvar util = Crypto.util = {\r\n\r\n\t// Bit-wise rotate left\r\n\trotl: function (n, b) {\r\n\t\treturn (n << b) | (n >>> (32 - b));\r\n\t},\r\n\r\n\t// Bit-wise rotate right\r\n\trotr: function (n, b) {\r\n\t\treturn (n << (32 - b)) | (n >>> b);\r\n\t},\r\n\r\n\t// Swap big-endian to little-endian and vice versa\r\n\tendian: function (n) {\r\n\r\n\t\t// If number given, swap endian\r\n\t\tif (n.constructor == Number) {\r\n\t\t\treturn util.rotl(n, 8) & 0x00FF00FF |\r\n\t\t\t util.rotl(n, 24) & 0xFF00FF00;\r\n\t\t}\r\n\r\n\t\t// Else, assume array and swap all items\r\n\t\tfor (var i = 0; i < n.length; i++)\r\n\t\t\tn[i] = util.endian(n[i]);\r\n\t\treturn n;\r\n\r\n\t},\r\n\r\n\t// Generate an array of any length of random bytes\r\n\trandomBytes: function (n) {\r\n\t\tfor (var bytes = []; n > 0; n--)\r\n\t\t\tbytes.push(Math.floor(Math.random() * 256));\r\n\t\treturn bytes;\r\n\t},\r\n\r\n\t// Convert a byte array to big-endian 32-bit words\r\n\tbytesToWords: function (bytes) {\r\n\t\tfor (var words = [], i = 0, b = 0; i < bytes.length; i++, b += 8)\r\n\t\t\twords[b >>> 5] |= bytes[i] << (24 - b % 32);\r\n\t\treturn words;\r\n\t},\r\n\r\n\t// Convert big-endian 32-bit words to a byte array\r\n\twordsToBytes: function (words) {\r\n\t\tfor (var bytes = [], b = 0; b < words.length * 32; b += 8)\r\n\t\t\tbytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF);\r\n\t\treturn bytes;\r\n\t},\r\n\r\n\t// Convert a byte array to a hex string\r\n\tbytesToHex: function (bytes) {\r\n\t\tfor (var hex = [], i = 0; i < bytes.length; i++) {\r\n\t\t\thex.push((bytes[i] >>> 4).toString(16));\r\n\t\t\thex.push((bytes[i] & 0xF).toString(16));\r\n\t\t}\r\n\t\treturn hex.join(\"\");\r\n\t},\r\n\r\n\t// Convert a hex string to a byte array\r\n\thexToBytes: function (hex) {\r\n\t\tfor (var bytes = [], c = 0; c < hex.length; c += 2)\r\n\t\t\tbytes.push(parseInt(hex.substr(c, 2), 16));\r\n\t\treturn bytes;\r\n\t},\r\n\r\n\t// Convert a byte array to a base-64 string\r\n\tbytesToBase64: function (bytes) {\r\n\r\n\t\t// Use browser-native function if it exists\r\n\t\tif (typeof btoa == \"function\") return btoa(Binary.bytesToString(bytes));\r\n\r\n\t\tfor(var base64 = [], i = 0; i < bytes.length; i += 3) {\r\n\t\t\tvar triplet = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2];\r\n\t\t\tfor (var j = 0; j < 4; j++) {\r\n\t\t\t\tif (i * 8 + j * 6 <= bytes.length * 8)\r\n\t\t\t\t\tbase64.push(base64map.charAt((triplet >>> 6 * (3 - j)) & 0x3F));\r\n\t\t\t\telse base64.push(\"=\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn base64.join(\"\");\r\n\r\n\t},\r\n\r\n\t// Convert a base-64 string to a byte array\r\n\tbase64ToBytes: function (base64) {\r\n\r\n\t\t// Use browser-native function if it exists\r\n\t\tif (typeof atob == \"function\") return Binary.stringToBytes(atob(base64));\r\n\r\n\t\t// Remove non-base-64 characters\r\n\t\tbase64 = base64.replace(/[^A-Z0-9+\\/]/ig, \"\");\r\n\r\n\t\tfor (var bytes = [], i = 0, imod4 = 0; i < base64.length; imod4 = ++i % 4) {\r\n\t\t\tif (imod4 == 0) continue;\r\n\t\t\tbytes.push(((base64map.indexOf(base64.charAt(i - 1)) & (Math.pow(2, -2 * imod4 + 8) - 1)) << (imod4 * 2)) |\r\n\t\t\t (base64map.indexOf(base64.charAt(i)) >>> (6 - imod4 * 2)));\r\n\t\t}\r\n\r\n\t\treturn bytes;\r\n\r\n\t}\r\n\r\n};\r\n\r\n// Crypto mode namespace\r\nCrypto.mode = {};\r\n\r\n// Crypto character encodings\r\nvar charenc = Crypto.charenc = {};\r\n\r\n// UTF-8 encoding\r\nvar UTF8 = charenc.UTF8 = {\r\n\r\n\t// Convert a string to a byte array\r\n\tstringToBytes: function (str) {\r\n\t\treturn Binary.stringToBytes(unescape(encodeURIComponent(str)));\r\n\t},\r\n\r\n\t// Convert a byte array to a string\r\n\tbytesToString: function (bytes) {\r\n\t\treturn decodeURIComponent(escape(Binary.bytesToString(bytes)));\r\n\t}\r\n\r\n};\r\n\r\n// Binary encoding\r\nvar Binary = charenc.Binary = {\r\n\r\n\t// Convert a string to a byte array\r\n\tstringToBytes: function (str) {\r\n\t\tfor (var bytes = [], i = 0; i < str.length; i++)\r\n\t\t\tbytes.push(str.charCodeAt(i));\r\n\t\treturn bytes;\r\n\t},\r\n\r\n\t// Convert a byte array to a string\r\n\tbytesToString: function (bytes) {\r\n\t\tfor (var str = [], i = 0; i < bytes.length; i++)\r\n\t\t\tstr.push(String.fromCharCode(bytes[i]));\r\n\t\treturn str.join(\"\");\r\n\t}\r\n\r\n};\r\n\r\n})();\r\n}\r\n");
+ Files.Add("Crypto.js", "// From http://code.google.com/p/crypto-js/\r\n// License: http://www.opensource.org/licenses/bsd-license.php\r\n//\r\n// Copyright (c) 2009, Jeff Mott. All rights reserved.\r\n// \r\n// Redistribution and use in source and binary forms, with or without\r\n// modification, are permitted provided that the following conditions are met:\r\n// \r\n// Redistributions of source code must retain the above copyright notice, this\r\n// list of conditions and the following disclaimer. Redistributions in binary\r\n// form must reproduce the above copyright notice, this list of conditions and\r\n// the following disclaimer in the documentation and/or other materials provided\r\n// with the distribution. Neither the name Crypto-JS nor the names of its\r\n// contributors may be used to endorse or promote products derived from this\r\n// software without specific prior written permission. THIS SOFTWARE IS PROVIDED\r\n// BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED\r\n// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n// EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\r\n// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\r\n// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\r\n// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\r\n// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\r\n// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r\n\r\nif (typeof Crypto == \"undefined\" || ! Crypto.util)\r\n{\r\n(function(){\r\n\r\nvar base64map = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\r\n\r\n// Global Crypto object\r\nvar Crypto = window.Crypto = {};\r\n\r\n// Crypto utilities\r\nvar util = Crypto.util = {\r\n\r\n\t// Bit-wise rotate left\r\n\trotl: function (n, b) {\r\n\t\treturn (n << b) | (n >>> (32 - b));\r\n\t},\r\n\r\n\t// Bit-wise rotate right\r\n\trotr: function (n, b) {\r\n\t\treturn (n << (32 - b)) | (n >>> b);\r\n\t},\r\n\r\n\t// Swap big-endian to little-endian and vice versa\r\n\tendian: function (n) {\r\n\r\n\t\t// If number given, swap endian\r\n\t\tif (n.constructor == Number) {\r\n\t\t\treturn util.rotl(n, 8) & 0x00FF00FF |\r\n\t\t\t util.rotl(n, 24) & 0xFF00FF00;\r\n\t\t}\r\n\r\n\t\t// Else, assume array and swap all items\r\n\t\tfor (var i = 0; i < n.length; i++)\r\n\t\t\tn[i] = util.endian(n[i]);\r\n\t\treturn n;\r\n\r\n\t},\r\n\r\n\t// Generate an array of any length of random bytes\r\n\trandomBytes: function (n) {\r\n\t\tfor (var bytes = []; n > 0; n--)\r\n\t\t\tbytes.push(Math.floor(Math.random() * 256));\r\n\t\treturn bytes;\r\n\t},\r\n\r\n\t// Convert a byte array to big-endian 32-bit words\r\n\tbytesToWords: function (bytes) {\r\n\t\tfor (var words = [], i = 0, b = 0; i < bytes.length; i++, b += 8)\r\n\t\t\twords[b >>> 5] |= bytes[i] << (24 - b % 32);\r\n\t\treturn words;\r\n\t},\r\n\r\n\t// Convert big-endian 32-bit words to a byte array\r\n\twordsToBytes: function (words) {\r\n\t\tfor (var bytes = [], b = 0; b < words.length * 32; b += 8)\r\n\t\t\tbytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF);\r\n\t\treturn bytes;\r\n\t},\r\n\r\n\t// Convert a byte array to a hex string\r\n\tbytesToHex: function (bytes) {\r\n\t\tfor (var hex = [], i = 0; i < bytes.length; i++) {\r\n\t\t\thex.push((bytes[i] >>> 4).toString(16));\r\n\t\t\thex.push((bytes[i] & 0xF).toString(16));\r\n\t\t}\r\n\t\treturn hex.join(\"\");\r\n\t},\r\n\r\n\t// Convert a hex string to a byte array\r\n\thexToBytes: function (hex) {\r\n\t\tfor (var bytes = [], c = 0; c < hex.length; c += 2)\r\n\t\t\tbytes.push(parseInt(hex.substr(c, 2), 16));\r\n\t\treturn bytes;\r\n\t},\r\n\r\n\t// Convert a byte array to a base-64 string\r\n\tbytesToBase64: function (bytes) {\r\n\r\n\t\t// Use browser-native function if it exists\r\n\t\tif (typeof btoa == \"function\") return btoa(Binary.bytesToString(bytes));\r\n\r\n\t\tfor(var base64 = [], i = 0; i < bytes.length; i += 3) {\r\n\t\t\tvar triplet = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2];\r\n\t\t\tfor (var j = 0; j < 4; j++) {\r\n\t\t\t\tif (i * 8 + j * 6 <= bytes.length * 8)\r\n\t\t\t\t\tbase64.push(base64map.charAt((triplet >>> 6 * (3 - j)) & 0x3F));\r\n\t\t\t\telse base64.push(\"=\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn base64.join(\"\");\r\n\r\n\t},\r\n\r\n\t// Convert a base-64 string to a byte array\r\n\tbase64ToBytes: function (base64) {\r\n\r\n\t\t// Use browser-native function if it exists\r\n\t\tif (typeof atob == \"function\") return Binary.stringToBytes(atob(base64));\r\n\r\n\t\t// Remove non-base-64 characters\r\n\t\tbase64 = base64.replace(/[^A-Z0-9+\\/]/ig, \"\");\r\n\r\n\t\tfor (var bytes = [], i = 0, imod4 = 0; i < base64.length; imod4 = ++i % 4) {\r\n\t\t\tif (imod4 == 0) continue;\r\n\t\t\tbytes.push(((base64map.indexOf(base64.charAt(i - 1)) & (Math.pow(2, -2 * imod4 + 8) - 1)) << (imod4 * 2)) |\r\n\t\t\t (base64map.indexOf(base64.charAt(i)) >>> (6 - imod4 * 2)));\r\n\t\t}\r\n\r\n\t\treturn bytes;\r\n\r\n\t}\r\n\r\n};\r\n\r\n// Crypto mode namespace\r\nCrypto.mode = {};\r\n\r\n// Crypto character encodings\r\nvar charenc = Crypto.charenc = {};\r\n\r\n// UTF-8 encoding\r\nvar UTF8 = charenc.UTF8 = {\r\n\r\n\t// Convert a string to a byte array\r\n\tstringToBytes: function (str) {\r\n\t\treturn Binary.stringToBytes(unescape(encodeURIComponent(str)));\r\n\t},\r\n\r\n\t// Convert a byte array to a string\r\n\tbytesToString: function (bytes) {\r\n\t\treturn decodeURIComponent(escape(Binary.bytesToString(bytes)));\r\n\t}\r\n\r\n};\r\n\r\n// Binary encoding\r\nvar Binary = charenc.Binary = {\r\n\r\n\t// Convert a string to a byte array\r\n\tstringToBytes: function (str) {\r\n\t\tfor (var bytes = [], i = 0; i < str.length; i++)\r\n\t\t\tbytes.push(str.charCodeAt(i));\r\n\t\treturn bytes;\r\n\t},\r\n\r\n\t// Convert a byte array to a string\r\n\tbytesToString: function (bytes) {\r\n\t\tfor (var str = [], i = 0; i < bytes.length; i++)\r\n\t\t\tstr.push(String.fromCharCode(bytes[i]));\r\n\t\treturn str.join(\"\");\r\n\t}\r\n\r\n};\r\n\r\n})();\r\n}\r\n", time.Unix(0, 1307659868000000000));
}
diff --git a/server/camlistored/ui/zembed_SHA1.js.go b/server/camlistored/ui/zembed_SHA1.js.go
index 5712f68ad..70b0cdcf2 100644
--- a/server/camlistored/ui/zembed_SHA1.js.go
+++ b/server/camlistored/ui/zembed_SHA1.js.go
@@ -1,6 +1,7 @@
// THIS FILE IS AUTO-GENERATED FROM SHA1.js
// DO NOT EDIT.
package ui
+import "time"
func init() {
- Files.Add("SHA1.js", "// From http://code.google.com/p/crypto-js/\r\n// License: http://www.opensource.org/licenses/bsd-license.php\r\n//\r\n// Copyright (c) 2009, Jeff Mott. All rights reserved.\r\n// \r\n// Redistribution and use in source and binary forms, with or without\r\n// modification, are permitted provided that the following conditions are met:\r\n// \r\n// Redistributions of source code must retain the above copyright notice, this\r\n// list of conditions and the following disclaimer. Redistributions in binary\r\n// form must reproduce the above copyright notice, this list of conditions and\r\n// the following disclaimer in the documentation and/or other materials provided\r\n// with the distribution. Neither the name Crypto-JS nor the names of its\r\n// contributors may be used to endorse or promote products derived from this\r\n// software without specific prior written permission. THIS SOFTWARE IS PROVIDED\r\n// BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED\r\n// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n// EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\r\n// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\r\n// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\r\n// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\r\n// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\r\n// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r\n\r\n(function(){\r\n\r\n// Shortcuts\r\nvar C = Crypto,\r\n util = C.util,\r\n charenc = C.charenc,\r\n UTF8 = charenc.UTF8,\r\n Binary = charenc.Binary;\r\n\r\n// Public API\r\nvar SHA1 = C.SHA1 = function (message, options) {\r\n\tvar digestbytes = util.wordsToBytes(SHA1._sha1(message));\r\n\treturn options && options.asBytes ? digestbytes :\r\n\t options && options.asString ? Binary.bytesToString(digestbytes) :\r\n\t util.bytesToHex(digestbytes);\r\n};\r\n\r\n// The core\r\nSHA1._sha1 = function (message) {\r\n\r\n\t// Convert to byte array\r\n\tif (message.constructor == String) message = UTF8.stringToBytes(message);\r\n\t/* else, assume byte array already */\r\n\r\n\tvar m = util.bytesToWords(message),\r\n\t l = message.length * 8,\r\n\t w = [],\r\n\t H0 = 1732584193,\r\n\t H1 = -271733879,\r\n\t H2 = -1732584194,\r\n\t H3 = 271733878,\r\n\t H4 = -1009589776;\r\n\r\n\t// Padding\r\n\tm[l >> 5] |= 0x80 << (24 - l % 32);\r\n\tm[((l + 64 >>> 9) << 4) + 15] = l;\r\n\r\n\tfor (var i = 0; i < m.length; i += 16) {\r\n\r\n\t\tvar a = H0,\r\n\t\t b = H1,\r\n\t\t c = H2,\r\n\t\t d = H3,\r\n\t\t e = H4;\r\n\r\n\t\tfor (var j = 0; j < 80; j++) {\r\n\r\n\t\t\tif (j < 16) w[j] = m[i + j];\r\n\t\t\telse {\r\n\t\t\t\tvar n = w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16];\r\n\t\t\t\tw[j] = (n << 1) | (n >>> 31);\r\n\t\t\t}\r\n\r\n\t\t\tvar t = ((H0 << 5) | (H0 >>> 27)) + H4 + (w[j] >>> 0) + (\r\n\t\t\t j < 20 ? (H1 & H2 | ~H1 & H3) + 1518500249 :\r\n\t\t\t j < 40 ? (H1 ^ H2 ^ H3) + 1859775393 :\r\n\t\t\t j < 60 ? (H1 & H2 | H1 & H3 | H2 & H3) - 1894007588 :\r\n\t\t\t (H1 ^ H2 ^ H3) - 899497514);\r\n\r\n\t\t\tH4 = H3;\r\n\t\t\tH3 = H2;\r\n\t\t\tH2 = (H1 << 30) | (H1 >>> 2);\r\n\t\t\tH1 = H0;\r\n\t\t\tH0 = t;\r\n\r\n\t\t}\r\n\r\n\t\tH0 += a;\r\n\t\tH1 += b;\r\n\t\tH2 += c;\r\n\t\tH3 += d;\r\n\t\tH4 += e;\r\n\r\n\t}\r\n\r\n\treturn [H0, H1, H2, H3, H4];\r\n\r\n};\r\n\r\n// Package private blocksize\r\nSHA1._blocksize = 16;\r\n\r\n})();\r\n");
+ Files.Add("SHA1.js", "// From http://code.google.com/p/crypto-js/\r\n// License: http://www.opensource.org/licenses/bsd-license.php\r\n//\r\n// Copyright (c) 2009, Jeff Mott. All rights reserved.\r\n// \r\n// Redistribution and use in source and binary forms, with or without\r\n// modification, are permitted provided that the following conditions are met:\r\n// \r\n// Redistributions of source code must retain the above copyright notice, this\r\n// list of conditions and the following disclaimer. Redistributions in binary\r\n// form must reproduce the above copyright notice, this list of conditions and\r\n// the following disclaimer in the documentation and/or other materials provided\r\n// with the distribution. Neither the name Crypto-JS nor the names of its\r\n// contributors may be used to endorse or promote products derived from this\r\n// software without specific prior written permission. THIS SOFTWARE IS PROVIDED\r\n// BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED\r\n// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n// EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\r\n// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\r\n// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\r\n// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\r\n// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\r\n// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r\n\r\n(function(){\r\n\r\n// Shortcuts\r\nvar C = Crypto,\r\n util = C.util,\r\n charenc = C.charenc,\r\n UTF8 = charenc.UTF8,\r\n Binary = charenc.Binary;\r\n\r\n// Public API\r\nvar SHA1 = C.SHA1 = function (message, options) {\r\n\tvar digestbytes = util.wordsToBytes(SHA1._sha1(message));\r\n\treturn options && options.asBytes ? digestbytes :\r\n\t options && options.asString ? Binary.bytesToString(digestbytes) :\r\n\t util.bytesToHex(digestbytes);\r\n};\r\n\r\n// The core\r\nSHA1._sha1 = function (message) {\r\n\r\n\t// Convert to byte array\r\n\tif (message.constructor == String) message = UTF8.stringToBytes(message);\r\n\t/* else, assume byte array already */\r\n\r\n\tvar m = util.bytesToWords(message),\r\n\t l = message.length * 8,\r\n\t w = [],\r\n\t H0 = 1732584193,\r\n\t H1 = -271733879,\r\n\t H2 = -1732584194,\r\n\t H3 = 271733878,\r\n\t H4 = -1009589776;\r\n\r\n\t// Padding\r\n\tm[l >> 5] |= 0x80 << (24 - l % 32);\r\n\tm[((l + 64 >>> 9) << 4) + 15] = l;\r\n\r\n\tfor (var i = 0; i < m.length; i += 16) {\r\n\r\n\t\tvar a = H0,\r\n\t\t b = H1,\r\n\t\t c = H2,\r\n\t\t d = H3,\r\n\t\t e = H4;\r\n\r\n\t\tfor (var j = 0; j < 80; j++) {\r\n\r\n\t\t\tif (j < 16) w[j] = m[i + j];\r\n\t\t\telse {\r\n\t\t\t\tvar n = w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16];\r\n\t\t\t\tw[j] = (n << 1) | (n >>> 31);\r\n\t\t\t}\r\n\r\n\t\t\tvar t = ((H0 << 5) | (H0 >>> 27)) + H4 + (w[j] >>> 0) + (\r\n\t\t\t j < 20 ? (H1 & H2 | ~H1 & H3) + 1518500249 :\r\n\t\t\t j < 40 ? (H1 ^ H2 ^ H3) + 1859775393 :\r\n\t\t\t j < 60 ? (H1 & H2 | H1 & H3 | H2 & H3) - 1894007588 :\r\n\t\t\t (H1 ^ H2 ^ H3) - 899497514);\r\n\r\n\t\t\tH4 = H3;\r\n\t\t\tH3 = H2;\r\n\t\t\tH2 = (H1 << 30) | (H1 >>> 2);\r\n\t\t\tH1 = H0;\r\n\t\t\tH0 = t;\r\n\r\n\t\t}\r\n\r\n\t\tH0 += a;\r\n\t\tH1 += b;\r\n\t\tH2 += c;\r\n\t\tH3 += d;\r\n\t\tH4 += e;\r\n\r\n\t}\r\n\r\n\treturn [H0, H1, H2, H3, H4];\r\n\r\n};\r\n\r\n// Package private blocksize\r\nSHA1._blocksize = 16;\r\n\r\n})();\r\n", time.Unix(0, 1307659868000000000));
}
diff --git a/server/camlistored/ui/zembed_base64.js.go b/server/camlistored/ui/zembed_base64.js.go
index 54c589773..74cac9deb 100644
--- a/server/camlistored/ui/zembed_base64.js.go
+++ b/server/camlistored/ui/zembed_base64.js.go
@@ -1,6 +1,7 @@
// THIS FILE IS AUTO-GENERATED FROM base64.js
// DO NOT EDIT.
package ui
+import "time"
func init() {
- Files.Add("base64.js", "/*\nCopyright (c) 2008 Fred Palmer fred.palmer_at_gmail.com\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n*/\nfunction StringBuffer()\n{ \n this.buffer = []; \n} \n\nStringBuffer.prototype.append = function append(string)\n{ \n this.buffer.push(string); \n return this; \n}; \n\nStringBuffer.prototype.toString = function toString()\n{ \n return this.buffer.join(\"\"); \n}; \n\nvar Base64 =\n{\n codex : \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\",\n\n encode : function (input)\n {\n var output = new StringBuffer();\n\n var enumerator = new Utf8EncodeEnumerator(input);\n while (enumerator.moveNext())\n {\n var chr1 = enumerator.current;\n\n enumerator.moveNext();\n var chr2 = enumerator.current;\n\n enumerator.moveNext();\n var chr3 = enumerator.current;\n\n var enc1 = chr1 >> 2;\n var enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);\n var enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);\n var enc4 = chr3 & 63;\n\n if (isNaN(chr2))\n {\n enc3 = enc4 = 64;\n }\n else if (isNaN(chr3))\n {\n enc4 = 64;\n }\n\n output.append(this.codex.charAt(enc1) + this.codex.charAt(enc2) + this.codex.charAt(enc3) + this.codex.charAt(enc4));\n }\n\n return output.toString();\n },\n\n decode : function (input)\n {\n // TypedArray usage added by brett@haxor.com 11/27/2010\n var size = 0;\n var buffer = new ArrayBuffer(input.length);\n var output = new Uint8Array(buffer, 0);\n\n var enumerator = new Base64DecodeEnumerator(input);\n while (enumerator.moveNext()) {\n output[size++] = enumerator.current;\n }\n\n // There is nothing in the TypedArray spec to copy/subset a buffer,\n // so we have to do a copy to ensure that typedarray.buffer is the\n // correct length when passed to XmlHttpRequest methods, etc.\n var outputBuffer = new ArrayBuffer(size);\n var outputArray = new Uint8Array(outputBuffer, 0);\n for (var i = 0; i < size; i++) {\n outputArray[i] = output[i];\n }\n return outputArray;\n }\n}\n\n\nfunction Utf8EncodeEnumerator(input)\n{\n this._input = input;\n this._index = -1;\n this._buffer = [];\n}\n\nUtf8EncodeEnumerator.prototype =\n{\n current: Number.NaN,\n\n moveNext: function()\n {\n if (this._buffer.length > 0)\n {\n this.current = this._buffer.shift();\n return true;\n }\n else if (this._index >= (this._input.length - 1))\n {\n this.current = Number.NaN;\n return false;\n }\n else\n {\n var charCode = this._input.charCodeAt(++this._index);\n\n // \"\\r\\n\" -> \"\\n\"\n //\n if ((charCode == 13) && (this._input.charCodeAt(this._index + 1) == 10))\n {\n charCode = 10;\n this._index += 2;\n }\n\n if (charCode < 128)\n {\n this.current = charCode;\n }\n else if ((charCode > 127) && (charCode < 2048))\n {\n this.current = (charCode >> 6) | 192;\n this._buffer.push((charCode & 63) | 128);\n }\n else\n {\n this.current = (charCode >> 12) | 224;\n this._buffer.push(((charCode >> 6) & 63) | 128);\n this._buffer.push((charCode & 63) | 128);\n }\n\n return true;\n }\n }\n}\n\nfunction Base64DecodeEnumerator(input)\n{\n this._input = input;\n this._index = -1;\n this._buffer = [];\n}\n\nBase64DecodeEnumerator.prototype =\n{\n current: 64,\n\n moveNext: function()\n {\n if (this._buffer.length > 0)\n {\n this.current = this._buffer.shift();\n return true;\n }\n else if (this._index >= (this._input.length - 1))\n {\n this.current = 64;\n return false;\n }\n else\n {\n var enc1 = Base64.codex.indexOf(this._input.charAt(++this._index));\n var enc2 = Base64.codex.indexOf(this._input.charAt(++this._index));\n var enc3 = Base64.codex.indexOf(this._input.charAt(++this._index));\n var enc4 = Base64.codex.indexOf(this._input.charAt(++this._index));\n\n var chr1 = (enc1 << 2) | (enc2 >> 4);\n var chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\n var chr3 = ((enc3 & 3) << 6) | enc4;\n\n this.current = chr1;\n\n if (enc3 != 64)\n this._buffer.push(chr2);\n\n if (enc4 != 64)\n this._buffer.push(chr3);\n\n return true;\n }\n }\n};\n");
+ Files.Add("base64.js", "/*\nCopyright (c) 2008 Fred Palmer fred.palmer_at_gmail.com\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n*/\nfunction StringBuffer()\n{ \n this.buffer = []; \n} \n\nStringBuffer.prototype.append = function append(string)\n{ \n this.buffer.push(string); \n return this; \n}; \n\nStringBuffer.prototype.toString = function toString()\n{ \n return this.buffer.join(\"\"); \n}; \n\nvar Base64 =\n{\n codex : \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\",\n\n encode : function (input)\n {\n var output = new StringBuffer();\n\n var enumerator = new Utf8EncodeEnumerator(input);\n while (enumerator.moveNext())\n {\n var chr1 = enumerator.current;\n\n enumerator.moveNext();\n var chr2 = enumerator.current;\n\n enumerator.moveNext();\n var chr3 = enumerator.current;\n\n var enc1 = chr1 >> 2;\n var enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);\n var enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);\n var enc4 = chr3 & 63;\n\n if (isNaN(chr2))\n {\n enc3 = enc4 = 64;\n }\n else if (isNaN(chr3))\n {\n enc4 = 64;\n }\n\n output.append(this.codex.charAt(enc1) + this.codex.charAt(enc2) + this.codex.charAt(enc3) + this.codex.charAt(enc4));\n }\n\n return output.toString();\n },\n\n decode : function (input)\n {\n // TypedArray usage added by brett@haxor.com 11/27/2010\n var size = 0;\n var buffer = new ArrayBuffer(input.length);\n var output = new Uint8Array(buffer, 0);\n\n var enumerator = new Base64DecodeEnumerator(input);\n while (enumerator.moveNext()) {\n output[size++] = enumerator.current;\n }\n\n // There is nothing in the TypedArray spec to copy/subset a buffer,\n // so we have to do a copy to ensure that typedarray.buffer is the\n // correct length when passed to XmlHttpRequest methods, etc.\n var outputBuffer = new ArrayBuffer(size);\n var outputArray = new Uint8Array(outputBuffer, 0);\n for (var i = 0; i < size; i++) {\n outputArray[i] = output[i];\n }\n return outputArray;\n }\n}\n\n\nfunction Utf8EncodeEnumerator(input)\n{\n this._input = input;\n this._index = -1;\n this._buffer = [];\n}\n\nUtf8EncodeEnumerator.prototype =\n{\n current: Number.NaN,\n\n moveNext: function()\n {\n if (this._buffer.length > 0)\n {\n this.current = this._buffer.shift();\n return true;\n }\n else if (this._index >= (this._input.length - 1))\n {\n this.current = Number.NaN;\n return false;\n }\n else\n {\n var charCode = this._input.charCodeAt(++this._index);\n\n // \"\\r\\n\" -> \"\\n\"\n //\n if ((charCode == 13) && (this._input.charCodeAt(this._index + 1) == 10))\n {\n charCode = 10;\n this._index += 2;\n }\n\n if (charCode < 128)\n {\n this.current = charCode;\n }\n else if ((charCode > 127) && (charCode < 2048))\n {\n this.current = (charCode >> 6) | 192;\n this._buffer.push((charCode & 63) | 128);\n }\n else\n {\n this.current = (charCode >> 12) | 224;\n this._buffer.push(((charCode >> 6) & 63) | 128);\n this._buffer.push((charCode & 63) | 128);\n }\n\n return true;\n }\n }\n}\n\nfunction Base64DecodeEnumerator(input)\n{\n this._input = input;\n this._index = -1;\n this._buffer = [];\n}\n\nBase64DecodeEnumerator.prototype =\n{\n current: 64,\n\n moveNext: function()\n {\n if (this._buffer.length > 0)\n {\n this.current = this._buffer.shift();\n return true;\n }\n else if (this._index >= (this._input.length - 1))\n {\n this.current = 64;\n return false;\n }\n else\n {\n var enc1 = Base64.codex.indexOf(this._input.charAt(++this._index));\n var enc2 = Base64.codex.indexOf(this._input.charAt(++this._index));\n var enc3 = Base64.codex.indexOf(this._input.charAt(++this._index));\n var enc4 = Base64.codex.indexOf(this._input.charAt(++this._index));\n\n var chr1 = (enc1 << 2) | (enc2 >> 4);\n var chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\n var chr3 = ((enc3 & 3) << 6) | enc4;\n\n this.current = chr1;\n\n if (enc3 != 64)\n this._buffer.push(chr2);\n\n if (enc4 != 64)\n this._buffer.push(chr3);\n\n return true;\n }\n }\n};\n", time.Unix(0, 1307659868000000000));
}
diff --git a/server/camlistored/ui/zembed_blobinfo.html.go b/server/camlistored/ui/zembed_blobinfo.html.go
index 2946e29b3..0b9e31ad8 100644
--- a/server/camlistored/ui/zembed_blobinfo.html.go
+++ b/server/camlistored/ui/zembed_blobinfo.html.go
@@ -1,6 +1,7 @@
// THIS FILE IS AUTO-GENERATED FROM blobinfo.html
// DO NOT EDIT.
package ui
+import "time"
func init() {
- Files.Add("blobinfo.html", "\n
\n\n \n\n\n\n", time.Unix(0, 1309849899000000000));
}
diff --git a/server/camlistored/ui/zembed_gallery.js.go b/server/camlistored/ui/zembed_gallery.js.go
index d2b81be96..65b7c342b 100644
--- a/server/camlistored/ui/zembed_gallery.js.go
+++ b/server/camlistored/ui/zembed_gallery.js.go
@@ -1,6 +1,7 @@
// THIS FILE IS AUTO-GENERATED FROM gallery.js
// DO NOT EDIT.
package ui
+import "time"
func init() {
- Files.Add("gallery.js", "/*\nCopyright 2011 Google Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n// Gets the |g| query parameter, assuming that it looks like a blobref.\n\nfunction getPermanodeParam() {\n var blobRef = getQueryParam('g');\n return (blobRef && isPlausibleBlobRef(blobRef)) ? blobRef : null;\n}\n\n// pn: child permanode\n// des: describe response of root permanode\nfunction addMember(pn, des) {\n var membersDiv = document.getElementById(\"members\");\n var ul;\n if (membersDiv.innerHTML == \"\") {\n membersDiv.appendChild(document.createTextNode(\"Members:\"));\n ul = document.createElement(\"ul\");\n membersDiv.appendChild(ul);\n } else {\n ul = membersDiv.firstChild.nextSibling;\n }\n var li = document.createElement(\"li\");\n var a = document.createElement(\"a\");\n a.href = \"./?p=\" + pn;\n a.innerHTML = camliBlobThumbnail(pn, des, 100, 100);\n\n li.appendChild(a);\n ul.appendChild(li);\n}\n\nfunction onMemberDescribed(bmap, jres, member) {\n\taddMember(member, jres)\n}\n\nfunction onBlobDescribed(jres) {\n var permanode = getPermanodeParam();\n if (!jres[permanode]) {\n alert(\"didn't get blob \" + permanode);\n return;\n }\n var permanodeObject = jres[permanode].permanode;\n if (!permanodeObject) {\n alert(\"blob \" + permanode + \" isn't a permanode\");\n return;\n }\n\n document.getElementById('members').innerHTML = '';\n var members = permanodeObject.attr.camliMember;\n if (members && members.length > 0) {\n for (idx in members) {\n var member = members[idx];\n camliDescribeBlob(\n member,\n {\n success: addMember(member, jres),\n fail: function(msg) {\n alert(\"Error describing blob \" + blobref + \": \" + msg);\n }\n }\n ); \n \n }\n }\n}\n\nfunction buildGallery() {\n camliDescribeBlob(getPermanodeParam(), {\n success: onBlobDescribed,\n failure: function(msg) {\n alert(\"failed to get blob description: \" + msg);\n }\n });\n}\n\nfunction galleryPageOnLoad(e) {\n var permanode = getPermanodeParam();\n if (permanode) {\n document.getElementById('permanode').innerHTML = \"\" + permanode + \"\";\n document.getElementById('permanodeBlob').innerHTML = \"view blob\";\n }\n\n buildGallery();\n}\n\nwindow.addEventListener(\"load\", galleryPageOnLoad);\n");
+ Files.Add("gallery.js", "/*\nCopyright 2011 Google Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n// Gets the |g| query parameter, assuming that it looks like a blobref.\n\nfunction getPermanodeParam() {\n var blobRef = getQueryParam('g');\n return (blobRef && isPlausibleBlobRef(blobRef)) ? blobRef : null;\n}\n\n// pn: child permanode\n// des: describe response of root permanode\nfunction addMember(pn, des) {\n var membersDiv = document.getElementById(\"members\");\n var ul;\n if (membersDiv.innerHTML == \"\") {\n membersDiv.appendChild(document.createTextNode(\"Members:\"));\n ul = document.createElement(\"ul\");\n membersDiv.appendChild(ul);\n } else {\n ul = membersDiv.firstChild.nextSibling;\n }\n var li = document.createElement(\"li\");\n var a = document.createElement(\"a\");\n a.href = \"./?p=\" + pn;\n a.innerHTML = camliBlobThumbnail(pn, des, 100, 100);\n\n li.appendChild(a);\n ul.appendChild(li);\n}\n\nfunction onMemberDescribed(bmap, jres, member) {\n\taddMember(member, jres)\n}\n\nfunction onBlobDescribed(jres) {\n var permanode = getPermanodeParam();\n if (!jres[permanode]) {\n alert(\"didn't get blob \" + permanode);\n return;\n }\n var permanodeObject = jres[permanode].permanode;\n if (!permanodeObject) {\n alert(\"blob \" + permanode + \" isn't a permanode\");\n return;\n }\n\n document.getElementById('members').innerHTML = '';\n var members = permanodeObject.attr.camliMember;\n if (members && members.length > 0) {\n for (idx in members) {\n var member = members[idx];\n camliDescribeBlob(\n member,\n {\n success: addMember(member, jres),\n fail: function(msg) {\n alert(\"Error describing blob \" + blobref + \": \" + msg);\n }\n }\n ); \n \n }\n }\n}\n\nfunction buildGallery() {\n camliDescribeBlob(getPermanodeParam(), {\n success: onBlobDescribed,\n failure: function(msg) {\n alert(\"failed to get blob description: \" + msg);\n }\n });\n}\n\nfunction galleryPageOnLoad(e) {\n var permanode = getPermanodeParam();\n if (permanode) {\n document.getElementById('permanode').innerHTML = \"\" + permanode + \"\";\n document.getElementById('permanodeBlob').innerHTML = \"view blob\";\n }\n\n buildGallery();\n}\n\nwindow.addEventListener(\"load\", galleryPageOnLoad);\n", time.Unix(0, 1309849899000000000));
}
diff --git a/server/camlistored/ui/zembed_home.html.go b/server/camlistored/ui/zembed_home.html.go
index 0ba819309..33f82a549 100644
--- a/server/camlistored/ui/zembed_home.html.go
+++ b/server/camlistored/ui/zembed_home.html.go
@@ -1,6 +1,7 @@
// THIS FILE IS AUTO-GENERATED FROM home.html
// DO NOT EDIT.
package ui
+import "time"
func init() {
- Files.Add("home.html", "\n\n Camlistored UI\n \n \n \n \n \n \n \n\n\n
\n \n\n\n\n", time.Unix(0, 1312665089000000000));
}
diff --git a/server/camlistored/ui/zembed_home.js.go b/server/camlistored/ui/zembed_home.js.go
index ee5e5e74b..19eee1cb0 100644
--- a/server/camlistored/ui/zembed_home.js.go
+++ b/server/camlistored/ui/zembed_home.js.go
@@ -1,6 +1,7 @@
// THIS FILE IS AUTO-GENERATED FROM home.js
// DO NOT EDIT.
package ui
+import "time"
func init() {
- Files.Add("home.js", "/*\nCopyright 2011 Google Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n// CamliHome namespace to contain the global vars\nvar CamliHome = {};\n\nfunction btnCreateNewPermanode(e) {\n camliCreateNewPermanode(\n {\n success: function(blobref) {\n window.location = \"./?p=\" + blobref;\n },\n fail: function(msg) {\n alert(\"create permanode failed: \" + msg);\n }\n });\n}\n\nfunction handleFormSearch(e) {\n e.stopPropagation();\n e.preventDefault();\n\n var input = document.getElementById(\"inputSearch\");\n var btn = document.getElementById(\"btnSearch\");\n\n if (input.value == \"\") {\n return;\n }\n\n var query = input.value.split(/\\s*,\\s*/);\n window.location = \"./search.html?q=\" + query[0] + \"&t=tag\";\n}\n\nfunction indexOnLoad(e) {\n var btnNew = document.getElementById(\"btnNew\");\n if (!btnNew) {\n alert(\"missing btnNew\");\n }\n btnNew.addEventListener(\"click\", btnCreateNewPermanode);\n camliGetRecentlyUpdatedPermanodes({ success: indexBuildRecentlyUpdatedPermanodes });\n formSearch.addEventListener(\"submit\", handleFormSearch);\n\n if (disco && disco.uploadHelper) {\n var uploadForm = document.getElementById(\"uploadform\");\n uploadform.action = disco.uploadHelper;\n document.getElementById(\"fileinput\").disabled = false;\n document.getElementById(\"filesubmit\").disabled = false;\n var chkRollSum = document.getElementById(\"chkrollsum\");\n chkRollSum.addEventListener(\"change\", function (e) {\n if (chkRollSum.checked) {\n if (disco.uploadHelper.indexOf(\"?\") == -1) {\n uploadform.action = disco.uploadHelper + \"?rollsum=1\";\n } else {\n uploadform.action = disco.uploadHelper + \"&rollsum=1\";\n }\n } else {\n uploadform.action = disco.uploadHelper;\n }\n });\n }\n}\n\nfunction indexBuildRecentlyUpdatedPermanodes(searchRes) {\n var div = document.getElementById(\"recent\");\n div.innerHTML = \"\";\n for (var i = 0; i < searchRes.recent.length; i++) {\n var result = searchRes.recent[i]; \n var pdiv = document.createElement(\"li\");\n var alink = document.createElement(\"a\");\n alink.href = \"./?p=\" + result.blobref;\n alink.innerText = camliBlobTitle(result.blobref, searchRes);\n pdiv.appendChild(alink);\n div.appendChild(pdiv);\n }\n}\n\nwindow.addEventListener(\"load\", indexOnLoad);\n");
+ Files.Add("home.js", "/*\nCopyright 2011 Google Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n// CamliHome namespace to contain the global vars\nvar CamliHome = {};\n\nfunction btnCreateNewPermanode(e) {\n camliCreateNewPermanode(\n {\n success: function(blobref) {\n window.location = \"./?p=\" + blobref;\n },\n fail: function(msg) {\n alert(\"create permanode failed: \" + msg);\n }\n });\n}\n\nfunction handleFormSearch(e) {\n e.stopPropagation();\n e.preventDefault();\n\n var input = document.getElementById(\"inputSearch\");\n var btn = document.getElementById(\"btnSearch\");\n\n if (input.value == \"\") {\n return;\n }\n\n var query = input.value.split(/\\s*,\\s*/);\n window.location = \"./search.html?q=\" + query[0] + \"&t=tag\";\n}\n\nfunction indexOnLoad(e) {\n var btnNew = document.getElementById(\"btnNew\");\n if (!btnNew) {\n alert(\"missing btnNew\");\n }\n btnNew.addEventListener(\"click\", btnCreateNewPermanode);\n camliGetRecentlyUpdatedPermanodes({ success: indexBuildRecentlyUpdatedPermanodes });\n formSearch.addEventListener(\"submit\", handleFormSearch);\n\n if (disco && disco.uploadHelper) {\n var uploadForm = document.getElementById(\"uploadform\");\n uploadform.action = disco.uploadHelper;\n document.getElementById(\"fileinput\").disabled = false;\n document.getElementById(\"filesubmit\").disabled = false;\n var chkRollSum = document.getElementById(\"chkrollsum\");\n chkRollSum.addEventListener(\"change\", function (e) {\n if (chkRollSum.checked) {\n if (disco.uploadHelper.indexOf(\"?\") == -1) {\n uploadform.action = disco.uploadHelper + \"?rollsum=1\";\n } else {\n uploadform.action = disco.uploadHelper + \"&rollsum=1\";\n }\n } else {\n uploadform.action = disco.uploadHelper;\n }\n });\n }\n}\n\nfunction indexBuildRecentlyUpdatedPermanodes(searchRes) {\n var div = document.getElementById(\"recent\");\n div.innerHTML = \"\";\n for (var i = 0; i < searchRes.recent.length; i++) {\n var result = searchRes.recent[i]; \n var pdiv = document.createElement(\"li\");\n var alink = document.createElement(\"a\");\n alink.href = \"./?p=\" + result.blobref;\n alink.innerText = camliBlobTitle(result.blobref, searchRes);\n pdiv.appendChild(alink);\n div.appendChild(pdiv);\n }\n}\n\nwindow.addEventListener(\"load\", indexOnLoad);\n", time.Unix(0, 1323566533000000000));
}
diff --git a/server/camlistored/ui/zembed_permanode.html.go b/server/camlistored/ui/zembed_permanode.html.go
index 0d67a4b93..0ad5dbdf8 100644
--- a/server/camlistored/ui/zembed_permanode.html.go
+++ b/server/camlistored/ui/zembed_permanode.html.go
@@ -1,6 +1,7 @@
// THIS FILE IS AUTO-GENERATED FROM permanode.html
// DO NOT EDIT.
package ui
+import "time"
func init() {
- Files.Add("permanode.html", "\n\n\n Permanode\n \n \n \n \n \n \n \n\n\n