magickly 1.4.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,85 +0,0 @@
1
- var Magickly = {
2
- $inputUrl: undefined,
3
- $resultUrl: undefined,
4
- $resultImage: undefined,
5
-
6
- inputUrl: undefined,
7
-
8
- queryParams: {},
9
-
10
- init: function(){
11
- this.$inputUrl = $('#input-url');
12
- this.$resultUrl = $('#result-url');
13
- this.$resultImage = $('#result-image');
14
-
15
- this.inputUrl = this.$inputUrl.val();
16
-
17
- this.$inputUrl.bind('paste', $.proxy(this.onSourceUrlEvent, this) );
18
- this.$inputUrl.keydown( $.proxy(this.onSourceUrlKeydown, this) );
19
- this.$inputUrl.change( $.proxy(this.onSourceUrlEvent, this) );
20
- $('input.effect[type="checkbox"]').change( $.proxy(this.onEffectToggle, this) );
21
-
22
- $('#halftone-slider').slider({
23
- value: 50,
24
- change: function(e, ui){
25
- Magickly.queryParams.halftone = ui.value;
26
- $(this).siblings('input[type="checkbox"]').attr('checked', 'true');
27
- Magickly.updateResultUrl.call(Magickly);
28
- }
29
- });
30
- },
31
-
32
- updateResultUrl: function(){
33
- var newSrc = window.location.href + '?src=' + this.inputUrl,
34
- queryString = $.param(this.queryParams);
35
-
36
- if (queryString){
37
- newSrc += '&' + queryString;
38
- }
39
-
40
- this.$resultImage.attr('src', newSrc);
41
- this.$resultUrl.val(newSrc);
42
- },
43
-
44
- onSourceUrlKeydown: function(e){
45
- if (e.which === 13){
46
- // ENTER key
47
- this.$inputUrl.blur();
48
- }
49
- },
50
-
51
- onSourceUrlEvent: function(){
52
- var newInputUrl = this.$inputUrl.val();
53
- if (newInputUrl !== this.inputUrl){
54
- this.inputUrl = newInputUrl;
55
- this.updateResultUrl();
56
- }
57
- },
58
-
59
- onEffectToggle: function(e){
60
- var $checkbox = $(e.currentTarget),
61
- effect = $checkbox.attr('name');
62
-
63
- if ($checkbox.is(':checked')){
64
- if ($checkbox.hasClass('slider-toggle')){
65
- var $slider = $('#' + effect + '-slider');
66
- sliderVal = $slider.slider('value');
67
-
68
- if (sliderVal === $slider.slider('option', 'value')){
69
- // default value
70
- this.queryParams[effect] = 'true';
71
- } else {
72
- this.queryParams[effect] = $slider.slider('value');
73
- }
74
- }
75
- } else {
76
- delete this.queryParams[effect];
77
- }
78
-
79
- this.updateResultUrl();
80
- }
81
- }
82
-
83
- $(function(){
84
- Magickly.init();
85
- });
data/lib/public/style.css DELETED
@@ -1,83 +0,0 @@
1
- body {
2
- background-color: white;
3
- font-size: 14px;
4
- line-height: 22px;
5
- font-family: Helvetica, Arial, sans-serif;
6
- color: #000000;
7
- font-weight: lighter;
8
- }
9
- p {
10
- padding: 18px;
11
- margin: 0;
12
- }
13
- .checkbox {
14
- width: 100px;
15
- }
16
- #container {
17
- width: 890px;
18
- text-align: left;
19
- margin: 0 auto;
20
- }
21
- #about {
22
- height: 125px;
23
- width: 821px;
24
- border: 1px solid #d2d2d2;
25
- background-color: #f7f7f7;
26
- color: #000;
27
- padding: 0;
28
- margin: 0 0 10px 0;
29
- }
30
- #main {
31
- position: absolute;
32
- }
33
- #readme-link {
34
- width: 788px;
35
- font-size: 2em;
36
- text-align: center;
37
- }
38
- #toggle-effects {
39
- float: left;
40
- width: 410px;
41
- min-height: 215px;
42
- background-color: yellow;
43
- display:block;
44
- }
45
- #adjustable-effects {
46
- float: right;
47
- width: 410px;
48
- min-height: 215px;
49
- background-color: pink;
50
- display:block;
51
- }
52
- #adjustable-effects .slider {
53
- width: 250px;
54
- }
55
- #result{
56
- height:auto;
57
- width: 410px;
58
- display:block;
59
- background: red;
60
- clear: both;
61
- }
62
-
63
- #footer {
64
- height:62px;
65
- width: 100%;
66
- display:block;
67
- background: #242524;
68
- color: white;
69
- margin: 44px 0 0 0;
70
- padding: 4px 0 0 0;
71
- }
72
- #left_foot{
73
- float:left;
74
- padding-left: 18px;
75
- }
76
- #right_foot{
77
- float: right;
78
- padding-right: 18px;
79
- }
80
- A:link {color: #468fa6; text-decoration: none;}
81
- A:visited {color: #468fa6; text-decoration: none;}
82
- A:active {color: #468fa6; text-decoration: none;}
83
- A:hover {color: #c9283b; text-decoration:none;}
@@ -1,6 +0,0 @@
1
- <% @analyzers.each do |analyzer| %>
2
- <a href="/analyze/<%= analyzer.to_s.chomp('?') %>?src=<%= Magickly::App::DEMO_IMAGE %>">
3
- <%= analyzer %>
4
- </a>
5
- <br/>
6
- <% end %>
data/lib/views/index.erb DELETED
@@ -1,38 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>Magickly</title>
5
- <link href="jquery-ui.smoothness.css" rel="stylesheet" type="text/css">
6
- <link href="style.css" rel="stylesheet" type="text/css">
7
- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
8
- <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script>
9
- <script type="text/javascript" src="magickly_demo.js"></script>
10
- <script type="text/javascript">
11
- var _gaq = _gaq || [];
12
- _gaq.push(['_setAccount', 'UA-22837777-1']);
13
- _gaq.push(['_trackPageview']);
14
-
15
- (function() {
16
- var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
17
- ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
18
- var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
19
- })();
20
- </script>
21
- </head>
22
- <body>
23
- <a href="https://github.com/afeld/magickly/blob/master/README.md">
24
- <img style="position: absolute; top: 0; left: 0; border: 0;" src="https://a248.e.akamai.net/assets.github.com/img/bec6c51521dcc8148146135149fe06a9cc737577/687474703a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f6c6566745f6461726b626c75655f3132313632312e706e67" alt="Fork me on GitHub">
25
- </a>
26
- <div id="container">
27
- <div id="logo">
28
- <a href="http://www.jux.com"><img width='822' height='244' src="images/logo.jpg"></a>
29
- </div>
30
- <div id="about"><p>Magickly is a web service for image manipulation, built as a wrapper of Imagemagick. This allows developers to apply effects to one (or hundreds) of photos, without any fancy plugins or complex client code. It's as easy as providing your source image and the list of transformations.</p></div>
31
- <div id="main">
32
- <p id="readme-link">
33
- Click <a href="https://github.com/afeld/magickly/blob/master/README.md">here</a> to learn more.
34
- </p>
35
- </div> <!--end main -->
36
- </div> <!-- end container -->
37
- </body>
38
- </html>
data/magickly.gemspec DELETED
@@ -1,97 +0,0 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
- # -*- encoding: utf-8 -*-
5
-
6
- Gem::Specification.new do |s|
7
- s.name = "magickly"
8
- s.version = "1.4.0"
9
-
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Aidan Feldman"]
12
- s.date = "2012-01-26"
13
- s.description = "A service for image manipulation - built as an extensible wrapper of Imagemagick which handles caching, c/o the Dragonfly gem."
14
- s.email = "aidan.feldman@gmail.com"
15
- s.extra_rdoc_files = [
16
- "LICENSE.txt",
17
- "README.md"
18
- ]
19
- s.files = [
20
- ".document",
21
- ".gemtest",
22
- ".rspec",
23
- ".travis.yml",
24
- "Gemfile",
25
- "Gemfile.lock",
26
- "HISTORY.md",
27
- "LICENSE.txt",
28
- "README.md",
29
- "Rakefile",
30
- "VERSION",
31
- "config.ru",
32
- "lib/dragonfly/data_storage/remote_data_store.rb",
33
- "lib/images/lomo_mask.png",
34
- "lib/magickly.rb",
35
- "lib/magickly/app.rb",
36
- "lib/public/imagemagick.png",
37
- "lib/public/images/logo.jpg",
38
- "lib/public/jquery-ui.smoothness.css",
39
- "lib/public/magickly_demo.js",
40
- "lib/public/style.css",
41
- "lib/shortcuts.rb",
42
- "lib/views/analyzers.erb",
43
- "lib/views/index.erb",
44
- "magickly.gemspec",
45
- "spec/requests/magickly_app_spec.rb",
46
- "spec/spec_helper.rb",
47
- "spec/support/imagemagick.png",
48
- "spec/unit/magickly_spec.rb",
49
- "spec/unit/remote_data_store_spec.rb",
50
- "spec/unit/shortcut_spec.rb"
51
- ]
52
- s.homepage = "http://github.com/afeld/magickly"
53
- s.licenses = ["MIT"]
54
- s.require_paths = ["lib"]
55
- s.rubygems_version = "1.8.15"
56
- s.summary = "image manipulation as a (plugin-able) service"
57
-
58
- if s.respond_to? :specification_version then
59
- s.specification_version = 3
60
-
61
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
62
- s.add_runtime_dependency(%q<sinatra>, ["~> 1.2"])
63
- s.add_runtime_dependency(%q<dragonfly>, ["~> 0.9.5"])
64
- s.add_runtime_dependency(%q<addressable>, ["~> 2.2"])
65
- s.add_runtime_dependency(%q<httparty>, ["~> 0.8.1"])
66
- s.add_runtime_dependency(%q<activesupport>, [">= 2.0.0"])
67
- s.add_development_dependency(%q<jeweler>, ["~> 1.5"])
68
- s.add_development_dependency(%q<rack-test>, [">= 0"])
69
- s.add_development_dependency(%q<rspec>, ["~> 2.4"])
70
- s.add_development_dependency(%q<webmock>, ["~> 1.6"])
71
- s.add_development_dependency(%q<imagesize>, ["~> 0.1"])
72
- else
73
- s.add_dependency(%q<sinatra>, ["~> 1.2"])
74
- s.add_dependency(%q<dragonfly>, ["~> 0.9.5"])
75
- s.add_dependency(%q<addressable>, ["~> 2.2"])
76
- s.add_dependency(%q<httparty>, ["~> 0.8.1"])
77
- s.add_dependency(%q<activesupport>, [">= 2.0.0"])
78
- s.add_dependency(%q<jeweler>, ["~> 1.5"])
79
- s.add_dependency(%q<rack-test>, [">= 0"])
80
- s.add_dependency(%q<rspec>, ["~> 2.4"])
81
- s.add_dependency(%q<webmock>, ["~> 1.6"])
82
- s.add_dependency(%q<imagesize>, ["~> 0.1"])
83
- end
84
- else
85
- s.add_dependency(%q<sinatra>, ["~> 1.2"])
86
- s.add_dependency(%q<dragonfly>, ["~> 0.9.5"])
87
- s.add_dependency(%q<addressable>, ["~> 2.2"])
88
- s.add_dependency(%q<httparty>, ["~> 0.8.1"])
89
- s.add_dependency(%q<activesupport>, [">= 2.0.0"])
90
- s.add_dependency(%q<jeweler>, ["~> 1.5"])
91
- s.add_dependency(%q<rack-test>, [">= 0"])
92
- s.add_dependency(%q<rspec>, ["~> 2.4"])
93
- s.add_dependency(%q<webmock>, ["~> 1.6"])
94
- s.add_dependency(%q<imagesize>, ["~> 0.1"])
95
- end
96
- end
97
-