Skip to content

Commit

Permalink
Merge pull request forcedotcom#3 from forcedotcom/RemovedDebugging
Browse files Browse the repository at this point in the history
Removed unneeded debug statements
  • Loading branch information
wadewegner authored Mar 8, 2018
2 parents 22a063f + 3fd74b7 commit 77df945
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 42 deletions.
31 changes: 1 addition & 30 deletions force-app/main/default/aura/SearchGIPHY/SearchGIPHYController.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,14 @@

doInit: function (component, event, helper) {
console.log('doInit called successfully');


},

keyCheck: function (component, event, helper) {

if (event.which == 13) {
console.log('keyCheck detected enter')

var searchTerms = component.get("v.searchTerms");
helper.search(searchTerms, function (results) {
console.log('keyCheck enter returned from helper')
_GIPHY.setResults(results);
component.set("v.results", results.data);
});
Expand All @@ -26,11 +23,8 @@

search: function (component, event, helper) {

console.log('search called successfully');

var searchTerms = component.get("v.searchTerms");
helper.search(searchTerms, function (results) {
console.log('search returned from helper')
_GIPHY.setResults(results);
component.set("v.results", results.data);
});
Expand All @@ -43,27 +37,12 @@

component.set("v.showModal", true);


console.log('gifSelected called successfully');

var id = event.target.dataset.index;
console.log(id);

var results = _GIPHY.getResults();

console.log("results");
console.log(results);


var selectedGif = results.data.find(item => item.id === id)
console.log(selectedGif);

var width = selectedGif.images.original.width;
var height = selectedGif.images.original.height;

console.log("width: " + width);
console.log("height: " + height);

component.set("v.selectedGifWidth", width);
component.set("v.selectedGifHeight", height);
component.set("v.selectedGif", "https://media0.giphy.com/media/" + id + "/giphy.gif");
Expand All @@ -78,9 +57,6 @@

var chatterText = component.get("v.chatterText");
var imageUrl = component.get("v.selectedGif");

console.log('chatterText: ' + chatterText);

var action = component.get("c.getChatterGroups");

action.setParams({
Expand All @@ -90,14 +66,9 @@

$A.enqueueAction(action);

console.log('about to set callback');

action.setCallback(this, function (response) {
console.log('i am back');

var feedItemId = response.getReturnValue();
console.log('feedItemId');
console.log(feedItemId);

var urlEvent = $A.get("e.force:navigateToURL");
urlEvent.setParams({
Expand Down
8 changes: 0 additions & 8 deletions force-app/main/default/aura/SearchGIPHY/SearchGIPHYHelper.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
({
search: function (searchTerms, data) {

console.log('search called successfully');
console.log(searchTerms);

var apiKey = _GIPHY.getApiKey();
console.log(apiKey);

$.getJSON("https://api.giphy.com/v1/gifs/search?api_key=" + apiKey + "&q=" + searchTerms + "&limit=8&offset=0&rating=G&lang=en", function (results) {

console.log('called api');
console.log(results);
console.log(results.data.length);

data(results);

});
Expand Down
5 changes: 1 addition & 4 deletions force-app/main/default/classes/ChatterHelper.cls
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ public with sharing class ChatterHelper {
@AuraEnabled
public static String getChatterGroups(String imageUrl, String chatterText) {

System.debug('getChatterGroups');

// String imageUrl = 'https://media0.giphy.com/media/xTiTncVep2khPGhK1i/giphy.gif';
String fileName = 'me.gif';
String fileName = 'giphy.gif';
String body = chatterText;

Blob imageData = getImageData(imageUrl);
Expand Down

0 comments on commit 77df945

Please sign in to comment.