From d9bb2df48ec6367b9990c989e7d6b405dc43a695 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 25 Oct 2017 13:44:28 -0700 Subject: [PATCH 01/57] thing --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index fe15d36..a791596 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # cloudnv Web app to identify pictures of clouds +-vu changes for branch thingie \ No newline at end of file From 027f27ae18460f0b233f940747124805e8701d7b Mon Sep 17 00:00:00 2001 From: AKmach Date: Wed, 25 Oct 2017 14:12:29 -0700 Subject: [PATCH 02/57] create files --- assets/css/reset.css | 0 assets/css/style.css | 0 assets/javascript/app.js | 0 index.html | 0 4 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 assets/css/reset.css create mode 100644 assets/css/style.css create mode 100644 assets/javascript/app.js create mode 100644 index.html diff --git a/assets/css/reset.css b/assets/css/reset.css new file mode 100644 index 0000000..e69de29 diff --git a/assets/css/style.css b/assets/css/style.css new file mode 100644 index 0000000..e69de29 diff --git a/assets/javascript/app.js b/assets/javascript/app.js new file mode 100644 index 0000000..e69de29 diff --git a/index.html b/index.html new file mode 100644 index 0000000..e69de29 From 66e0c1886cdfaa030ae5198e73d1854c4fbaa039 Mon Sep 17 00:00:00 2001 From: AKmach Date: Thu, 26 Oct 2017 10:20:59 -0700 Subject: [PATCH 03/57] git ignore for key file --- .gitignore | 1 + index.html | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8206e69 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +assets/javascript/keys.js \ No newline at end of file diff --git a/index.html b/index.html index e69de29..a3f0f14 100644 --- a/index.html +++ b/index.html @@ -0,0 +1,14 @@ + + + + + CloudNV + + + + + + + + + \ No newline at end of file From d452bc2f6a33169f45b9aee4b1e846e7518879d0 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 26 Oct 2017 14:10:04 -0700 Subject: [PATCH 04/57] frontend basics --- assets/css/reset.css | 48 ++++++++++++++++++++++++++++++++++++ assets/css/style.css | 43 ++++++++++++++++++++++++++++++++ assets/images/lion_king.jpg | Bin 0 -> 24525 bytes assets/javascript/dnd.js | 0 index.html | 45 +++++++++++++++++++++++++++++---- 5 files changed, 131 insertions(+), 5 deletions(-) create mode 100644 assets/images/lion_king.jpg create mode 100644 assets/javascript/dnd.js diff --git a/assets/css/reset.css b/assets/css/reset.css index e69de29..af94440 100644 --- a/assets/css/reset.css +++ b/assets/css/reset.css @@ -0,0 +1,48 @@ +/* http://meyerweb.com/eric/tools/css/reset/ + v2.0 | 20110126 + License: none (public domain) +*/ + +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +b, u, i, center, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td, +article, aside, canvas, details, embed, +figure, figcaption, footer, header, hgroup, +menu, nav, output, ruby, section, summary, +time, mark, audio, video { + margin: 0; + padding: 0; + border: 0; + font-size: 100%; + font: inherit; + vertical-align: baseline; +} +/* HTML5 display-role reset for older browsers */ +article, aside, details, figcaption, figure, +footer, header, hgroup, menu, nav, section { + display: block; +} +body { + line-height: 1; +} +ol, ul { + list-style: none; +} +blockquote, q { + quotes: none; +} +blockquote:before, blockquote:after, +q:before, q:after { + content: ''; + content: none; +} +table { + border-collapse: collapse; + border-spacing: 0; +} \ No newline at end of file diff --git a/assets/css/style.css b/assets/css/style.css index e69de29..4b25bd4 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -0,0 +1,43 @@ +.panel { + background-color: #0099ff; + color: white; + height: 80px; + text-align: center; +} + +.container-fluid { + width: 80%; + height: 500px; + background: url(../images/lion_king.jpg) no-repeat center center fixed; + -webkit-background-size: cover; + -moz-background-size: cover; + -o-background-size: cover; + background-size: cover; +} + +#drag { + + padding: 100px; +} + +.col-md-12, +.col-md-4 { + margin-bottom: 20px; + border-style: solid; + border-width: 2px; + background-color: white; + color: black; + opacity: 0.45; +} + +.col-md-12 { + text-align: center; +} + +.col-md-6 { + margin-bottom: 20px; +} + +#cloud-type {} + +#cloud-fact {} \ No newline at end of file diff --git a/assets/images/lion_king.jpg b/assets/images/lion_king.jpg new file mode 100644 index 0000000000000000000000000000000000000000..1bdd5355c95fa7c21eb3addd31162cfa16f5f8da GIT binary patch literal 24525 zcmcG!Rajij6F!K$1lK@t8Qd+nyA3i}aEGA50wDy~0cOzPgS)%C26uuJEI0uIVdwk( zcb~o6yX`p_-A|qFu5;>Czi-vl>&ojk!W&gZ6-5L@L<9sx_z&TA9pM`SDl!TtCORqx zCcL4e!Y}myU1;d2sHhld81ROP^#&IM0}m4w1BV0$kAQ%PhzK2x1c zp=01+VBiws;NTGce>ECH8p8iw|8;2o@BV8q0s#i11L8I^B0T~U0U|O1;_Dy+HC#s& zWVn+5Z$m;xK}AGE$AC*s-yk3%A|a!qpuqLRMngeIfR7LePzdQziRgJ{(D-yLiDf;& z=ok#Tq4}_Vaw}WUuXTNwB>W0`z~q8iMmg)Sl=}Ypg`F!>0eSszjb5pcK{6)q@TR$I z`05mh|EK-GTmQE_3MyR0M1X*V^q*pg2>*|Ah)4v4$V7C!C^GO(={@TBUe^$C;6fw< zWC8>!gewTKjx@230)mbLF`@#oHtPTXL$lr>1lnWnhVDDnXWE(D+|{1}RaTRS2~-N7 zc&|d9%kJH`$_5`ge?ID+{p`{sh8#xqtJ+o>Nl-KA#9drBfq4uAV)C=Gul{OafU;1CbMI)*I_^o*t z#RJbjBlxf>w=e8^>=ofy>N9-Ce-g6)Nw_akgK?ywlH-35Pz$HM4GVkFXeVfGKVK*I zeR)Mt{|xyvjxBKzz-=B+OS1REdvEv?Aocb5|K1@{M8`bwnQZ2E1g=Pt%9SNx#^wLa zIEK%NkRr{6FZFUA{?KUgKc%&865kten@7`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d.js b/assets/javascript/dnd.js new file mode 100644 index 0000000..e69de29 diff --git a/index.html b/index.html index a3f0f14..3ff3d79 100644 --- a/index.html +++ b/index.html @@ -1,14 +1,49 @@ + CloudNV + + + - - - - - + +
+

CloudNV

+
+
+
+
Image Box Drop Thingie
+ +
+
+
+ Enter Image URL + + +
+ +
+
+
+ Insert Image (placeholder) +
+
+
+ Cloud Type: Cumulonimbus +
+
+ Random Fact: Dense, towering, vertical cloud +
+
+
+
+ + + + + \ No newline at end of file From 5ad3b7566d073f86daacb56f4d9b44cb00ea257c Mon Sep 17 00:00:00 2001 From: asajbel Date: Thu, 26 Oct 2017 14:33:54 -0700 Subject: [PATCH 05/57] imgur ajax oauth2 setup --- assets/javascript/imgur.js | 70 ++++++++++++++++++++++++++++++++++++++ index.html | 1 + 2 files changed, 71 insertions(+) create mode 100644 assets/javascript/imgur.js diff --git a/assets/javascript/imgur.js b/assets/javascript/imgur.js new file mode 100644 index 0000000..c5a70ae --- /dev/null +++ b/assets/javascript/imgur.js @@ -0,0 +1,70 @@ +var imgur_id = "cffdbdcf9cb88c7"; +var imgur_sec = "4e806c50fb260cc521bfe11d4e7edfa22cfbf684"; + +authURL = "https://api.imgur.com/oauth2/authorize?client_id="+imgur_id+"&response_type=token" + +// $.ajax({ +// "url": authURL, +// "method": "GET" +// }).done(function (response){ +// console.log(response); +// }); + +var token = "" + +var form = new FormData(); +form.append("refresh_token", "4c771b1e1055e3eb3adee452a2155ebd258392d1"); +form.append("client_id", "cffdbdcf9cb88c7"); +form.append("client_secret", "4e806c50fb260cc521bfe11d4e7edfa22cfbf684"); +form.append("grant_type", "refresh_token"); + +var settings = { + "async": true, + "crossDomain": true, + "url": "https://api.imgur.com/oauth2/token", + "method": "POST", + "headers": {}, + "processData": false, + "contentType": false, + "mimeType": "multipart/form-data", + "data": form +} + + + +$.ajax(settings).done(function (response) { + var res = JSON.parse(response); + console.log(JSON.parse(response)); + token = res.access_token; + console.log(token); + + var accountGet = { + "async": true, + "crossDomain": true, + "url": "https://api.imgur.com/3/account/voidreturner", + "method": "GET", + "headers": {"authorization": `Bearer ${token}`}, +} +console.log(accountGet.headers); + $.ajax(accountGet).done(function (response){ + console.log(response); + }) +$.ajax( { + "url": "https://api.imgur.com/3/account/me/images", + "meathod": "GET", + "headers": {"authorization": `Bearer ${token}`} +}).done (function (response) { + console.log(response); +}); +}); + +$.ajax( { + "async": true, + "crossDomain": true, + "url": "https://api.imgur.com/3/account/images", + "meathod": "GET", + "headers": {"authorization": `Client-ID ${imgur_id}`} +}).done (function (response) { + console.log("Client-ID:"); + console.log(response); +}); \ No newline at end of file diff --git a/index.html b/index.html index a3f0f14..5872899 100644 --- a/index.html +++ b/index.html @@ -10,5 +10,6 @@ + \ No newline at end of file From 930caa5bdba4cdf752f0a01df7e1b113a9b9656d Mon Sep 17 00:00:00 2001 From: asajbel Date: Thu, 26 Oct 2017 17:34:38 -0700 Subject: [PATCH 06/57] testing image upload --- assets/javascript/imgur.html | 47 ++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 assets/javascript/imgur.html diff --git a/assets/javascript/imgur.html b/assets/javascript/imgur.html new file mode 100644 index 0000000..0e65976 --- /dev/null +++ b/assets/javascript/imgur.html @@ -0,0 +1,47 @@ + + + + + IMGUR TEST + + + + +
+
+ + +

Add Images

+ +
+ + + + + \ No newline at end of file From fb85eb3b166401063617e747b8b2bdc03ffb13e4 Mon Sep 17 00:00:00 2001 From: asajbel Date: Thu, 26 Oct 2017 20:22:05 -0700 Subject: [PATCH 07/57] Able to read and upload a file to imgur getting back a url --- .gitignore | 1 - assets/javascript/imgur.js | 123 +++++++++------------ assets/javascript/keys.js | 4 + assets/javascript/imgur.html => imgur.html | 34 ++++++ index.html | 8 +- 5 files changed, 98 insertions(+), 72 deletions(-) create mode 100644 assets/javascript/keys.js rename assets/javascript/imgur.html => imgur.html (51%) diff --git a/.gitignore b/.gitignore index 8206e69..e69de29 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +0,0 @@ -assets/javascript/keys.js \ No newline at end of file diff --git a/assets/javascript/imgur.js b/assets/javascript/imgur.js index c5a70ae..6b4d54a 100644 --- a/assets/javascript/imgur.js +++ b/assets/javascript/imgur.js @@ -1,70 +1,53 @@ -var imgur_id = "cffdbdcf9cb88c7"; -var imgur_sec = "4e806c50fb260cc521bfe11d4e7edfa22cfbf684"; - -authURL = "https://api.imgur.com/oauth2/authorize?client_id="+imgur_id+"&response_type=token" - -// $.ajax({ -// "url": authURL, -// "method": "GET" -// }).done(function (response){ -// console.log(response); -// }); - -var token = "" - -var form = new FormData(); -form.append("refresh_token", "4c771b1e1055e3eb3adee452a2155ebd258392d1"); -form.append("client_id", "cffdbdcf9cb88c7"); -form.append("client_secret", "4e806c50fb260cc521bfe11d4e7edfa22cfbf684"); -form.append("grant_type", "refresh_token"); - -var settings = { - "async": true, - "crossDomain": true, - "url": "https://api.imgur.com/oauth2/token", - "method": "POST", - "headers": {}, - "processData": false, - "contentType": false, - "mimeType": "multipart/form-data", - "data": form -} - - - -$.ajax(settings).done(function (response) { - var res = JSON.parse(response); - console.log(JSON.parse(response)); - token = res.access_token; - console.log(token); - - var accountGet = { - "async": true, - "crossDomain": true, - "url": "https://api.imgur.com/3/account/voidreturner", - "method": "GET", - "headers": {"authorization": `Bearer ${token}`}, -} -console.log(accountGet.headers); - $.ajax(accountGet).done(function (response){ - console.log(response); - }) -$.ajax( { - "url": "https://api.imgur.com/3/account/me/images", - "meathod": "GET", - "headers": {"authorization": `Bearer ${token}`} -}).done (function (response) { - console.log(response); -}); -}); - -$.ajax( { - "async": true, - "crossDomain": true, - "url": "https://api.imgur.com/3/account/images", - "meathod": "GET", - "headers": {"authorization": `Client-ID ${imgur_id}`} -}).done (function (response) { - console.log("Client-ID:"); - console.log(response); -}); \ No newline at end of file + function gotImage(event) { + var reader = event.target; + $("#displayImage").attr("src", reader.result); + var base64result = reader.result.split(',')[1]; + var form = new FormData(); + form.append("image", base64result); + + var settings = { + "async": true, + "crossDomain": true, + "url": "https://api.imgur.com/3/image", + "method": "POST", + "headers": { + "authorization": `Client-ID ${apiKey.imgur_client_id}` + }, + "processData": false, + "contentType": false, + "mimeType": "multipart/form-data", + "data": form + } + + $.ajax(settings).done(function(response) { + var res = JSON.parse(response); + console.log(res.data.link); + }); + } + + function  readPic(event)  { + console.log(event); + console.log($(this)); + var file = this.files[0]; + var reader = new FileReader(); + reader.onloadend = gotImage; + reader.readAsDataURL(file); + + } + + $(document).ready(function addUpload() { + + var imgur_client_id = "cffdbdcf9cb88c7"; + var imgur_sec = "4e806c50fb260cc521bfe11d4e7edfa22cfbf684"; + var authURL = "https://api.imgur.com/oauth2/authorize?client_id=" + imgur_client_id + "&response_type=token" + var token = "" + + var form = new FormData(); + form.append("refresh_token", "4c771b1e1055e3eb3adee452a2155ebd258392d1"); + form.append("client_id", "cffdbdcf9cb88c7"); + form.append("client_secret", "4e806c50fb260cc521bfe11d4e7edfa22cfbf684"); + form.append("grant_type", "refresh_token"); + + $("#uploadBtn").on("change", readPic); + + }); \ No newline at end of file diff --git a/assets/javascript/keys.js b/assets/javascript/keys.js new file mode 100644 index 0000000..d9b70f7 --- /dev/null +++ b/assets/javascript/keys.js @@ -0,0 +1,4 @@ +var apiKey = { + vision: "AIzaSyCx1GhLhN-MJGgS4uItlichD2gxgtWQag8", + imgur_client_id: "cffdbdcf9cb88c7" +} \ No newline at end of file diff --git a/assets/javascript/imgur.html b/imgur.html similarity index 51% rename from assets/javascript/imgur.html rename to imgur.html index 0e65976..8b4ef63 100644 --- a/assets/javascript/imgur.html +++ b/imgur.html @@ -21,7 +21,12 @@ +
+ + diff --git a/index.html b/index.html index 62fc69b..8dd2d9d 100644 --- a/index.html +++ b/index.html @@ -14,7 +14,9 @@

CloudNV

-
Image Box Drop Thingie
+
Image Box Drop Thingie +
+
@@ -22,11 +24,15 @@

CloudNV

Enter Image URL +
+ +
+
Insert Image (placeholder)
From a344bf767ce06d81597d1608d9d1ab3cfc1b9b88 Mon Sep 17 00:00:00 2001 From: AKmach Date: Fri, 27 Oct 2017 10:11:11 -0700 Subject: [PATCH 08/57] commit api temp --- assets/javascript/app.js | 281 +++++++++++++++++++++++++++++++++++++++ index.html | 2 +- 2 files changed, 282 insertions(+), 1 deletion(-) diff --git a/assets/javascript/app.js b/assets/javascript/app.js index e69de29..90d9e8f 100644 --- a/assets/javascript/app.js +++ b/assets/javascript/app.js @@ -0,0 +1,281 @@ + + +var response = new XMLHttpRequest; +var imageResults = []; +var cloudWord; + +function getWikiResults() { + + console.log(cloudWord); + + var wikiURL = "https://en.wikipedia.org/w/api.php"; + + wikiURL += "?" + $.param({ + "action" : "query", + "list" : "search", + "srsearch" : cloudWord, + "srwhat" : "text", + "format" : "json", + }); + + $.ajax({ + url: wikiURL, + dataType: "jsonp" + }).done(function(result) { + + var resultArray = result.query.search; + console.log(resultArray); + console.log("http://en.wikipedia.org/?curid=" + resultArray[0].pageid); + + }).fail(function(err) { + throw err; + }); + +} + + +function getBestDescriptor() { + // TODO: split word into array so two words can both be searched + for (var i = 0; i < imageResults.length; i++) { + if (specialClouds.indexOf(imageResults[i]) !== -1) { + cloudWord = imageResults[i]; + return cloudWord; + } + else if (cloudSpecies.indexOf(imageResults[i]) !== -1) { + cloudWord = imageResults[i]; + return cloudWord; + } + else if (cloudFamilies.indexOf(imageResults[i]) !== -1) { + cloudWord = imageResults[i]; + return cloudWord; + } + } +} + + +response.onload = function() { + imageResults = []; + var result = JSON.parse(response.responseText); + if (result.responses[0].error) { + console.log(result.responses[0].error); + } + else { + var resultWebDetect = result.responses[0].webDetection.webEntities; + var resultLabels = result.responses[0].labelAnnotations; + for (var i = 0; i < resultWebDetect.length; i++) { + var cloudWord = resultWebDetect[i].description; + if (cloudWord) { + imageResults.push(cloudWord.toLowerCase()); + } + } + for (var i = 0; i < resultLabels.length; i++) { + var cloudWord = resultLabels[i].description; + if (cloudWord) { + imageResults.push(cloudWord.toLowerCase()); + } + } + console.log(imageResults); + cloudWord = getBestDescriptor(); + if (cloudWord) { + getWikiResults(); + } + } +}; + + +$(document.body).ready(function(event) { + + var imageUri = "https://upload.wikimedia.org/wikipedia/commons/thumb/7/73/Cirrus_clouds2.jpg/220px-Cirrus_clouds2.jpg"; //temp test image + + var request = JSON.stringify( + { + "requests":[ + { + "image":{ + "source":{ + "imageUri": + imageUri + } + }, + "features":[ + { + "type":"WEB_DETECTION", + "maxResults":10 + }, + { + "type":"LABEL_DETECTION", + "maxResults":10 + } + ] + } + ] + } + ); + + response.open("POST","https://vision.googleapis.com/v1/images:annotate?key=" + apiKey.vision, !0); + + response.send(request); +}); + + + + +var cloudFamilies = [ + "cirrus", + "cirrostratus", + "cirrocumulus", + "altocumulus", + "altostratus", + "stratocumulus", + "stratus", + "cumulus", + "cumulonimbus", + "nimbostratus" +]; + +var cloudSpecies = [ + "calvus", + "capillatus", + "castellanus", + "congestus", + "fibratus", + "floccus", + "fractus", + "humilis", + "lenticularis", + "mediocris", + "nebulosus", + "spissatus", + "stratiformis", + "uncinus", + "duplicatus", + "intortus", + "lacunosus", + "opacus", + "perlucidus", + "radiatus", + "translucidus", + "undulatus", + "vertebratus", + "arcus", + "incus", + "mamma", + "pannus", + "pileus", + "praecipitatio", + "tuba", + "velum", + "virga" +]; + + +var specialClouds = [ + "noctilucent", + "polar stratospheric", + "cirriform", + "nacreous", + "non-nacreous", + "stratospheric nacreous", + "columnar", + "tropospheric", + "cumulonimbus", + "nimbostratus", + "high-level cirriform", + "stratocumuliform", + "stratiform", + "high clouds", + "genus cirrus", + "cirrus uncinus", + "cirrus spissatus", + "cirrus fibratus radiatus", + "cirriform clouds", + "cirrus", + "cirrus fibratus", + "cirrus uncinus", + "cirrus spissatus", + "cirrus castellanus", + "cirrus floccus", + "cirrus fibratus intortus", + "cirrus fibratus vertebratus", + "pattern-based variety radiatus", + "fibratus", + "uncinus", + "cirrus fibratus radiatus", + "cirrus uncinus radiatus", + "pattern-based variety duplicatus", + "cirrus fibratus duplicatus", + "cirrus uncinus duplicatus", + "spissatus", + "castellanus", + "floccus", + "castellanus", + "genitus mother clouds", + "cirrus cirrocumulogenitus", + "cirrus altocumulogenitus", + "cirrus cumulonimbogenitus", + "cirrus homogenitus", + "aircraft contrails", + "mutatus mother cloud", + "cirrus cirrostratomutatus", + "genus cirrocumulus", + "cirrocumulus stratiformis", + "high-level stratocumuliform", + "cirrocumulus", + "stratocumuliform genus", + "high stratocumuliform species", + "cirrocumulus stratiformis", + "cirrocumulus lenticularis", + "lenticular", + "cirrocumulus castellanus", + "cirrocumulus floccus", + "stratocumuliform", + "undulatus", + "cirrocumulus", + "stratiformis", + "lenticularis", + "cirrocumulus stratiformis undulatus", + "cirrocumulus lenticularis undulatus", + "lacunosus", + "castellanus", + "cumuliform floccus", + "stratocumuliform lacunosus", + "cirrocumulus stratiformis lacunosus", + "cirrocumulus castellanus lacunosus", + "cirrocumulus floccus lacunosus", + "virga", + "stratiformis", + "castellanus", + "floccus", + "genitus mother clouds", + "cirrocumulus homogenitus", + "mutatus mother clouds", + "cirrocumulus cirromutatus", + "cirrocumulus cirrostratomutatus", + "cirrocumulus altocumulomutatus", + "genus cirrostratus", + "cirrostratus nebulosus", + "altostratus translucidus", + "cirrostratus", + "altostratus", + "nimbostratus", + "cirrostratus fibratus", + "cirrostratus fibratus duplicatus", + "cirrostratus fibratus undulatus", + "genitus mother clouds", + "cirrostratus cirrocumulogenitus", + "cirrostratus cumulonimbogenitus", + "cirrostratus homogenitus", + "cirrostratus cirromutatus", + "cirrostratus cirrocumulomutatus", + "cirrostratus altostratomutatus", + "genus altocumulus", + "altocumulus stratiformis", + "altocumulus lenticularis", + "altocumulus volutus", + "altocumulus castellanus", + "altocumulus floccus" +]; + + + + diff --git a/index.html b/index.html index 3ff3d79..4301e44 100644 --- a/index.html +++ b/index.html @@ -41,7 +41,7 @@

CloudNV

- + From f4ab420bdbde2e22b3524530090fc2b6c779b1bb Mon Sep 17 00:00:00 2001 From: AKmach Date: Fri, 27 Oct 2017 10:22:56 -0700 Subject: [PATCH 09/57] add id to index for image url search --- assets/javascript/app.js | 8 ++++++-- index.html | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/assets/javascript/app.js b/assets/javascript/app.js index 90d9e8f..210b1eb 100644 --- a/assets/javascript/app.js +++ b/assets/javascript/app.js @@ -83,9 +83,13 @@ response.onload = function() { }; -$(document.body).ready(function(event) { +$("#submit").on("click", function(event) { - var imageUri = "https://upload.wikimedia.org/wikipedia/commons/thumb/7/73/Cirrus_clouds2.jpg/220px-Cirrus_clouds2.jpg"; //temp test image + event.preventDefault(); + + imageUri = $("#image-url").val().trim(); + + // var imageUri = "https://upload.wikimedia.org/wikipedia/commons/thumb/7/73/Cirrus_clouds2.jpg/220px-Cirrus_clouds2.jpg"; //temp test image var request = JSON.stringify( { diff --git a/index.html b/index.html index 8dd2d9d..44ee74c 100644 --- a/index.html +++ b/index.html @@ -22,8 +22,8 @@

CloudNV

Enter Image URL - - + +
From 786700bc32c2392041e7d714143297e57a944eae Mon Sep 17 00:00:00 2001 From: AKmach Date: Fri, 27 Oct 2017 10:55:33 -0700 Subject: [PATCH 10/57] reorganize cloud search - determining term significance --- assets/javascript/app.js | 160 +++++++++++++++++---------------------- 1 file changed, 68 insertions(+), 92 deletions(-) diff --git a/assets/javascript/app.js b/assets/javascript/app.js index 210b1eb..5f0518c 100644 --- a/assets/javascript/app.js +++ b/assets/javascript/app.js @@ -3,14 +3,11 @@ var response = new XMLHttpRequest; var imageResults = []; var cloudWord; +var cloudWordArray = []; function getWikiResults() { - console.log(cloudWord); - - var wikiURL = "https://en.wikipedia.org/w/api.php"; - - wikiURL += "?" + $.param({ + var wikiURL = "https://en.wikipedia.org/w/api.php?" + $.param({ "action" : "query", "list" : "search", "srsearch" : cloudWord, @@ -22,32 +19,24 @@ function getWikiResults() { url: wikiURL, dataType: "jsonp" }).done(function(result) { - var resultArray = result.query.search; - console.log(resultArray); - console.log("http://en.wikipedia.org/?curid=" + resultArray[0].pageid); - + console.log("wikipedia query result", resultArray); + console.log("top wikipedia url: http://en.wikipedia.org/?curid=" + resultArray[0].pageid); }).fail(function(err) { throw err; }); - } function getBestDescriptor() { // TODO: split word into array so two words can both be searched - for (var i = 0; i < imageResults.length; i++) { - if (specialClouds.indexOf(imageResults[i]) !== -1) { - cloudWord = imageResults[i]; - return cloudWord; - } - else if (cloudSpecies.indexOf(imageResults[i]) !== -1) { - cloudWord = imageResults[i]; - return cloudWord; - } - else if (cloudFamilies.indexOf(imageResults[i]) !== -1) { - cloudWord = imageResults[i]; - return cloudWord; + for (var i = 0; i < cloudWordArray.length; i++) { + // if the cloud word in the array exists in the google vision results + if (imageResults.indexOf(cloudWordArray[i]) !== -1) { + // set the cloud word + cloudWord = cloudWordArray[i]; + console.log("chosen word: " + cloudWord); + return; } } } @@ -57,13 +46,18 @@ response.onload = function() { imageResults = []; var result = JSON.parse(response.responseText); if (result.responses[0].error) { + // Check if there was a response + // TODO: notify user there was a time-out console.log(result.responses[0].error); } else { var resultWebDetect = result.responses[0].webDetection.webEntities; var resultLabels = result.responses[0].labelAnnotations; + console.log("web detect results", resultWebDetect); + console.log("label detect results", resultLabels); for (var i = 0; i < resultWebDetect.length; i++) { var cloudWord = resultWebDetect[i].description; + // TODO: remove the word "cloud" from the description if (cloudWord) { imageResults.push(cloudWord.toLowerCase()); } @@ -74,9 +68,10 @@ response.onload = function() { imageResults.push(cloudWord.toLowerCase()); } } - console.log(imageResults); - cloudWord = getBestDescriptor(); + console.log("image description results", imageResults); + getBestDescriptor(); if (cloudWord) { + // if the cloud type was found in our cloud word array getWikiResults(); } } @@ -84,30 +79,21 @@ response.onload = function() { $("#submit").on("click", function(event) { - event.preventDefault(); - - imageUri = $("#image-url").val().trim(); - - // var imageUri = "https://upload.wikimedia.org/wikipedia/commons/thumb/7/73/Cirrus_clouds2.jpg/220px-Cirrus_clouds2.jpg"; //temp test image - + var imageUri = $("#image-url").val().trim(); var request = JSON.stringify( - { - "requests":[ - { - "image":{ + { "requests":[ + { "image":{ "source":{ "imageUri": imageUri } }, "features":[ - { - "type":"WEB_DETECTION", + { "type":"WEB_DETECTION", "maxResults":10 }, - { - "type":"LABEL_DETECTION", + { "type":"LABEL_DETECTION", "maxResults":10 } ] @@ -115,65 +101,13 @@ $("#submit").on("click", function(event) { ] } ); - response.open("POST","https://vision.googleapis.com/v1/images:annotate?key=" + apiKey.vision, !0); - response.send(request); }); - -var cloudFamilies = [ - "cirrus", - "cirrostratus", - "cirrocumulus", - "altocumulus", - "altostratus", - "stratocumulus", - "stratus", - "cumulus", - "cumulonimbus", - "nimbostratus" -]; - -var cloudSpecies = [ - "calvus", - "capillatus", - "castellanus", - "congestus", - "fibratus", - "floccus", - "fractus", - "humilis", - "lenticularis", - "mediocris", - "nebulosus", - "spissatus", - "stratiformis", - "uncinus", - "duplicatus", - "intortus", - "lacunosus", - "opacus", - "perlucidus", - "radiatus", - "translucidus", - "undulatus", - "vertebratus", - "arcus", - "incus", - "mamma", - "pannus", - "pileus", - "praecipitatio", - "tuba", - "velum", - "virga" -]; - - -var specialClouds = [ +cloudWordArray = [ "noctilucent", "polar stratospheric", "cirriform", @@ -277,7 +211,49 @@ var specialClouds = [ "altocumulus lenticularis", "altocumulus volutus", "altocumulus castellanus", - "altocumulus floccus" + "altocumulus floccus", + "calvus", + "capillatus", + "castellanus", + "congestus", + "fibratus", + "floccus", + "fractus", + "humilis", + "lenticularis", + "mediocris", + "nebulosus", + "spissatus", + "stratiformis", + "uncinus", + "duplicatus", + "intortus", + "lacunosus", + "opacus", + "perlucidus", + "radiatus", + "translucidus", + "undulatus", + "vertebratus", + "arcus", + "incus", + "mamma", + "pannus", + "pileus", + "praecipitatio", + "tuba", + "velum", + "virga", + "cirrus", + "cirrostratus", + "cirrocumulus", + "altocumulus", + "altostratus", + "stratocumulus", + "stratus", + "cumulus", + "cumulonimbus", + "nimbostratus" ]; From 32a4f17b2cfc9b3891eebd03b0ba3004b064a323 Mon Sep 17 00:00:00 2001 From: Emery Cho Date: Fri, 27 Oct 2017 11:44:37 -0700 Subject: [PATCH 11/57] layout tune --- assets/css/style.css | 28 ++++++++++++++++++++++++++-- index.html | 4 ++-- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/assets/css/style.css b/assets/css/style.css index 4b25bd4..fe1a52e 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -35,9 +35,33 @@ } .col-md-6 { - margin-bottom: 20px; + margin-bottom: 10px; + positon: center; } #cloud-type {} -#cloud-fact {} \ No newline at end of file +#cloud-fact {} + +.upload { + margin-right: 0; + margin-left: 10px; +} + +#uploadBtn { + margin-right: 0; + margin-bottom: 10px; + border-bottom: 50px; + float: left; + padding-top: 20px; +} + +label { + margin-top: 20px; + float: left; + margin-left: 20px; +} + +b { + margin-right: 5px; +} \ No newline at end of file diff --git a/index.html b/index.html index 44ee74c..a1e8370 100644 --- a/index.html +++ b/index.html @@ -20,12 +20,12 @@

CloudNV

- + Enter Image URL
- + From 991bedc970a5bcea1c3608aff233d0ea7d37f883 Mon Sep 17 00:00:00 2001 From: Emery Cho Date: Fri, 27 Oct 2017 12:19:21 -0700 Subject: [PATCH 12/57] layout tune --- assets/css/style.css | 25 ++++++++++++++++++++++++- index.html | 14 +++++++++----- 2 files changed, 33 insertions(+), 6 deletions(-) diff --git a/assets/css/style.css b/assets/css/style.css index 4b25bd4..33682a7 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -40,4 +40,27 @@ #cloud-type {} -#cloud-fact {} \ No newline at end of file +#cloud-fact {} + +.upload { + margin-right: 0; + margin-left: 10px; +} + +#uploadBtn { + margin-right: 0; + margin-bottom: 10px; + border-bottom: 50px; + float: left; + padding-top: 20px; +} + +label { + margin-top: 20px; + float: left; + margin-left: 20px; +} + +b { + margin-right: 5px; +} \ No newline at end of file diff --git a/index.html b/index.html index 3ff3d79..a0fe72a 100644 --- a/index.html +++ b/index.html @@ -19,15 +19,19 @@

CloudNV

-
+ Enter Image URL +
+ +
+
Insert Image (placeholder)
@@ -40,10 +44,10 @@

CloudNV

- - - - + + + + \ No newline at end of file From aa2731f1ec3f2d7ee3d7cef398edbf9fc4a7da91 Mon Sep 17 00:00:00 2001 From: asajbel Date: Fri, 27 Oct 2017 13:07:59 -0700 Subject: [PATCH 13/57] drag and drop works on imgur.html --- imgur.html | 56 ++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 44 insertions(+), 12 deletions(-) diff --git a/imgur.html b/imgur.html index 8b4ef63..ee61b4d 100644 --- a/imgur.html +++ b/imgur.html @@ -4,18 +4,22 @@ IMGUR TEST -
-
+
Drag & Drop Files Here
+
+

Add Images

@@ -41,11 +45,31 @@ var data = ev.dataTransfer.getData("file"); } - document.getElementById("uploadBtn").onchange  =   function (event)  { - document.getElementById("uploadFile").value  =  this.value; - console.log(event); - console.log(this.value); - var file = this.files[0]; + var obj = $("#dragandrophandler"); + obj.on('dragenter', function(e) { + e.stopPropagation(); + e.preventDefault(); + $(this).css('border', '2px solid #0B85A1'); + }); + obj.on('dragover', function(e) { + e.stopPropagation(); + e.preventDefault(); + }); + obj.on('drop', function(e) { + + $(this).css('border', '2px dotted #0B85A1'); + e.preventDefault(); + var files = e.originalEvent.dataTransfer.files; + + //We need to send dropped files to Server + console.log(files); + for (var i = 0; i < files.length; i++){ + readFile(files[i]); + } + }); + + function readFile(file){ + console.log(file); var reader = new FileReader(); reader.onloadend = function() { $("#displayImage").attr("src", reader.result); @@ -73,6 +97,14 @@ }); } reader.readAsDataURL(file); + } + + document.getElementById("uploadBtn").onchange  =   function (event)  { + document.getElementById("uploadFile").value  =  this.value; + console.log(event); + console.log(this.value); + var file = this.files[0]; + readFile(file); }; From c8c6428f3657627986e945decb0d58f6ece54b6f Mon Sep 17 00:00:00 2001 From: AKmach Date: Fri, 27 Oct 2017 13:39:35 -0700 Subject: [PATCH 14/57] add cloud types and search order --- assets/javascript/app.js | 341 +++++++++++++++++++++++---------------- 1 file changed, 206 insertions(+), 135 deletions(-) diff --git a/assets/javascript/app.js b/assets/javascript/app.js index 5f0518c..0633abb 100644 --- a/assets/javascript/app.js +++ b/assets/javascript/app.js @@ -3,14 +3,16 @@ var response = new XMLHttpRequest; var imageResults = []; var cloudWord; -var cloudWordArray = []; +var cloudWordsArray = []; +var cloudGenusArray = []; + function getWikiResults() { var wikiURL = "https://en.wikipedia.org/w/api.php?" + $.param({ "action" : "query", "list" : "search", - "srsearch" : cloudWord, + "srsearch" : cloudWord + " cloud", "srwhat" : "text", "format" : "json", }); @@ -20,7 +22,7 @@ function getWikiResults() { dataType: "jsonp" }).done(function(result) { var resultArray = result.query.search; - console.log("wikipedia query result", resultArray); + console.log("wikipedia query results", resultArray); console.log("top wikipedia url: http://en.wikipedia.org/?curid=" + resultArray[0].pageid); }).fail(function(err) { throw err; @@ -29,12 +31,11 @@ function getWikiResults() { function getBestDescriptor() { - // TODO: split word into array so two words can both be searched - for (var i = 0; i < cloudWordArray.length; i++) { + for (var i = 0; i < cloudWordsArray.length; i++) { // if the cloud word in the array exists in the google vision results - if (imageResults.indexOf(cloudWordArray[i]) !== -1) { + if (imageResults.indexOf(cloudWordsArray[i]) !== -1) { // set the cloud word - cloudWord = cloudWordArray[i]; + cloudWord = cloudWordsArray[i]; console.log("chosen word: " + cloudWord); return; } @@ -44,6 +45,7 @@ function getBestDescriptor() { response.onload = function() { imageResults = []; + cloudWord = ""; var result = JSON.parse(response.responseText); if (result.responses[0].error) { // Check if there was a response @@ -53,19 +55,22 @@ response.onload = function() { else { var resultWebDetect = result.responses[0].webDetection.webEntities; var resultLabels = result.responses[0].labelAnnotations; - console.log("web detect results", resultWebDetect); - console.log("label detect results", resultLabels); + console.log("vision web detect results", resultWebDetect); + console.log("vision label detect results", resultLabels); for (var i = 0; i < resultWebDetect.length; i++) { - var cloudWord = resultWebDetect[i].description; - // TODO: remove the word "cloud" from the description - if (cloudWord) { - imageResults.push(cloudWord.toLowerCase()); + var resultWord = resultWebDetect[i].description; + if (resultWord) { + resultWord = resultWord.toLowerCase(); + resultWord.replace(" cloud", ""); + imageResults.push(resultWord); } } for (var i = 0; i < resultLabels.length; i++) { - var cloudWord = resultLabels[i].description; - if (cloudWord) { - imageResults.push(cloudWord.toLowerCase()); + var resultWord = resultLabels[i].description; + if (resultWord) { + resultWord = resultWord.toLowerCase(); + resultWord.replace(" cloud", ""); + imageResults.push(resultWord); } } console.log("image description results", imageResults); @@ -106,156 +111,222 @@ $("#submit").on("click", function(event) { }); - -cloudWordArray = [ - "noctilucent", - "polar stratospheric", - "cirriform", - "nacreous", - "non-nacreous", - "stratospheric nacreous", - "columnar", - "tropospheric", - "cumulonimbus", - "nimbostratus", - "high-level cirriform", - "stratocumuliform", - "stratiform", - "high clouds", - "genus cirrus", - "cirrus uncinus", - "cirrus spissatus", +cloudWordsArray = [ + "cumulus humilis radiatus", + "cumulus mediocris radiatus", + "cumulus congestus radiatus", + "cumulus fractus radiatus", + "stratus nebulosus opacus", + "stratus nebulosus translucidus", + "stratus nebulosus undulatus", + "stratus fractus opacus", + "stratus fractus translucidus", + "stratus fractus undulatus", + "stratocumulus stratiformis translucidus", + "stratocumulus stratiformis perlucidus", + "stratocumulus stratiformis opacus", + "stratocumulus stratiformis duplicatus", + "stratocumulus stratiformis undulatus", + "stratocumulus stratiformis radiatus", + "stratocumulus stratiformis lacunosus", + "stratocumulus lenticularis translucidus", + "stratocumulus lenticularis perlucidus", + "stratocumulus lenticularis opacus", + "stratocumulus lenticularis duplicatus", + "stratocumulus lenticularis undulatus", + "stratocumulus lenticularis radiatus", + "stratocumulus lenticularis lacunosus", + "stratocumulus castellanus translucidus", + "stratocumulus castellanus perlucidus", + "stratocumulus castellanus opacus", + "stratocumulus castellanus duplicatus", + "stratocumulus castellanus undulatus", + "stratocumulus castellanus radiatus", + "stratocumulus castellanus lacunosus", + "altocumulus stratiformus translucidus", + "altocumulus stratiformus perlucidus", + "altocumulus stratiformus opacus", + "altocumulus stratiformus duplicatus", + "altocumulus stratiformus undulatus", + "altocumulus stratiformus radiatus", + "altocumulus stratiformus lacunosus", + "altocumulus lenticularis translucidus", + "altocumulus lenticularis perlucidus", + "altocumulus lenticularis opacus", + "altocumulus lenticularis duplicatus", + "altocumulus lenticularis undulatus", + "altocumulus lenticularis radiatus", + "altocumulus lenticularis lacunosus", + "altocumulus castellanus translucidus", + "altocumulus castellanus perlucidus", + "altocumulus castellanus opacus", + "altocumulus castellanus duplicatus", + "altocumulus castellanus undulatus", + "altocumulus castellanus radiatus", + "altocumulus castellanus lacunosus", + "altocumulus floccus translucidus", + "altocumulus floccus perlucidus", + "altocumulus floccus opacus", + "altocumulus floccus duplicatus", + "altocumulus floccus undulatus", + "altocumulus floccus radiatus", + "altocumulus floccus lacunosus", + "cirrus fibratus intortus", "cirrus fibratus radiatus", - "cirriform clouds", - "cirrus", + "cirrus fibratus vertebratus", + "cirrus fibratus duplicatus", + "cirrus uncinus intortus", + "cirrus uncinus radiatus", + "cirrus uncinus vertebratus", + "cirrus uncinus duplicatus", + "cirrus spissatus intortus", + "cirrus spissatus radiatus", + "cirrus spissatus vertebratus", + "cirrus spissatus duplicatus", + "cirrus castellanus intortus", + "cirrus castellanus radiatus", + "cirrus castellanus vertebratus", + "cirrus castellanus duplicatus", + "cirrus floccus intortus", + "cirrus floccus radiatus", + "cirrus floccus vertebratus", + "cirrus floccus duplicatus", + "cirrocumulus stratiformis undulatus", + "cirrocumulus stratiformis lacunosus", + "cirrocumulus lenticularis undulatus", + "cirrocumulus lenticularis lacunosus", + "cirrocumulus castellanus undulatus", + "cirrocumulus castellanus lacunosus", + "cirrocumulus floccus undulatus", + "cirrocumulus floccus lacunosus", + "cirrostratus fibratus duplicatus", + "cirrostratus fibratus undulatus", + "cirrostratus nebulosus duplicatus", + "cirrostratus nebulosus undulatus", + "cumulus humilis", + "cumulus mediocris", + "cumulus congestus", + "cumulus fractus", + "cumulonimbus calvus", + "cumulonimbus capillatus", + "stratus nebulosus", + "stratus fractus", + "stratocumulus stratiformis", + "stratocumulus lenticularis", + "stratocumulus castellanus", + "altocumulus stratiformus", + "altocumulus lenticularis", + "altocumulus castellanus", + "altocumulus floccus", "cirrus fibratus", "cirrus uncinus", "cirrus spissatus", "cirrus castellanus", "cirrus floccus", - "cirrus fibratus intortus", - "cirrus fibratus vertebratus", - "pattern-based variety radiatus", - "fibratus", - "uncinus", - "cirrus fibratus radiatus", - "cirrus uncinus radiatus", - "pattern-based variety duplicatus", - "cirrus fibratus duplicatus", - "cirrus uncinus duplicatus", - "spissatus", - "castellanus", - "floccus", - "castellanus", - "genitus mother clouds", - "cirrus cirrocumulogenitus", - "cirrus altocumulogenitus", - "cirrus cumulonimbogenitus", - "cirrus homogenitus", - "aircraft contrails", - "mutatus mother cloud", - "cirrus cirrostratomutatus", - "genus cirrocumulus", - "cirrocumulus stratiformis", - "high-level stratocumuliform", - "cirrocumulus", - "stratocumuliform genus", - "high stratocumuliform species", + "cirrostratus fibratus", + "cirrostratus nebulosus", "cirrocumulus stratiformis", "cirrocumulus lenticularis", - "lenticular", "cirrocumulus castellanus", "cirrocumulus floccus", - "stratocumuliform", - "undulatus", - "cirrocumulus", - "stratiformis", - "lenticularis", - "cirrocumulus stratiformis undulatus", - "cirrocumulus lenticularis undulatus", - "lacunosus", - "castellanus", - "cumuliform floccus", - "stratocumuliform lacunosus", - "cirrocumulus stratiformis lacunosus", - "cirrocumulus castellanus lacunosus", - "cirrocumulus floccus lacunosus", - "virga", - "stratiformis", - "castellanus", - "floccus", - "genitus mother clouds", - "cirrocumulus homogenitus", - "mutatus mother clouds", - "cirrocumulus cirromutatus", - "cirrocumulus cirrostratomutatus", - "cirrocumulus altocumulomutatus", - "genus cirrostratus", - "cirrostratus nebulosus", "altostratus translucidus", - "cirrostratus", - "altostratus", - "nimbostratus", - "cirrostratus fibratus", - "cirrostratus fibratus duplicatus", - "cirrostratus fibratus undulatus", - "genitus mother clouds", + "altostratus perlucidus", + "altostratus opacus", + "altostratus duplicatus", + "altostratus undulatus", + "altostratus radiatus", "cirrostratus cirrocumulogenitus", "cirrostratus cumulonimbogenitus", "cirrostratus homogenitus", "cirrostratus cirromutatus", "cirrostratus cirrocumulomutatus", "cirrostratus altostratomutatus", - "genus altocumulus", - "altocumulus stratiformis", - "altocumulus lenticularis", + "cirrus cirrocumulogenitus", + "cirrus cirrostratomutatus", + "cirrus altocumulogenitus", + "cirrus cumulonimbogenitus", + "cirrus homogenitus", + "stratocumuliform", + "stratocumuliform lacunosus", + "cirrocumulus homogenitus", + "cirrocumulus cirromutatus", + "cirrocumulus cirrostratomutatus", + "cirrocumulus altocumulomutatus", + "cumuliform floccus", "altocumulus volutus", - "altocumulus castellanus", - "altocumulus floccus", - "calvus", - "capillatus", - "castellanus", - "congestus", - "fibratus", - "floccus", - "fractus", - "humilis", - "lenticularis", - "mediocris", - "nebulosus", - "spissatus", - "stratiformis", - "uncinus", - "duplicatus", - "intortus", - "lacunosus", - "opacus", - "perlucidus", - "radiatus", - "translucidus", - "undulatus", - "vertebratus", + "iridescence", + "circumhorizontal arc", + "mutatus mother", + "genitus mother", + "kelvin-helmholtz wave", + "kelvin–helmholtz instability", + "mackerel sky", + "fallstreak hole", + "cumulonimbus incus", + "anvil", + "mushroom", "arcus", "incus", "mamma", + "mammatus", "pannus", "pileus", "praecipitatio", "tuba", "velum", "virga", - "cirrus", - "cirrostratus", - "cirrocumulus", - "altocumulus", - "altostratus", - "stratocumulus", - "stratus", + "aircraft contrails", + "noctilucent", + "cirriform", + "columnar", + "tropospheric", + "stratiform", + "lenticular", + "asperitas", + "stratospheric nacreous", + "polar stratospheric", + "nacreous", + "non-nacreous", + "fibratus", + "nebulosus", + "stratiformis", + "lenticularis", + "castellanus", + "floccus", + "uncinus", + "spissatus", + "stratiformus", + "fractus", + "capillatus", + "calvus", + "humilis", + "mediocris", + "congestus", + "radiatus", + "opacus", + "translucidus", + "undulatus", + "perlucidus", + "duplicatus", + "lacunosus", + "intortus", + "vertebratus", "cumulus", "cumulonimbus", - "nimbostratus" + "stratus", + "stratocumulus", + "altocumulus", + "altostratus", + "nimbostratus", + "cirrus", + "cirrocumulus", + "cirrostratus" ]; + + + + From f71870a23fb870ab331e1d0e6be908922d23e9d5 Mon Sep 17 00:00:00 2001 From: asajbel Date: Fri, 27 Oct 2017 14:04:58 -0700 Subject: [PATCH 15/57] imgur.html formated --- imgur.html | 126 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 72 insertions(+), 54 deletions(-) diff --git a/imgur.html b/imgur.html index ee61b4d..2c7b526 100644 --- a/imgur.html +++ b/imgur.html @@ -4,7 +4,7 @@ IMGUR TEST -
Drag & Drop Files Here
-
- + -

Add Images

- -
- -
+
+ + +
+ +
+ + - - + From 143ceb68a8d7d0be599730373bb2a44570c877f1 Mon Sep 17 00:00:00 2001 From: asajbel Date: Sun, 29 Oct 2017 18:21:53 -0700 Subject: [PATCH 26/57] images now orient correctly and can be drag and dropped from another site --- assets/javascript/imgur.js | 280 ++++++++++++++++++++++++++++++------- 1 file changed, 226 insertions(+), 54 deletions(-) diff --git a/assets/javascript/imgur.js b/assets/javascript/imgur.js index 0991730..1edc26d 100644 --- a/assets/javascript/imgur.js +++ b/assets/javascript/imgur.js @@ -1,39 +1,149 @@ -//Called when filereader has processed image -//Requires an event from a FileReader onloadend event -//Sends Base64 data to Imgur -//Puts image in the DOM on an element with the Id displayImage -function gotImage(event) { - var reader = event.target; - // displayPic(reader.result); - var base64result = reader.result.replace(/^data:image\/[a-z]+;base64,/, ""); - if (base64result.length < 5333333) { - console.log("Image is less than 4MB") - queryVisionAPI(base64result); - } else { - console.log("Image is greater than 4MB, wait for Imgur") - var form = new FormData(); - form.append("image", base64result); - - var settings = { - "async": true, - "crossDomain": true, - "url": "https://api.imgur.com/3/image", - "method": "POST", - "headers": { - "authorization": `Client-ID ${apiKey.imgur_client_id}` - }, - "processData": false, - "contentType": false, - "mimeType": "multipart/form-data", - "data": form - } +// Sends image directly to vision api +// Don't use if image is over 4MB +// Also rotates the image if necessary for display +// image is a base64 image URL string +// orientation is a number between 1 and 8 that should be obtained +// with the getOrientation method. +function sendImageDirect(image, orientation = 1) { + var base64result = image.replace(/^data:image\/[a-z]+;base64,/, ""); + console.log("Image is less than 4MB") + queryVisionAPI(base64result); +} - $.ajax(settings).done(function(response) { - var res = JSON.parse(response); - queryVisionAPI(res.data.link); - console.log(res.data.link); - }); +// Sends the image to Imgur to be stored and then Vision. +// Use if image is greater than 4MB. +// Requires a base64Image string with the prepending tags striped out. +function sendImageImgur(image, orientation = 1) { + var base64result = image.replace(/^data:image\/[a-z]+;base64,/, ""); + console.log("Image is greater than 4MB, wait for Imgur"); + var form = new FormData(); + form.append("image", base64result); + + var settings = { + "async": true, + "crossDomain": true, + "url": "https://api.imgur.com/3/image", + "method": "POST", + "headers": { + "authorization": `Client-ID ${apiKey.imgur_client_id}` + }, + "processData": false, + "contentType": false, + "mimeType": "multipart/form-data", + "data": form } + + $.ajax(settings).done(function(response) { + var res = JSON.parse(response); + console.log(res); + queryVisionAPI(res.data.link); + // displayPic(res.data.link); + }); +} + +//from http://stackoverflow.com/a/32490603 +//Gets the orientation alteration of an image +// based on this picture https://i.stack.imgur.com/VGsAj.gif +//file is a file blob +//call back is the function to perform after completion +// with the paramater of the orientation variable +function getOrientation(file, callback) { + var reader = new FileReader(); + + reader.onload = function(event) { + var view = new DataView(event.target.result); + + if (view.getUint16(0, false) != 0xFFD8) return callback(-2); + + var length = view.byteLength, + offset = 2; + + while (offset < length) { + var marker = view.getUint16(offset, false); + offset += 2; + + if (marker == 0xFFE1) { + if (view.getUint32(offset += 2, false) != 0x45786966) { + return callback(-1); + } + var little = view.getUint16(offset += 6, false) == 0x4949; + offset += view.getUint32(offset + 4, little); + var tags = view.getUint16(offset, little); + offset += 2; + + for (var i = 0; i < tags; i++) + if (view.getUint16(offset + (i * 12), little) == 0x0112) + return callback(view.getUint16(offset + (i * 12) + 8, little)); + } else if ((marker & 0xFF00) != 0xFF00) break; + else offset += view.getUint16(offset, false); + } + return callback(-1); + }; + + reader.readAsArrayBuffer(file.slice(0, 64 * 1024)); +}; + +//from https://stackoverflow.com/a/40867559/8630411 +//Resets the orientation of an base64 image url string +// based on the orientation from getOrientaion +// or this image https://i.stack.imgur.com/VGsAj.gif +//srcBase64 is a base64 url string +//srcOrientation is a number between 2 and 8 +//callback is the function to perform after the orientaion has finished +function resetOrientation(srcBase64, srcOrientation, callback) { + console.log("Transforming image, please wait"); + var img = new Image(); + + img.onload = function() { + var width = img.width, + height = img.height, + canvas = document.createElement('canvas'), + ctx = canvas.getContext("2d"); + + // set proper canvas dimensions before transform & export + if (4 < srcOrientation && srcOrientation < 9) { + canvas.width = height; + canvas.height = width; + } else { + canvas.width = width; + canvas.height = height; + } + + // transform context before drawing image + switch (srcOrientation) { + case 2: + ctx.transform(-1, 0, 0, 1, width, 0); + break; + case 3: + ctx.transform(-1, 0, 0, -1, width, height); + break; + case 4: + ctx.transform(1, 0, 0, -1, 0, height); + break; + case 5: + ctx.transform(0, 1, 1, 0, 0, 0); + break; + case 6: + ctx.transform(0, 1, -1, 0, height, 0); + break; + case 7: + ctx.transform(0, -1, -1, 0, height, width); + break; + case 8: + ctx.transform(0, -1, 1, 0, 0, width); + break; + default: + break; + } + + // draw image + ctx.drawImage(img, 0, 0); + + // export base64 + callback(canvas.toDataURL()); + }; + + img.src = srcBase64; } //Displays picture on the page @@ -44,6 +154,16 @@ function displayPic(picture) { $("#drag").removeClass("uploadWanted"); } +function orientDisplayPic(picture, orientation) { + if (orientation > 1) { + resetOrientation(picture, orientation, function rotate(rotated) { + displayPic(rotated); + }); + } else { + displayPic(picture); + } +} + //Make sure that a file is an image and if so sends to the FileReader //file is a valid file blob function readPic(file) { @@ -64,9 +184,12 @@ function readPic(file) { function(canvas) { //here's the base64 data result var base64data = canvas.toDataURL('image/jpeg'); - //here's example to show it as on imae preview - var img_src = base64data.replace(/^data\:image\/\w+\;base64\,/, ''); displayPic(base64data); + if (file.size < 4000000) { + sendImageDirect(base64data); + } else { + sendImageImgur(base64data); + } }, { //should be set to canvas : true to activate auto fix orientation canvas: true, @@ -74,13 +197,46 @@ function readPic(file) { } ); }); - var reader = new FileReader(); - reader.onload = gotImage; - reader.readAsDataURL(file); - + // getOrientation(file, function checkRotate(orientation) { + // console.log(orientation); + // var reader = new FileReader(); + // getImageBase64(file, function(image) { + // if (file.size < 4000000) { + // orientDisplayPic(image, orientation); + // sendImageDirect(image, orientation); + // } else { + // orientDisplayPic(image, orientation); + // sendImageImgur(image, orientation); + // } + // }); + // }); } } + +//Takes a file blob and returns a base64dataURL +function getImageBase64(file, callback) { + var reader = new FileReader(); + reader.onload = function gotImage(event) { + var image = event.target.result; + callback(image) + }; + reader.readAsDataURL(file); +} + +//Checks if a string is a base65URL +//returns boolean +function isBase64image(base64string) { + var legal = base64string[base64string.length - 1] === "="; + console.log(legal); + var base64reg = new RegExp(/data:image\/([a-zA-Z]*);base64,([^\"]*)/); + var valid = base64reg.test(base64string); + console.log(valid); + var image = base64string.search(/data:image/) !== -1; + console.log(image); + return (legal && valid && image); +} + $(document).ready(function addUpload() { var imgur_client_id = "cffdbdcf9cb88c7"; @@ -94,34 +250,50 @@ $(document).ready(function addUpload() { refreshForm.append("client_secret", "4e806c50fb260cc521bfe11d4e7edfa22cfbf684"); refreshForm.append("grant_type", "refresh_token"); - $("#drag").on('dragover', function(e) { - e.stopPropagation(); - e.preventDefault(); + $("#drag").on('dragover', function(event) { + event.stopPropagation(); + event.preventDefault(); console.log('dragover'); $(this).css('border', '2px solid #66aede'); $(this).css('background-color', 'rgba(255,255,255,0.6)'); $(this).css('color', '#173848'); }); - $("#drag").on('dragleave', function(e) { - e.stopPropagation(); - e.preventDefault(); + $("#drag").on('dragleave', function(event) { + event.stopPropagation(); + event.preventDefault(); console.log('dragleave'); $(this).css('border', '2px dotted #66aede'); $(this).css('background-color', 'rgba(255,255,255,0.4)'); $(this).css('color', '#31708f'); }); - $("#drag").on('drop', function(e) { + $("#drag").on('drop', function(event) { + event.stopPropagation(); + event.preventDefault(); $(this).css('border', '2px dotted #66aede'); $(this).css('background-color', 'rgba(255,255,255,0.4)'); $(this).css('color', '#31708f'); - e.preventDefault(); - var files = e.originalEvent.dataTransfer.files; - - //We need to send dropped files to Server - console.log(files); - for (var i = 0; i < files.length; i++) { - readPic(files[i]); + var files = event.originalEvent.dataTransfer.files; + console.log(files.length === 0); + if (files.length !== 0) { + //We need to send dropped files to Server + console.log(files); + for (var i = 0; i < files.length; i++) { + readPic(files[i]); + } + } else { + var url = $(event.originalEvent.dataTransfer.getData('text/html')).filter('img').attr('src'); + console.log(url); + if (isURL(url)) { + console.log("Upload from another site"); + displayPic(url); + queryVisionAPI(url); + } + if (isBase64image(url)) { + console.log("Upload from another site"); + displayPic(url); + queryVisionAPI(url); + } } }); From 6a25ad2d4e1ef3d18781dec9cc837cf31139a87b Mon Sep 17 00:00:00 2001 From: asajbel Date: Sun, 29 Oct 2017 18:37:34 -0700 Subject: [PATCH 27/57] added capture tag to upload --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index e8e12b3..3f9c55c 100644 --- a/index.html +++ b/index.html @@ -19,7 +19,7 @@

CloudNV

- +