sketchily 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +4 -0
- data/Rakefile +5 -4
- data/app/assets/javascripts/sketchily_embed.js +1 -1
- data/app/assets/javascripts/sketchily_embed.js~ +0 -3
- data/app/views/sketchily/_embed.html.erb +27 -4
- data/app/views/sketchily/_embed.html.erb~ +27 -5
- data/app/views/sketchily/_embed.js.erb +6 -3
- data/app/views/sketchily/_embed.js.erb~ +4 -4
- data/lib/sketchily.rb +1 -10
- data/lib/sketchily.rb~ +2 -11
- data/lib/sketchily/sketchily.rb +18 -6
- data/lib/sketchily/sketchily.rb~ +19 -6
- data/lib/sketchily/sketchily_tag.rb +9 -3
- data/lib/sketchily/sketchily_tag.rb~ +10 -3
- data/lib/sketchily/version.rb +1 -1
- data/lib/sketchily/version.rb~ +1 -1
- data/spec/dummy/app/controllers/sketchily_controller.rb +9 -0
- data/spec/dummy/app/models/drawing.rb +2 -0
- data/spec/dummy/app/models/drawing.rb~ +3 -0
- data/spec/dummy/app/views/sketchily/sketchily.html.erb +3 -0
- data/spec/dummy/app/views/sketchily/sketchily_tag.html.erb +3 -0
- data/spec/dummy/config/routes.rb +3 -56
- data/spec/dummy/config/routes.rb~ +5 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/20130211122120_create_drawings.rb +7 -0
- data/spec/dummy/db/schema.rb +20 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +192 -0
- data/spec/dummy/log/test.log +75 -0
- data/spec/features/sketchily.rb~ +9 -0
- data/spec/features/sketchily_spec.rb +10 -0
- data/spec/features/sketchily_spec.rb~ +9 -0
- data/spec/features/sketchily_tag.rb~ +9 -0
- data/spec/features/sketchily_tag_spec.rb +10 -0
- data/spec/features/sketchily_tag_spec.rb~ +9 -0
- data/spec/features/user_views_sketchily_spec.rb~ +15 -0
- data/spec/{spec_helper.rb → minitest_helper.rb} +2 -1
- data/spec/spec_helper.rb~ +19 -0
- data/vendor/assets/javascripts/base64.js +95 -0
- data/vendor/assets/javascripts/base64.js~ +95 -0
- metadata +76 -4
@@ -0,0 +1,95 @@
|
|
1
|
+
// This code was written by Tyler Akins and has been placed in the
|
2
|
+
// public domain. It would be nice if you left this header intact.
|
3
|
+
// Base64 code from Tyler Akins -- http://rumkin.com
|
4
|
+
|
5
|
+
// schiller: Removed string concatenation in favour of Array.join() optimization,
|
6
|
+
// also precalculate the size of the array needed.
|
7
|
+
|
8
|
+
// Function: sketchily_encode64
|
9
|
+
// Converts a string to base64
|
10
|
+
var sketchily_encode64 = function(input) {
|
11
|
+
// base64 strings are 4/3 larger than the original string
|
12
|
+
input = sketchily_convertToXMLReferences(input);
|
13
|
+
if(window.btoa) return window.btoa(input); // Use native if available
|
14
|
+
var output = new Array( Math.floor( (input.length + 2) / 3 ) * 4 );
|
15
|
+
var chr1, chr2, chr3;
|
16
|
+
var enc1, enc2, enc3, enc4;
|
17
|
+
var i = 0, p = 0;
|
18
|
+
|
19
|
+
do {
|
20
|
+
chr1 = input.charCodeAt(i++);
|
21
|
+
chr2 = input.charCodeAt(i++);
|
22
|
+
chr3 = input.charCodeAt(i++);
|
23
|
+
|
24
|
+
enc1 = chr1 >> 2;
|
25
|
+
enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
|
26
|
+
enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
|
27
|
+
enc4 = chr3 & 63;
|
28
|
+
|
29
|
+
if (isNaN(chr2)) {
|
30
|
+
enc3 = enc4 = 64;
|
31
|
+
} else if (isNaN(chr3)) {
|
32
|
+
enc4 = 64;
|
33
|
+
}
|
34
|
+
|
35
|
+
output[p++] = KEYSTR.charAt(enc1);
|
36
|
+
output[p++] = KEYSTR.charAt(enc2);
|
37
|
+
output[p++] = KEYSTR.charAt(enc3);
|
38
|
+
output[p++] = KEYSTR.charAt(enc4);
|
39
|
+
} while (i < input.length);
|
40
|
+
|
41
|
+
return output.join('');
|
42
|
+
};
|
43
|
+
|
44
|
+
// Function: sketchily_decode64
|
45
|
+
// Converts a string from base64
|
46
|
+
var sketchily_decode64 = function(input) {
|
47
|
+
if(window.atob) return window.atob(input);
|
48
|
+
var output = "";
|
49
|
+
var chr1, chr2, chr3 = "";
|
50
|
+
var enc1, enc2, enc3, enc4 = "";
|
51
|
+
var i = 0;
|
52
|
+
|
53
|
+
// remove all characters that are not A-Z, a-z, 0-9, +, /, or =
|
54
|
+
input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
|
55
|
+
|
56
|
+
do {
|
57
|
+
enc1 = KEYSTR.indexOf(input.charAt(i++));
|
58
|
+
enc2 = KEYSTR.indexOf(input.charAt(i++));
|
59
|
+
enc3 = KEYSTR.indexOf(input.charAt(i++));
|
60
|
+
enc4 = KEYSTR.indexOf(input.charAt(i++));
|
61
|
+
|
62
|
+
chr1 = (enc1 << 2) | (enc2 >> 4);
|
63
|
+
chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
|
64
|
+
chr3 = ((enc3 & 3) << 6) | enc4;
|
65
|
+
|
66
|
+
output = output + String.fromCharCode(chr1);
|
67
|
+
|
68
|
+
if (enc3 != 64) {
|
69
|
+
output = output + String.fromCharCode(chr2);
|
70
|
+
}
|
71
|
+
if (enc4 != 64) {
|
72
|
+
output = output + String.fromCharCode(chr3);
|
73
|
+
}
|
74
|
+
|
75
|
+
chr1 = chr2 = chr3 = "";
|
76
|
+
enc1 = enc2 = enc3 = enc4 = "";
|
77
|
+
|
78
|
+
} while (i < input.length);
|
79
|
+
return unescape(output);
|
80
|
+
};
|
81
|
+
|
82
|
+
// Function: sketchily_convertToXMLReferences
|
83
|
+
// Converts a string to use XML references
|
84
|
+
sketchily_convertToXMLReferences = function(input) {
|
85
|
+
var output = '';
|
86
|
+
for (var n = 0; n < input.length; n++){
|
87
|
+
var c = input.charCodeAt(n);
|
88
|
+
if (c < 128) {
|
89
|
+
output += input[n];
|
90
|
+
} else if(c > 127) {
|
91
|
+
output += ("&#" + c + ";");
|
92
|
+
}
|
93
|
+
}
|
94
|
+
return output;
|
95
|
+
};
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sketchily
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-03-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -59,6 +59,38 @@ dependencies:
|
|
59
59
|
- - ! '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: minitest-rails
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
type: :development
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: minitest-rails-capybara
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ! '>='
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
86
|
+
type: :development
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
62
94
|
description: Sketchily adds another form input tag to your application designed to
|
63
95
|
allow the user to create or edit svg images through svg-edit.
|
64
96
|
email:
|
@@ -327,17 +359,31 @@ files:
|
|
327
359
|
- vendor/assets/svg-edit-2.6/jquerybbq/jquery.bbq.min.js
|
328
360
|
- vendor/assets/svg-edit-2.6/js-hotkeys/jquery.hotkeys.min.js
|
329
361
|
- vendor/assets/svg-edit-2.6/js-hotkeys/README.md
|
362
|
+
- vendor/assets/javascripts/base64.js
|
363
|
+
- vendor/assets/javascripts/base64.js~
|
330
364
|
- MIT-LICENSE
|
331
365
|
- Rakefile
|
332
366
|
- README.md
|
333
|
-
- spec/
|
367
|
+
- spec/minitest_helper.rb
|
368
|
+
- spec/features/sketchily_tag_spec.rb~
|
369
|
+
- spec/features/sketchily_tag.rb~
|
370
|
+
- spec/features/sketchily_tag_spec.rb
|
371
|
+
- spec/features/user_views_sketchily_spec.rb~
|
372
|
+
- spec/features/sketchily_spec.rb
|
373
|
+
- spec/features/sketchily_spec.rb~
|
374
|
+
- spec/features/sketchily.rb~
|
334
375
|
- spec/dummy/script/rails
|
335
376
|
- spec/dummy/Rakefile
|
336
377
|
- spec/dummy/README.rdoc
|
378
|
+
- spec/dummy/app/controllers/sketchily_controller.rb
|
337
379
|
- spec/dummy/app/controllers/application_controller.rb
|
338
380
|
- spec/dummy/app/assets/stylesheets/application.css
|
339
381
|
- spec/dummy/app/assets/javascripts/application.js
|
382
|
+
- spec/dummy/app/models/drawing.rb
|
383
|
+
- spec/dummy/app/models/drawing.rb~
|
340
384
|
- spec/dummy/app/helpers/application_helper.rb
|
385
|
+
- spec/dummy/app/views/sketchily/sketchily.html.erb
|
386
|
+
- spec/dummy/app/views/sketchily/sketchily_tag.html.erb
|
341
387
|
- spec/dummy/app/views/layouts/application.html.erb
|
342
388
|
- spec/dummy/config/locales/en.yml
|
343
389
|
- spec/dummy/config/environment.rb
|
@@ -352,14 +398,21 @@ files:
|
|
352
398
|
- spec/dummy/config/initializers/backtrace_silencers.rb
|
353
399
|
- spec/dummy/config/initializers/inflections.rb
|
354
400
|
- spec/dummy/config/boot.rb
|
401
|
+
- spec/dummy/config/routes.rb~
|
355
402
|
- spec/dummy/config/application.rb
|
356
403
|
- spec/dummy/config/database.yml
|
357
404
|
- spec/dummy/public/500.html
|
358
405
|
- spec/dummy/public/422.html
|
359
406
|
- spec/dummy/public/favicon.ico
|
360
407
|
- spec/dummy/public/404.html
|
408
|
+
- spec/dummy/log/test.log
|
361
409
|
- spec/dummy/log/development.log
|
362
410
|
- spec/dummy/config.ru
|
411
|
+
- spec/dummy/db/schema.rb
|
412
|
+
- spec/dummy/db/development.sqlite3
|
413
|
+
- spec/dummy/db/migrate/20130211122120_create_drawings.rb
|
414
|
+
- spec/dummy/db/test.sqlite3
|
415
|
+
- spec/spec_helper.rb~
|
363
416
|
- spec/lib/sketchily_spec.rb
|
364
417
|
homepage: http://github.com/lml/sketchily
|
365
418
|
licenses: []
|
@@ -386,14 +439,26 @@ signing_key:
|
|
386
439
|
specification_version: 3
|
387
440
|
summary: Easy svg-edit integration for any rails application.
|
388
441
|
test_files:
|
389
|
-
- spec/
|
442
|
+
- spec/minitest_helper.rb
|
443
|
+
- spec/features/sketchily_tag_spec.rb~
|
444
|
+
- spec/features/sketchily_tag.rb~
|
445
|
+
- spec/features/sketchily_tag_spec.rb
|
446
|
+
- spec/features/user_views_sketchily_spec.rb~
|
447
|
+
- spec/features/sketchily_spec.rb
|
448
|
+
- spec/features/sketchily_spec.rb~
|
449
|
+
- spec/features/sketchily.rb~
|
390
450
|
- spec/dummy/script/rails
|
391
451
|
- spec/dummy/Rakefile
|
392
452
|
- spec/dummy/README.rdoc
|
453
|
+
- spec/dummy/app/controllers/sketchily_controller.rb
|
393
454
|
- spec/dummy/app/controllers/application_controller.rb
|
394
455
|
- spec/dummy/app/assets/stylesheets/application.css
|
395
456
|
- spec/dummy/app/assets/javascripts/application.js
|
457
|
+
- spec/dummy/app/models/drawing.rb
|
458
|
+
- spec/dummy/app/models/drawing.rb~
|
396
459
|
- spec/dummy/app/helpers/application_helper.rb
|
460
|
+
- spec/dummy/app/views/sketchily/sketchily.html.erb
|
461
|
+
- spec/dummy/app/views/sketchily/sketchily_tag.html.erb
|
397
462
|
- spec/dummy/app/views/layouts/application.html.erb
|
398
463
|
- spec/dummy/config/locales/en.yml
|
399
464
|
- spec/dummy/config/environment.rb
|
@@ -408,12 +473,19 @@ test_files:
|
|
408
473
|
- spec/dummy/config/initializers/backtrace_silencers.rb
|
409
474
|
- spec/dummy/config/initializers/inflections.rb
|
410
475
|
- spec/dummy/config/boot.rb
|
476
|
+
- spec/dummy/config/routes.rb~
|
411
477
|
- spec/dummy/config/application.rb
|
412
478
|
- spec/dummy/config/database.yml
|
413
479
|
- spec/dummy/public/500.html
|
414
480
|
- spec/dummy/public/422.html
|
415
481
|
- spec/dummy/public/favicon.ico
|
416
482
|
- spec/dummy/public/404.html
|
483
|
+
- spec/dummy/log/test.log
|
417
484
|
- spec/dummy/log/development.log
|
418
485
|
- spec/dummy/config.ru
|
486
|
+
- spec/dummy/db/schema.rb
|
487
|
+
- spec/dummy/db/development.sqlite3
|
488
|
+
- spec/dummy/db/migrate/20130211122120_create_drawings.rb
|
489
|
+
- spec/dummy/db/test.sqlite3
|
490
|
+
- spec/spec_helper.rb~
|
419
491
|
- spec/lib/sketchily_spec.rb
|