Skip to content
This repository has been archived by the owner on Jan 5, 2019. It is now read-only.

Commit

Permalink
Merge pull request #8 from Wavum/version_2.2
Browse files Browse the repository at this point in the history
Version 2.2
  • Loading branch information
Wavum authored Mar 14, 2017
2 parents 6d7e299 + 9857a10 commit 2a2e74e
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 15 deletions.
22 changes: 15 additions & 7 deletions js/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/index.js.map

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions ts/Config/ConfigValue/ConfigValue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@

public isSavedValue(): boolean
{
if (!navigator.cookieEnabled)
return false;

return localStorage.getItem(this.name) !== null;
}

Expand Down
4 changes: 1 addition & 3 deletions ts/Data/GoogleData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@

let s: HTMLScriptElement = document.createElement("script");

s.src = "https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20json%20where%20url%3D%22http%3A%2F%2Fsuggestqueries.google.com%2Fcomplete%2Fsearch%3Fclient%3Dfirefox%26q%3D" +
encodeURIComponent(encodeURIComponent(value)) +
"%22%20&format=json&callback=GoogleData.getSearchSuggestions." + id;
s.src = "http://suggestqueries.google.com/complete/search?client=chrome&q=" + encodeURIComponent(value) + "&callback=GoogleData.getSearchSuggestions." + id;
s.id = "searchSuggestionsQuery" + id;

document.getElementsByTagName("*")[1].appendChild(s);
Expand Down
14 changes: 14 additions & 0 deletions ts/Menubar/Menubar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,13 @@

private saveClicked(target: Object): void
{
if (!navigator.cookieEnabled)
{
InformationBox.showText("You need to enable cookies!", 2000);

return;
}

let inputChildren: Array<IInputForm> = this.sidebar.InputChildren;

for (let i: number = 0; i < inputChildren.length; i++)
Expand Down Expand Up @@ -132,6 +139,13 @@

private resetClicked(target: Object): void
{
if (!navigator.cookieEnabled)
{
InformationBox.showText("You need to enable cookies!", 2000);

return;
}

Config.reset();

InformationBox.showText("Reseted!", 1000);
Expand Down
8 changes: 4 additions & 4 deletions ts/Search/SearchSuggestions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
{
this.currentSearchSuggestionsData = data;

this.createSearchSuggestions(data.query.results.json.json[1]);
this.createSearchSuggestions(data[1]);
}
}.bind(this));
}
Expand Down Expand Up @@ -230,12 +230,12 @@
}
}

private createSearchSuggestions(json: any): void
private createSearchSuggestions(data: any): void
{
//Check for no result
if (json !== null)
if (data !== null)
{
let results: any = json.json;
let results: any = data;
let maxResults: number = Config.NumberOfSearchSuggestions.Value;

this.searchSuggestionsDiv.innerHTML = "";
Expand Down

0 comments on commit 2a2e74e

Please sign in to comment.