Commit Graph

11480 Commits (9005c0c1fdeb7ba4c9a4d45e47f09daea412dcfe)

Author SHA1 Message Date
Manraj Singh 9005c0c1fd UrlEscapeCodes: New Url Escape Codes Table Goodie (#4088)
* UrlEscapeCodes: Goodie initialzied

* UrlEscapeCodes: Front end created

* UrlEscapeCodes: Adds tests
2017-04-13 16:06:15 -04:00
Zaahir Moolla 3c784f2582 Calculator: Mobile CSS, Corrected Trig Functionality (#4087)
* Enable history panel on mobile

* Namespace CSS rules, remove trailing spaces

* namespace all css rules

* cleanup indentation

* remove pete's css hacks

* Namespace additional css rules

* left align calculator with search box

* Implement full width mobile UI

* remove unused css

* remove unused ids

* Beter handling of history col for small screens

* Switch back to using on methd

* Fix trig regex and evaluation, remove precision

* Ensure subtitle overflows on left, prevent history item overflow

* Prevent subtitle text from being clipped

* Remove evalmath obj

* Updated conditional

* Add support for numpad period

* Fixed on start clear.

* Add postfix detection. Fixed infinity ledger.

* Removed Factorial BigNum hacks.

* Removed unnessesary code introduced.

* Fixed shift / clear issue.

* Remove undefined key strokes.

* Fix pi in exponents.

* Make return consistent.

* Fix broken history

* Apply user-select rules to desktop and mobile

* cleanup trailing spaces, commented out css

* Fix backspacing issue with operands.

* Remove console logs
2017-04-13 13:06:53 -04:00
Zaahir Moolla 5f7defa0df Update PULL_REQUEST_TEMPLATE.md 2017-04-13 13:06:13 -04:00
PJ Hampton 0abd6a6554 Calculator: [Phase 2] Add Scientific calculator (#4067)
* Phase 1: Add basic calculator

* Updated tests.

* change template name, use base template, prefill calc with answer

* fix test

* Added backlog features.

* Updated js.

* Light refactoring work

* Refactored keycodes.

* Updated C button.

* Rewrote (+/-)% Expressions

* Updated the spacing dertermination

* Added expression to UI by default.

* Update tests.

* Updated formatting.

* Rewrite percent queries.

* Pushing updated codebase.

* Add calculator as trigger word

* Update tests for new triggers

* Stop initializing expression if 0

* add precision support to math eval object.

* Removed scientific buttons / history for Phase 1

* Updated math type.

* Prevents duplicate OPERADNS

* Add duplicate functionality.

* Updated unicode.

* Removed es6 feature.

* Stop first entry being an operand.

* Add operator flipping.

* Added Precision support.

* Handle numpad operator keys

* Set and maintain focus, Improved event handling

* Bind click handler in loop, stopPropgation of keydown

* Cleanup trailing spaces

* Fixed broken assignment.

* Prevent multiple commas.

* Fixed calculator stalling when trying to enter a new operator

* Initial refactor.

* Refactored out expression array.

* Refactored out display var.

* reintroduced matheval object for precision.

* Cleaned up formatting.

* Removed commify.

* Initial PR for Phase 2

* Add support for brackets.

* Added support for Pi

* Add support for sin, tan, cos

* Added factorial support

* Add support for squared / cubed functions

* Add support for natural log

* Support log_10 function.

* Add support for square roots.

* Add eulers number.

* Implement Engineers Exponent / Formatted Funcs.

* Add sci-tab id to handlebars.

* Removed positioning for mobile display.

* Custom exponents 🚀

* Implemented Euler exponent

* Support 1/x button.

* Interactified deg/rad toggle.

* Add support for degrees / radians

* Fix radians bug.

* Zaahirs / Mintsofts syntactic changes.

* Fixed regex for exponents

* Removed blue from toggle.

* Allow backspacing through functions.

* Allow backspacing through exponents.

* Fix +99% bug.

* Allow flipping of keypads.

* Stop ! being entered first.

* Stop EE being entered at start or multiple.

* Allow step back through EE

* Disallow multiple periods. [skip ci]

* Rewrote query to handle natural language.

* Addressed phase 1 feedback.

* Fixed backspace bug.

* Allow backspacing through constants.

* Add auto paren support for funcs.

* Started the commenting 💥

* Add some comments.

* Updated PercentNormalizer comment.

* Fix 0/0 Error.

* Add 'c' key support

* Fix back spacing.

* Positioned deg / rad toggle.

* Refactoring code. Stage 1.

* Added high signal.

* Add funcs for Initite/NaN

* Moved eval info into separate function.

* Abstracted clear function.

* Add paren manager.

* Refactored out paren state.

* Refactored out parenState global

* Removed meta.

* Backspace through functions.

* Set signal to high.

* Fixed signal

* Pushing updated code.

* Refactored backspacing.

* Fix up messy code / document.

* Fixed + percent bug.

* Support EE on mobile.

* opens pseudo paren for 1/(x)

* Fix large factorial issue.

* Allow pi | e as exponent.

* use exponents on π and e.

* Removed +-3 issue.

* Natural log and log now work as exponents

* nit: cleaned up expression.

* Fixed percent error.

* Add phase 3 ledger span (hidden)

* Disabled add digits.

* Check in UX fixes.

* Some light refactoring.

* Swap functions.

* Fixed shoddy regex.

* Add ledger object for phase 3.

* Updated percentage / trig regex

* Add blank expression if error.

* Allow factorial on decimals.

* Update code + comments.

* Add in calc trigger word. Fixed Backspace.

* All backspacing fixed.

* Try to recover from open/unfinished exponent

* Add high signal for

* Update comments.

* Updated comments.

* improve calculator regex

* Strip trailing spaces`

* Updated signal code.

* Fixed backspacing issue.

* swap id for class (ParenManger)

* Remove console logs.

* Update comment.

* Fix bug in regex replacement.

* Calculator: [Phase 3] Add History / Calc reloading (#4081)

* Set up UI.

* Phase 3 implemented.

* Remove array. Replace with handlebars.

* strip commas by default.

* Fixed html interpolation

* Add g flag to replacement regex

* Strip trailing spaces

* remove unneeded option from perl

* Added comments to backspace.

* Removed ledger properties. Updated using state.

* Addressed Zaahir's p2 feedback
2017-04-12 15:31:12 -04:00
Nalin Bhardwaj d5f7d14c6e Music Chords: Fixes dark mode SVGs (#4083) 2017-04-12 11:21:45 +01:00
Daniel Davis 3973c837b3 DuckDuckGo Responses: Removed XMPP entry (#4084) 2017-04-12 11:05:00 +01:00
Robert Badea a67bc00ef7 HTML Entities: New HTML Entities Goodie (#4056)
* added html entities goodie

* fixed trigger

* added tests

* fixed review issues

fixed CSS classes, fixed file names, switched from JSON to YML

* fixed tests and file loading

* renamed to camel case

* deleted AsciiTable.pm

* changed to camel case

* Remove extra newlines

* Fix indentation for Beta server

* Use chompContent

* Simplify CSS

* Remove scrolling div

* Fix test

* Switch overflow control to .c-base__content div
2017-04-11 17:41:17 -04:00
Manraj Singh d1e5d9c6f5 ASCII Code: New ASCII Codes Table Goodie (#4042)
* Add: Initialized ASCII Table Goodie

* Update: Fixed content options

* Update: Title added to td tags

* Update: CSS for tables

* Fix: Makes titles more verbose in template

* Update: Tests for Ascii Table added

* AsciiTable: Fix variable name to be more generic

* AsciiTable: Improved testing of IA

* AsciiTable: Chomp the table

* AsciiTable: Add meta source

* AsciiTable: Rename table_rows -> table

* AsciiTable: Use already existing CSS

* AsciiTable: Data now contains Headers

* AsciiTable: Makes template more generic

* AsciiTable: Updated tests for checking table headers

* AsciiTable: Fix required table styling

* AsciiTable: Fix tests

* Use CSS to set chomp height

* Remove table scroll div

* Switch to List template

* Update AsciiTable.t
2017-04-11 15:30:14 -04:00
Rob Emery 264282b374 DateRole: Handling 'of' in textual date formats (#3982)
* DateRole: Adding failing test for `$nth of $month $year`

* DateRole: Now parses "7th of march 2017"

* DateRole: Adding failing test for '5 of jan 1993' (no suffix and short month)

* DateRole: Handles 5 of march

* DateRole: Now also handle "march the 30th, 2017"
2017-04-10 23:02:06 -04:00
lernae 011c78e854 Dice: Fixes #3989 Set upper limit on max dice rolls and number of sides per dice (#4078)
* Dice: Fixes #3989 Set upper limit on max dice rolls and number of sides per dice

* Minor correction on naming of constant: MAX_NUM_OF_DICE
2017-04-10 12:08:59 -04:00
Rob Emery 394cf054f3 Conversions: kB and kb (and so on) restored! (#4077)
* Conversions: Unphysical units like millibits (mb) and millibytes(mB) should be assumed as mega instead

* Conversions: Now has multiple symbols (case sensitive matches) meaning that Kb and kb both mean kilobits and KB and kB both mean kilobytes :D
2017-04-10 12:01:50 -04:00
Zaahir Moolla 44278eb98c Add dash to regex accepted characters (#4070) 2017-04-10 10:56:01 -04:00
Zaahir Moolla 71f31f7767 Revert "Remove failing test for Repo release"
This reverts commit f5c4f686f5.
2017-04-07 20:45:28 -04:00
TheSpeedyBlur f3b315dbe2 Timer: Fixing trigger (#4064)
* Added variable for non-stribbable triggers.

* Added unstripped triggers to the trigger list

* Added tests to Timer in correspondence of the new triggers

* Removed unnecessary test, added trigger words of hrs and secs and their counterparts.

* Typo fix
2017-04-07 16:28:58 -04:00
Zaahir Moolla f5c4f686f5 Remove failing test for Repo release
/cc @mintsoft -- please fix
2017-04-06 16:58:53 -04:00
Zaahir Moolla 5ac215611b remove bad test 2017-04-06 16:51:31 -04:00
PJ Hampton dc12d569c6 Calculator: [Phase 1] Add basic calculator (#4051)
* Phase 1: Add basic calculator

* Updated tests.

* change template name, use base template, prefill calc with answer

* fix test

* Added backlog features.

* Updated js.

* Light refactoring work

* Refactored keycodes.

* Updated C button.

* Rewrote (+/-)% Expressions

* Updated the spacing dertermination

* Added expression to UI by default.

* Update tests.

* Updated formatting.

* Rewrite percent queries.

* Pushing updated codebase.

* Add calculator as trigger word

* Update tests for new triggers

* Stop initializing expression if 0

* add precision support to math eval object.

* Removed scientific buttons / history for Phase 1

* Updated math type.

* Prevents duplicate OPERADNS

* Add duplicate functionality.

* Updated unicode.

* Removed es6 feature.

* Stop first entry being an operand.

* Add operator flipping.

* Added Precision support.

* Handle numpad operator keys

* Set and maintain focus, Improved event handling

* Bind click handler in loop, stopPropgation of keydown

* Cleanup trailing spaces

* Fixed broken assignment.

* Prevent multiple commas.

* Fixed calculator stalling when trying to enter a new operator

* Initial refactor.

* Refactored out expression array.

* Refactored out display var.

* reintroduced matheval object for precision.

* Cleaned up formatting.

* Removed commify.

* Removed positioning for mobile display.

* Don't set focus on Calc automatically when displayed

* Add touchstart support.

* Prevent zooming.

* ensure button text is not selectable

* Add right borders to calc, ensure same border colour

* Cleanup code style

* Only apply hover state css to desktop
2017-04-06 16:40:56 -04:00
Sophie Durrant f02048c71f Chars: Reduce overtriggering (#4033)
* FIX FOR ISSUE #4028

-> Set triggers to only apply to start of search string so the IA isn't triggered for
    programming-related searches

-> Removed triggers 'characters count', 'length of string' and 'chars'
    as they are unintuitive and can clash with programming requests

-> Added 'of' as a leading word to be removed so queries such as 'length in chars of foo'
    count only the characters in 'foo'

-> Updated test script to reflect these changes

* Fix #4028 - reduce overtriggering of 'Chars' goodie

-> Set triggers to only apply to start of search string so the IA isn't triggered for
    programming-related searches

-> Removed triggers 'characters count', 'length of string' and 'chars'
    as they are unintuitive and can clash with programming requests

-> Added 'of' as a leading word to be removed so queries such as 'length in chars of foo'
    count only the characters in 'foo'

-> Updated test script to reflect these changes
2017-04-05 22:49:26 -04:00
Andrey Pissantchev 5ff250cab1 Remove use of several vars on global scope (#3363)
* remove use of is_mobile and is_mobile_device globals

* fix undeclared bbox variable
2017-04-05 18:40:24 -04:00
Rob Emery b6e1bd858e Conversions: Case sensitive Units/Symbol handling (#4021)
* NumbersRole: Despite the role being case insensitive, the number_style_regex isn't! Adding failing test

* NumbersRole: Fixing indentation

* Conversions: Adding tests around implicit case insensitivity in current implementation

* Conversions: Moved all case insensitive behaviour into the handle query so it's explicit rather than relying on query_lc to do the work for us

* Conversions: Adding symbol definitions for case sensitive handling

* Conversions: Fixing markup

* Conversions: UTF8 with BOM on ratios and adding symbol as a trigger

* Conversions: Symbol is now used (case sensitive) to match for factors

* Conversions: The test 'BTU to KwH' should fail (this isn't a unit), however it was causing a division by zero as get_matches wasn't finding a match and this condition wasn't handled correctly

* Conversions: Typo! KwH shouldn't trigger

* Conversions: Tests involving symbols now need to be correct according to SI

* Conversions: Tests around "oz" that should be interpreted as fl oz if the answer should unambiguously be a volume

* Conversions: Will handle ambiguity around oz for more units

* Conversions: Uncommenting tests around digital storage units and fixing them so they're actually correct
2017-04-05 18:39:19 -04:00
Zaahir Moolla 691062a3b0 Remove Parcelforce Goodie. Migrate to Spice (#4071) 2017-04-04 21:07:55 +01:00
Zaahir Moolla 3d6a370f3a Remove USPS from repo (#4055) 2017-04-04 16:25:32 +01:00
Zaahir Moolla d681ab0ed4 Remove Fedex from Repo (#4053) 2017-04-04 15:35:03 +01:00
Zaahir Moolla 7ca75b5f4d Remove UPS from repo (#4054) 2017-04-04 15:34:27 +01:00
Ed Callaghan dc159e5fd7 PercentOf: Include terminating equal sign in trigger (#4062)
* allow terminating equal-sign + tests

* fixed new mult test

* typo in test result
2017-04-03 11:20:14 -04:00
Philip Kirkbride fde4c824d3 Short versions for save to be consistent with -g (#4044) 2017-04-02 16:26:41 +02:00
Kenny Ballou 136b2b7ed5 AWM Cheat Sheet: Update source url (#4037)
The current URL "works", but it's a redirect. It should use the new URL
in case the redirect is later removed.

This fixes #4036.
2017-04-02 16:23:59 +02:00
Omar Emad 738d80bf49 EnglishPremierLeagueCheatSheet: Update the participated teams. (#4007)
* Updated English Premier League Cheat Sheet.

Removed the relegated teams after the 2016 season and added the promoted teams from Championship

* Update epl.json

* Update epl.json
2017-04-02 16:21:45 +02:00
Daniel Davis f2d4466d3b Quack & Hack cheatsheet: Updated links to HTTPS (#4049) 2017-03-27 12:50:27 +01:00
Daniel Davis 152d24ee08 Quack & Hack cheatsheet: Updated meetup.com URL (#4048) 2017-03-27 12:27:08 +01:00
Philip Kirkbride 7e44558ec6 Linux Cheat Sheet: Make use of capitalization & period consistent (#4047)
Linux Cheat Sheet: Make use of capitalisation & period consistent
2017-03-26 18:33:39 +01:00
Philip Kirkbride a7ec0144c1 Add installation command for arch linux (#4043) 2017-03-26 04:41:17 +05:30
Zaahir Moolla bc584ea6f5 switch back to handling data obj as array (#4034) 2017-03-24 09:39:51 -04:00
Zaahir Moolla c94e096e9c remove console.log 2017-03-23 16:18:13 -04:00
Zaahir Moolla b274ff293d Add goodieVersion to test (#4032) 2017-03-23 15:12:32 -04:00
Zaahir Moolla b0006f1d5b Goodie: Pass GoodieBundle version from Perl to JS to fix audio asset loading (#4031)
* Pass Goodie Bundle version from Perl to JS for asset loading

* correct usage of ops.data
2017-03-23 14:51:34 -04:00
Zaahir Moolla 93f6ad141b rename timer_goodie to timer (#4030) 2017-03-23 14:32:56 -04:00
Ben Moon de98ce988b Port Timer to Goodies (#2253)
* Add Timer files

* Rename Spice -> Goodie

* Move structured answer into Perl

* Update display

Now working.

I removed the 'isMobile' flag, as 'DDG.device.isMobile' was causing it
to crash, and the mobile display wasn't pretty anyway ("Add Timer" was
wrapping). Instead it will use '+' for both.

* Move time parsing into Perl

This way we can check that parsed values are correct in the tests
easily; it also gives us something sensible to return (the start time in
seconds).

* Fix issue with queries like '5s'

* Fix alarm not being located correctly

It was pointing at 'share/spice'.

* Re-enable mobile text

Fixed the issue with mobile display.

* Integrate changes from Spice #3134

Adds the changes from duckduckgo/zeroclickinfo-spice#3134.

* Integrate changes from Spice #2656

Adds the changes from duckduckgo/zeroclickinfo-spice#2656

* Update ID to 'timer_goodie'

* Ensure time from query is used as default
2017-03-23 12:51:39 -04:00
Zac Pappis 31400c651a added "replace table" to shruggie (#3460) 2017-03-23 13:31:23 +00:00
Shashwat Aggarwal 7f0fec2932 Update providers.yml (#4019)
Fixes #4016: Added public DNS Server's from Freenom World.
2017-03-18 22:57:32 +00:00
Nalin Bhardwaj 7afb399158 Fixes size of unicode dices (#4013) 2017-03-18 00:01:41 +00:00
suvadeet ed9387cf8d Added document writing commands (#3996)
* Added document writing commands

* Updated file per request

* Added additional updates
2017-03-18 03:38:58 +05:30
Shady Tantawy 4676ce1196 SolarSystem: Fixed typo error in the abstract (#4015) 2017-03-17 10:28:52 +00:00
Karan Sharma ae5570a241 Cheatsheet: Create ggplot2 cheatsheet (#3759) 2017-03-16 22:01:02 -04:00
Rob Emery 3ae96df2f8 NumbersRole: Isn't correctly case-insensitive currently (#4000)
* NumbersRole: No tests covering exponentials

* NumbersRole: Improving test coverage

* NumbersRole: Despite the role being case insensitive, the number_style_regex isn't! Adding failing test

* NumbersRole: number_style_regex now case insensitive

* NumbersRole: Fixing indentation
2017-03-16 13:32:24 -04:00
KAUTH f63b7ad574 New MIPS Cheat Sheet (#3975)
* First Draft

* Update mips.json
2017-03-15 23:03:14 -04:00
Milton Mazzarri 9c3b80e1fe Update IEx cheat sheet to Elixir 1.4.2 (#4012) 2017-03-15 19:16:17 +00:00
Gautam krishna.R 6e3d8adef4 Update words.txt (#3530) 2017-03-14 16:08:55 -04:00
PJ Hampton 22fe7033a8 REPO: Removed Prog Mission info from README. (#3997)
* Removed Prog Mission info from README.

* Fixed issues link

* Updated issues link.

* Remove another Programming Mission mention
2017-03-14 15:20:06 -04:00
adv16 6741796f7c Fixed wrong triggering for base conversion IA (#4010) 2017-03-13 10:46:20 -04:00