card-mod-script 0.13.3 → 0.14.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. checksums.yaml +4 -4
  2. data/assets/script/decko/components.js.coffee +3 -0
  3. data/assets/script/decko/decko.js.coffee +0 -15
  4. data/assets/script/decko/editor.js.coffee +3 -1
  5. data/assets/script/decko/filter.js.coffee +13 -6
  6. data/assets/script/decko/mod.js.coffee +2 -8
  7. data/assets/script/{script_pointer_config.js.coffee → decko/pointer_config.js.coffee} +1 -2
  8. data/assets/script/{script_pointer_list_editor.js.coffee → decko/pointer_list_editor.js.coffee} +0 -0
  9. data/assets/script/decko/slot.js.coffee +2 -2
  10. data/assets/script/decko/slot_ready.js.coffee +1 -0
  11. data/assets/script/decko/slotter.js.coffee +23 -31
  12. data/assets/script/decko/type_editor.js.coffee +21 -0
  13. data/assets/script/decko/upload.js.coffee +12 -5
  14. data/assets/script/manifest.yml +15 -2
  15. data/set/abstract/00_script.rb +30 -31
  16. data/set/abstract/01_asset_script.rb +0 -16
  17. data/set/abstract/{script_asset_list.rb → script_group.rb} +12 -13
  18. data/set/all/head_javascript.rb +4 -5
  19. data/set/right/script.rb +1 -14
  20. data/set/type/local_script_folder_group.rb +2 -2
  21. data/set/type/local_script_manifest_group.rb +1 -1
  22. data/set/type_plus_right/mod/script.rb +56 -0
  23. data/set/type_plus_right/set/script.rb +7 -0
  24. data/vendor/jquery_file_upload/LICENSE.txt +11 -12
  25. data/vendor/jquery_file_upload/README.md +189 -72
  26. data/vendor/jquery_file_upload/SECURITY.md +227 -0
  27. data/vendor/jquery_file_upload/VULNERABILITIES.md +118 -0
  28. data/vendor/jquery_file_upload/cors/postmessage.html +68 -58
  29. data/vendor/jquery_file_upload/cors/result.html +12 -10
  30. data/vendor/jquery_file_upload/css/jquery.fileupload-ui.css +24 -13
  31. data/vendor/jquery_file_upload/css/jquery.fileupload.css +3 -4
  32. data/vendor/jquery_file_upload/docker-compose.yml +55 -0
  33. data/vendor/jquery_file_upload/index.html +332 -230
  34. data/vendor/jquery_file_upload/js/cors/jquery.postmessage-transport.js +109 -109
  35. data/vendor/jquery_file_upload/js/cors/jquery.xdr-transport.js +81 -73
  36. data/vendor/jquery_file_upload/js/demo.js +75 -0
  37. data/vendor/jquery_file_upload/js/jquery.fileupload-audio.js +82 -94
  38. data/vendor/jquery_file_upload/js/jquery.fileupload-image.js +321 -300
  39. data/vendor/jquery_file_upload/js/jquery.fileupload-process.js +138 -146
  40. data/vendor/jquery_file_upload/js/jquery.fileupload-ui.js +737 -692
  41. data/vendor/jquery_file_upload/js/jquery.fileupload-validate.js +91 -97
  42. data/vendor/jquery_file_upload/js/jquery.fileupload-video.js +82 -94
  43. data/vendor/jquery_file_upload/js/jquery.fileupload.js +1569 -1451
  44. data/vendor/jquery_file_upload/js/jquery.iframe-transport.js +208 -205
  45. data/vendor/jquery_file_upload/js/vendor/jquery.ui.widget.js +397 -340
  46. data/vendor/jquery_file_upload/package-lock.json +6853 -0
  47. data/vendor/jquery_file_upload/package.json +71 -10
  48. data/vendor/jquery_file_upload/server/gae-python/app.yaml +11 -10
  49. data/vendor/jquery_file_upload/server/php/Dockerfile +23 -17
  50. data/vendor/jquery_file_upload/server/php/UploadHandler.php +206 -137
  51. data/vendor/jquery_file_upload/server/php/php.ini +5 -0
  52. data/vendor/jquery_file_upload/test/index.html +36 -159
  53. data/vendor/jquery_file_upload/test/unit.js +989 -0
  54. data/vendor/jquery_file_upload/test/vendor/chai.js +10854 -0
  55. data/vendor/jquery_file_upload/test/vendor/mocha.css +325 -0
  56. data/vendor/jquery_file_upload/test/vendor/mocha.js +18178 -0
  57. data/vendor/jquery_file_upload/wdio/LICENSE.txt +20 -0
  58. data/vendor/jquery_file_upload/wdio/assets/black+white-3x2.jpg +0 -0
  59. data/vendor/jquery_file_upload/wdio/assets/black+white-60x40.gif +0 -0
  60. data/vendor/jquery_file_upload/wdio/conf/chrome.js +40 -0
  61. data/vendor/jquery_file_upload/wdio/conf/firefox.js +25 -0
  62. data/vendor/jquery_file_upload/wdio/hooks/index.js +36 -0
  63. data/vendor/jquery_file_upload/wdio/test/pages/file-upload.js +79 -0
  64. data/vendor/jquery_file_upload/wdio/test/specs/01-file-upload.js +25 -0
  65. data/vendor/jquery_file_upload/wdio/wdio.conf.js +4 -0
  66. metadata +34 -52
  67. data/file/mod_script_script_decko_machine_output/file.js +0 -2685
  68. data/file/mod_script_script_jquery_machine_output/file.js +0 -12924
  69. data/lib/javascript/script_html5shiv_printshiv.js +0 -1
  70. data/set/self/script_html5shiv_printshiv.rb +0 -11
  71. data/set/self/script_mods.rb +0 -1
  72. data/set/type/mod_script_assets.rb +0 -21
  73. data/vendor/jquery_file_upload/CONTRIBUTING.md +0 -15
  74. data/vendor/jquery_file_upload/angularjs.html +0 -211
  75. data/vendor/jquery_file_upload/basic-plus.html +0 -226
  76. data/vendor/jquery_file_upload/basic.html +0 -136
  77. data/vendor/jquery_file_upload/bower-version-update.js +0 -16
  78. data/vendor/jquery_file_upload/bower.json +0 -64
  79. data/vendor/jquery_file_upload/css/jquery-ui-demo-ie8.css +0 -21
  80. data/vendor/jquery_file_upload/css/jquery-ui-demo.css +0 -67
  81. data/vendor/jquery_file_upload/css/style.css +0 -15
  82. data/vendor/jquery_file_upload/jquery-ui.html +0 -252
  83. data/vendor/jquery_file_upload/js/app.js +0 -101
  84. data/vendor/jquery_file_upload/js/jquery.fileupload-angular.js +0 -437
  85. data/vendor/jquery_file_upload/js/jquery.fileupload-jquery-ui.js +0 -161
  86. data/vendor/jquery_file_upload/js/main.js +0 -75
  87. data/vendor/jquery_file_upload/server/gae-go/app/main.go +0 -361
  88. data/vendor/jquery_file_upload/server/gae-go/app.yaml +0 -12
  89. data/vendor/jquery_file_upload/server/gae-go/static/favicon.ico +0 -0
  90. data/vendor/jquery_file_upload/server/gae-go/static/robots.txt +0 -2
  91. data/vendor/jquery_file_upload/server/php/docker-compose.yml +0 -9
  92. data/vendor/jquery_file_upload/test/test.js +0 -1292
@@ -1,361 +0,0 @@
1
- /*
2
- * jQuery File Upload Plugin GAE Go Example
3
- * https://github.com/blueimp/jQuery-File-Upload
4
- *
5
- * Copyright 2011, Sebastian Tschan
6
- * https://blueimp.net
7
- *
8
- * Licensed under the MIT license:
9
- * https://opensource.org/licenses/MIT
10
- */
11
-
12
- package app
13
-
14
- import (
15
- "bufio"
16
- "bytes"
17
- "encoding/json"
18
- "fmt"
19
- "github.com/disintegration/gift"
20
- "golang.org/x/net/context"
21
- "google.golang.org/appengine"
22
- "google.golang.org/appengine/memcache"
23
- "hash/crc32"
24
- "image"
25
- "image/gif"
26
- "image/jpeg"
27
- "image/png"
28
- "io"
29
- "log"
30
- "mime/multipart"
31
- "net/http"
32
- "net/url"
33
- "path/filepath"
34
- "regexp"
35
- "strings"
36
- )
37
-
38
- const (
39
- WEBSITE = "https://blueimp.github.io/jQuery-File-Upload/"
40
- MIN_FILE_SIZE = 1 // bytes
41
- // Max file size is memcache limit (1MB) minus key size minus overhead:
42
- MAX_FILE_SIZE = 999000 // bytes
43
- IMAGE_TYPES = "image/(gif|p?jpeg|(x-)?png)"
44
- ACCEPT_FILE_TYPES = IMAGE_TYPES
45
- THUMB_MAX_WIDTH = 80
46
- THUMB_MAX_HEIGHT = 80
47
- EXPIRATION_TIME = 300 // seconds
48
- // If empty, only allow redirects to the referer protocol+host.
49
- // Set to a regexp string for custom pattern matching:
50
- REDIRECT_ALLOW_TARGET = ""
51
- )
52
-
53
- var (
54
- imageTypes = regexp.MustCompile(IMAGE_TYPES)
55
- acceptFileTypes = regexp.MustCompile(ACCEPT_FILE_TYPES)
56
- thumbSuffix = "." + fmt.Sprint(THUMB_MAX_WIDTH) + "x" +
57
- fmt.Sprint(THUMB_MAX_HEIGHT)
58
- )
59
-
60
- func escape(s string) string {
61
- return strings.Replace(url.QueryEscape(s), "+", "%20", -1)
62
- }
63
-
64
- func extractKey(r *http.Request) string {
65
- // Use RequestURI instead of r.URL.Path, as we need the encoded form:
66
- path := strings.Split(r.RequestURI, "?")[0]
67
- // Also adjust double encoded slashes:
68
- return strings.Replace(path[1:], "%252F", "%2F", -1)
69
- }
70
-
71
- func check(err error) {
72
- if err != nil {
73
- panic(err)
74
- }
75
- }
76
-
77
- type FileInfo struct {
78
- Key string `json:"-"`
79
- ThumbnailKey string `json:"-"`
80
- Url string `json:"url,omitempty"`
81
- ThumbnailUrl string `json:"thumbnailUrl,omitempty"`
82
- Name string `json:"name"`
83
- Type string `json:"type"`
84
- Size int64 `json:"size"`
85
- Error string `json:"error,omitempty"`
86
- DeleteUrl string `json:"deleteUrl,omitempty"`
87
- DeleteType string `json:"deleteType,omitempty"`
88
- }
89
-
90
- func (fi *FileInfo) ValidateType() (valid bool) {
91
- if acceptFileTypes.MatchString(fi.Type) {
92
- return true
93
- }
94
- fi.Error = "Filetype not allowed"
95
- return false
96
- }
97
-
98
- func (fi *FileInfo) ValidateSize() (valid bool) {
99
- if fi.Size < MIN_FILE_SIZE {
100
- fi.Error = "File is too small"
101
- } else if fi.Size > MAX_FILE_SIZE {
102
- fi.Error = "File is too big"
103
- } else {
104
- return true
105
- }
106
- return false
107
- }
108
-
109
- func (fi *FileInfo) CreateUrls(r *http.Request, c context.Context) {
110
- u := &url.URL{
111
- Scheme: r.URL.Scheme,
112
- Host: appengine.DefaultVersionHostname(c),
113
- Path: "/",
114
- }
115
- uString := u.String()
116
- fi.Url = uString + fi.Key
117
- fi.DeleteUrl = fi.Url
118
- fi.DeleteType = "DELETE"
119
- if fi.ThumbnailKey != "" {
120
- fi.ThumbnailUrl = uString + fi.ThumbnailKey
121
- }
122
- }
123
-
124
- func (fi *FileInfo) SetKey(checksum uint32) {
125
- fi.Key = escape(string(fi.Type)) + "/" +
126
- escape(fmt.Sprint(checksum)) + "/" +
127
- escape(string(fi.Name))
128
- }
129
-
130
- func (fi *FileInfo) createThumb(buffer *bytes.Buffer, c context.Context) {
131
- if imageTypes.MatchString(fi.Type) {
132
- src, _, err := image.Decode(bytes.NewReader(buffer.Bytes()))
133
- check(err)
134
- filter := gift.New(gift.ResizeToFit(
135
- THUMB_MAX_WIDTH,
136
- THUMB_MAX_HEIGHT,
137
- gift.LanczosResampling,
138
- ))
139
- dst := image.NewNRGBA(filter.Bounds(src.Bounds()))
140
- filter.Draw(dst, src)
141
- buffer.Reset()
142
- bWriter := bufio.NewWriter(buffer)
143
- switch fi.Type {
144
- case "image/jpeg", "image/pjpeg":
145
- err = jpeg.Encode(bWriter, dst, nil)
146
- case "image/gif":
147
- err = gif.Encode(bWriter, dst, nil)
148
- default:
149
- err = png.Encode(bWriter, dst)
150
- }
151
- check(err)
152
- bWriter.Flush()
153
- thumbnailKey := fi.Key + thumbSuffix + filepath.Ext(fi.Name)
154
- item := &memcache.Item{
155
- Key: thumbnailKey,
156
- Value: buffer.Bytes(),
157
- }
158
- err = memcache.Set(c, item)
159
- check(err)
160
- fi.ThumbnailKey = thumbnailKey
161
- }
162
- }
163
-
164
- func handleUpload(r *http.Request, p *multipart.Part) (fi *FileInfo) {
165
- fi = &FileInfo{
166
- Name: p.FileName(),
167
- Type: p.Header.Get("Content-Type"),
168
- }
169
- if !fi.ValidateType() {
170
- return
171
- }
172
- defer func() {
173
- if rec := recover(); rec != nil {
174
- log.Println(rec)
175
- fi.Error = rec.(error).Error()
176
- }
177
- }()
178
- var buffer bytes.Buffer
179
- hash := crc32.NewIEEE()
180
- mw := io.MultiWriter(&buffer, hash)
181
- lr := &io.LimitedReader{R: p, N: MAX_FILE_SIZE + 1}
182
- _, err := io.Copy(mw, lr)
183
- check(err)
184
- fi.Size = MAX_FILE_SIZE + 1 - lr.N
185
- if !fi.ValidateSize() {
186
- return
187
- }
188
- fi.SetKey(hash.Sum32())
189
- item := &memcache.Item{
190
- Key: fi.Key,
191
- Value: buffer.Bytes(),
192
- }
193
- context := appengine.NewContext(r)
194
- err = memcache.Set(context, item)
195
- check(err)
196
- fi.createThumb(&buffer, context)
197
- fi.CreateUrls(r, context)
198
- return
199
- }
200
-
201
- func getFormValue(p *multipart.Part) string {
202
- var b bytes.Buffer
203
- io.CopyN(&b, p, int64(1<<20)) // Copy max: 1 MiB
204
- return b.String()
205
- }
206
-
207
- func handleUploads(r *http.Request) (fileInfos []*FileInfo) {
208
- fileInfos = make([]*FileInfo, 0)
209
- mr, err := r.MultipartReader()
210
- check(err)
211
- r.Form, err = url.ParseQuery(r.URL.RawQuery)
212
- check(err)
213
- part, err := mr.NextPart()
214
- for err == nil {
215
- if name := part.FormName(); name != "" {
216
- if part.FileName() != "" {
217
- fileInfos = append(fileInfos, handleUpload(r, part))
218
- } else {
219
- r.Form[name] = append(r.Form[name], getFormValue(part))
220
- }
221
- }
222
- part, err = mr.NextPart()
223
- }
224
- return
225
- }
226
-
227
- func validateRedirect(r *http.Request, redirect string) bool {
228
- if redirect != "" {
229
- var redirectAllowTarget *regexp.Regexp
230
- if REDIRECT_ALLOW_TARGET != "" {
231
- redirectAllowTarget = regexp.MustCompile(REDIRECT_ALLOW_TARGET)
232
- } else {
233
- referer := r.Referer()
234
- if referer == "" {
235
- return false
236
- }
237
- refererUrl, err := url.Parse(referer)
238
- if err != nil {
239
- return false
240
- }
241
- redirectAllowTarget = regexp.MustCompile("^" + regexp.QuoteMeta(
242
- refererUrl.Scheme+"://"+refererUrl.Host+"/",
243
- ))
244
- }
245
- return redirectAllowTarget.MatchString(redirect)
246
- }
247
- return false
248
- }
249
-
250
- func get(w http.ResponseWriter, r *http.Request) {
251
- if r.URL.Path == "/" {
252
- http.Redirect(w, r, WEBSITE, http.StatusFound)
253
- return
254
- }
255
- // Use RequestURI instead of r.URL.Path, as we need the encoded form:
256
- key := extractKey(r)
257
- parts := strings.Split(key, "/")
258
- if len(parts) == 3 {
259
- context := appengine.NewContext(r)
260
- item, err := memcache.Get(context, key)
261
- if err == nil {
262
- w.Header().Add("X-Content-Type-Options", "nosniff")
263
- contentType, _ := url.QueryUnescape(parts[0])
264
- if !imageTypes.MatchString(contentType) {
265
- contentType = "application/octet-stream"
266
- }
267
- w.Header().Add("Content-Type", contentType)
268
- w.Header().Add(
269
- "Cache-Control",
270
- fmt.Sprintf("public,max-age=%d", EXPIRATION_TIME),
271
- )
272
- w.Write(item.Value)
273
- return
274
- }
275
- }
276
- http.Error(w, "404 Not Found", http.StatusNotFound)
277
- }
278
-
279
- func post(w http.ResponseWriter, r *http.Request) {
280
- result := make(map[string][]*FileInfo, 1)
281
- result["files"] = handleUploads(r)
282
- b, err := json.Marshal(result)
283
- check(err)
284
- if redirect := r.FormValue("redirect"); validateRedirect(r, redirect) {
285
- if strings.Contains(redirect, "%s") {
286
- redirect = fmt.Sprintf(
287
- redirect,
288
- escape(string(b)),
289
- )
290
- }
291
- http.Redirect(w, r, redirect, http.StatusFound)
292
- return
293
- }
294
- w.Header().Set("Cache-Control", "no-cache")
295
- jsonType := "application/json"
296
- if strings.Index(r.Header.Get("Accept"), jsonType) != -1 {
297
- w.Header().Set("Content-Type", jsonType)
298
- }
299
- fmt.Fprintln(w, string(b))
300
- }
301
-
302
- func delete(w http.ResponseWriter, r *http.Request) {
303
- key := extractKey(r)
304
- parts := strings.Split(key, "/")
305
- if len(parts) == 3 {
306
- result := make(map[string]bool, 1)
307
- context := appengine.NewContext(r)
308
- err := memcache.Delete(context, key)
309
- if err == nil {
310
- result[key] = true
311
- contentType, _ := url.QueryUnescape(parts[0])
312
- if imageTypes.MatchString(contentType) {
313
- thumbnailKey := key + thumbSuffix + filepath.Ext(parts[2])
314
- err := memcache.Delete(context, thumbnailKey)
315
- if err == nil {
316
- result[thumbnailKey] = true
317
- }
318
- }
319
- }
320
- w.Header().Set("Content-Type", "application/json")
321
- b, err := json.Marshal(result)
322
- check(err)
323
- fmt.Fprintln(w, string(b))
324
- } else {
325
- http.Error(w, "405 Method not allowed", http.StatusMethodNotAllowed)
326
- }
327
- }
328
-
329
- func handle(w http.ResponseWriter, r *http.Request) {
330
- params, err := url.ParseQuery(r.URL.RawQuery)
331
- check(err)
332
- w.Header().Add("Access-Control-Allow-Origin", "*")
333
- w.Header().Add(
334
- "Access-Control-Allow-Methods",
335
- "OPTIONS, HEAD, GET, POST, DELETE",
336
- )
337
- w.Header().Add(
338
- "Access-Control-Allow-Headers",
339
- "Content-Type, Content-Range, Content-Disposition",
340
- )
341
- switch r.Method {
342
- case "OPTIONS", "HEAD":
343
- return
344
- case "GET":
345
- get(w, r)
346
- case "POST":
347
- if len(params["_method"]) > 0 && params["_method"][0] == "DELETE" {
348
- delete(w, r)
349
- } else {
350
- post(w, r)
351
- }
352
- case "DELETE":
353
- delete(w, r)
354
- default:
355
- http.Error(w, "501 Not Implemented", http.StatusNotImplemented)
356
- }
357
- }
358
-
359
- func init() {
360
- http.HandleFunc("/", handle)
361
- }
@@ -1,12 +0,0 @@
1
- application: jquery-file-upload
2
- version: 2
3
- runtime: go
4
- api_version: go1
5
-
6
- handlers:
7
- - url: /(favicon\.ico|robots\.txt)
8
- static_files: static/\1
9
- upload: static/(.*)
10
- expiration: '1d'
11
- - url: /.*
12
- script: _go_app
@@ -1,2 +0,0 @@
1
- User-agent: *
2
- Disallow:
@@ -1,9 +0,0 @@
1
- version: '2.3'
2
- services:
3
- apache:
4
- build: ./
5
- network_mode: bridge
6
- ports:
7
- - "80:80"
8
- volumes:
9
- - "../../:/var/www/html"