Commit Graph

4672 Commits (master)

Author SHA1 Message Date
PJ Hampton fa0f698e02 Renamed ratios file. 2017-04-28 20:31:01 +00:00
PJ Hampton 6f891b1a14 Checking in code (not fin.) 2017-04-28 20:15:39 +00:00
PJ Hampton df37ad191e Checking in work. 2017-04-28 17:49:43 +00:00
PJ Hampton 61b14b1235 Updated display. 2017-04-28 15:04:34 +00:00
PJ Hampton dfd7d399ed Merged master. Fix conflict. 2017-04-27 17:20:10 +00:00
PJ Hampton 4651520f3e Added nat lang triggers. 2017-04-27 17:14:43 +00:00
Shivam Shukla 91e0b1d7f9 Timer IA: triggering on edge cases fixed. (#4089) (#4134)
* Time IA triggering on edge cases fixed. (#4089)

* Updated regex and added more test cases
2017-04-27 12:18:40 -04:00
Manraj Singh 266be90510 Color Picker: Improves triggering (#4137)
* ColorPicker: Improve triggering

* ColorPicker: Add tests for new triggers

* ColorPicker: Move triggers to separate file

* ColorPicker: Add more combinations of triggers as test
2017-04-27 12:12:32 -04:00
Aditya Tandon c42daedc1e Conversions: Makes conversion queries more flexible (#4129)
* makes conversion queries more flexible

* adding removed test back and made some changes in regex
2017-04-27 11:51:04 -04:00
Zaahir Moolla f1142a6b21 tighten calculator regex, update tests (#4128) 2017-04-25 10:43:32 +01:00
Zaahir Moolla abb63d9cd4 Ensure filenames don't contain spaces (#4125) 2017-04-24 16:11:35 -04:00
Brian Singer c5816891e4 Geometry Spice converted to Goodie: Broken hover and missing calculation feature (#3181)
* Geometry Broken Hover and missing calc

* Linked hover effect for dot and SVG

* updated css

* started test file

* consolidated objectInfo YML and finished testing

* removed dumeprs

* fixed triggering and added more triggering test cases
2017-04-24 15:41:31 -04:00
Manraj Singh 67f6e084f2 AsciiTable: Improves triggering (#4124)
* AsciiTable: Triggering now for 'list of'

* AsciiTable: Add more triggers

* AsciiTable: Tests updated with new triggers
2017-04-24 15:35:38 -04:00
Zaahir Moolla f70ed1e6fc Merge branch 'master' into pjhampton/PercentOf_remove
* master:
  Calculator: Fix copy issue, remove -Infinity (#4095)
  Added PercentOf logic to calculator. (#4122)
  Conversions: Improve triggering (#4118)
  Countdown: Continue PR #3485 (#3936)
2017-04-24 15:33:26 -04:00
PJ Hampton 3ea2787742 Added PercentOf logic to calculator. (#4122) 2017-04-24 12:59:03 -04:00
PJ Hampton 07bf054914 Remove PercentOf files. 2017-04-24 16:06:42 +00:00
Aditya Tandon 40d7231443 Conversions: Improve triggering (#4118)
* Fixes #4112 conversions triggering

* test added 1

* adds alias for fahrenheit
2017-04-24 17:02:25 +01:00
Rasika Pohankar 7ebdcdfbd2 Countdown: Continue PR #3485 (#3936)
* Implement changed design, fix #3500

* Remove comment

* Update test file to use ISO8601 dates and avoid testing of Role

* Include subtitle in the template

* Take current time using momentjs, calculate difference in JS

* Remove subtitle from the template, make corrections to endCountdown

* Pass date string to JS and find difference in moment objects, change toggling at countdown end

* Remove use of difference passed from the backend

* Update test file
2017-04-24 09:40:05 -04:00
lernae cc1753acab Fixes #4102 Calendar: Shouldn't trigger on query for calendar.google.com (#4114) 2017-04-21 18:29:13 -04:00
Aditya Tandon 1047f8a9e6 ASCII Table: Add additional trigger words (#4111)
* Fixes #4107 Added triggers

* updating test

* moving triggers to a separate file
2017-04-21 18:15:49 -04:00
PJ Hampton 2e6590e29f Calculator: [Phase 4] Deprecate Perl Backend (#4110)
* Begin deprecating perl backend.

* Deprecate backend [skip ci]

* Routine checkin of code.

* Added docs + preprocessing.

* Deprecate perl eval backend.

* Checking in some code.'

* Handle bad search expressions by defaulting to 0

* Add ability to recover with grace from bad expressions from search bar.

* Removed unnessesary perl code.

* Add support for factorials with !

* cleanup trailing spaces

* Removed trig constants.

* Support tau in expression.

* Removed ln preprocess.

* Support leading =. Removed moot code.

* Add support for euro and pound.

* Removed nat lang query parsing from js.

* strip duplicate operators

* Fixed legacy spacing issue in tests.

* Remove empty exponent.

* Bail on hex looking entries.

* better handling of repeated operators

* Remove max import

* revert back to old check for 3+ operators

* relax phone number regex for now

* remove silly test
2017-04-21 13:12:41 -04:00
Emily Tackett b9e7ad1888 Unicode: Make '+' character in unicode codepoint query optional. (#4101)
* Made + in unicode codepoint queries optional

* Added test for optional + in codepoint query
2017-04-19 22:53:25 -04:00
Nalin Bhardwaj f280d574f4 Sunrise: Handles "at date" queries (#4082)
* quickfix adding at queries

* Added tests
2017-04-14 09:05:18 -04:00
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
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
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
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
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
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
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
Shady Tantawy 4676ce1196 SolarSystem: Fixed typo error in the abstract (#4015) 2017-03-17 10:28:52 +00: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
adv16 6741796f7c Fixed wrong triggering for base conversion IA (#4010) 2017-03-13 10:46:20 -04:00
Rob Emery 95c8c84dac Conversions: Improving result aesthetics (#3988)
* Conversions: User feedback has indicated a preference for 3 sig figs for small(ish) results: #3984

* Conversions: Introducing the ability to have significant figures rather than decimal places for numbers <1

* Conversions: The reality is users want to see decimal places for 'normal numbers' (1,765.432 for example) but sig figs for something around 1 so that fractions can be expressed (0.0625 for example)

* Conversions: Bringing tests inline with 3 SF for results < 1; this is more aesthetically pleasing in my opinion
2017-03-08 15:30:22 -05:00
Jag Talon 997a4331b3 TimezoneConverter: Remove moreAt so that there's no extra space at the bottom of the IA (#3525)
* Remove moreAt so that there's no extra space at the bottom of the IA

* Update tests
2017-03-07 21:59:31 +00:00
Rob Emery 63e02972da ParcelForce: Should not trigger for non-UK parcels (#3907)
* ParcelForce: Should not trigger for non-UK parcels

* ParcelForce: Starting with KB clashes with Microsoft KB Articles; AFAIK this isn't a valid parcelforce tracking number anyway

* ParcelForce: Working around #3986
2017-03-07 21:21:34 +00:00
Rob Emery 308e0675f9 Conversions: Increase significant figures in Scientific Notation (#3917)
* Conversions: The precision (i.e. number of digits after a .) and the significant digits displayed in scientific notation were the same value; there are a few issues with people requesting more accuracy in scientific notation, and none for accuracy

* Conversions: Increasing accuracy of values in tests in-line with new significant figures output

* Conversions: Adding lightyear and lightyears as accepted variants of "light year"
2017-03-07 20:19:36 +00:00
Rob Emery 0cffa6161e POTUS: Triggering is way too keen (#3938)
* POTUS: Adding failing test for overtrigger

* POTUS: the previous || $prez_count meant that it defaulted to the current president if it didn't recognise the number; hence why it was showing so many false positives

* POTUS: Now with stricter handling on the $num we can trust the validation later on to keep us safe from overtriggering

* POTUS: basic queries that really should work!

* POTUS: Switching to using a guard regex to match things rather than using replacements

* POTUS: Guard regex now protects the query space. and "was" is used to imply the previous president (currently obama)

* POTUS: switched to query_lc and implementing both a guard regex and a replacement for the triggers so that the code below behaves as if it is remainder =>, except that this doesn't erroneously replace "president-elect of the us" with ""

* POTUS: We don't need $rem
2017-03-06 23:39:09 -05:00
Shady Tantawy 01b6ecdf05 Escaped dot 2017-03-06 22:10:45 +02:00
Shady Tantawy 9958387136 Update MD5.pm 2017-03-04 15:07:04 +02:00
GPhantom 08efec9e1a Fix #3974
Ignore file extensions.
2017-03-04 14:51:44 +02:00
Zaahir Moolla 5f7329fc67 Calculator: Switch to canonical structured answer (#3916)
* Switch Calculator to canoncial structured answer

* Add Goodie Template
2017-02-06 16:06:33 -05:00
Brett Stime a0d967d13c Increases threshold before exponent notation
My particular concern is:
  When I query: "bytes in 1 mib"
  I want a precise response: "1,048,576 bytes"
  ...instead of "1.05 * 10^6 bytes"

Beyond that, generally, I believe that most people who can cognitively handle numbers up to 1MM can also handle any number with a seven digit integer-part/characteristic (http://math.stackexchange.com/a/64045/92444). Ideally, the decision should be made based on the number of characters in the significand (https://en.wikipedia.org/wiki/Significand) but that's beyond what I have time for at the moment (especially given how rusty my perl is) ;) .
2017-02-02 09:47:43 -06:00
Zaahir Moolla 0ad6eba28a Calculator: Prevent anything but allowed ops in the query (#3903)
* prevent anything but allowed ops in the query
no negative nums

* Uncomment neg catch and move after garbage is removed

* Add more tests

* The hex check can be simplified since the trigger isn't allowing most of it
Allow expressions like 1e9 to pass

* Allow = in query
decimal/negatives with e

* Remove debug

* add test for 1e9 query
2017-01-30 17:46:21 -05:00
Zaahir Moolla 3309758c1d Calculator: More fixes -- Trigger regex contained a bug (#3898)
* Restrict some other stuff

* Don't require digit

* Restrict multiple ops to two or less

* reject empty parens/multiple ops

* No @, or $ not followed by a number or .

* combine char class

* add more negative tests

* Add ops back, case-insensitive subs, require two ops again

* Case-insensitive on multiple ops too

* Allow leading negatives

* Move the leading neg sub

* Better regex for hex input

* update tests
2017-01-28 14:07:00 -05:00
Zaahir Moolla 9322e7b34c Calculator: Improve triggering and execution (#3894)
* Update trigger
Use Safe for evaluation with the minimum functions
Removed unnecessary capturing, redundant function calls

* Add some tests

* Remove eval since we don't allow die
Add comment about debugging failed reval

* Add rv2gv from :base_orig to allow compat with Safe 2.35
Remove prtf since that was in :base_orig which was removed

* Remove unneeded opsets

* Silence all of reval's warnings

* Add STRICT
2017-01-26 10:45:49 -05:00
Rob Emery d05d64dfe7 Conversions: Adding support for n'm" format (#3891)
* Conversions: Failing test for n'm" format

* Conversions: Adding a totally specific workaround for 3 feet 5 inches or 6'1" queries

* Conversions: Accuracy correct relative to output

* Conversions: Improving test coverage around whitespace

* Conversions: Removing duplication

* Conversions: Handling foot and inch

* Conversions: Adding tests for feet and inches into another unit and failing test for the UK common "n foot m", commonly used for height

* Conversions: Implemeting the UK common 6 foot 1 query support
2017-01-26 09:42:27 -05:00
Gautam krishna.R ac73384d0c Merge pull request #3869 from duckduckgo/mattr/chronometer
Stopwatch: add "chronometer" trigger
2017-01-26 19:22:25 +05:30
Zaahir Moolla a8d92e3cb5 Revert "ignore reval's warnings" (#3893) 2017-01-25 18:19:31 -05:00
Zach Thompson 369c894439 ignore reval's warnings (#3892)
* Update trigger
Use Safe for evaluation with the minimum functions
Removed unnecessary capturing, redundant function calls

* Add some tests

* Remove eval since we don't allow die
Add comment about debugging failed reval

* Add rv2gv from :base_orig to allow compat with Safe 2.35
Remove prtf since that was in :base_orig which was removed

* Remove unneeded opsets

* Silence all of reval's warnings
2017-01-25 17:35:25 -05:00
Zaahir Moolla 840cdc99a1 Revert "calculator: trigger/safe" (#3890) 2017-01-25 15:00:10 -05:00
Zach Thompson 2113d41a79 calculator: trigger/safe (#3878)
* Update trigger
Use Safe for evaluation with the minimum functions
Removed unnecessary capturing, redundant function calls

* Add some tests

* Remove eval since we don't allow die
Add comment about debugging failed reval

* Add rv2gv from :base_orig to allow compat with Safe 2.35
Remove prtf since that was in :base_orig which was removed

* Remove unneeded opsets
2017-01-24 15:00:37 -05:00
Nalin Bhardwaj 3f2c68cece Remove alarm from Calculator and PrimeFactors (#3881)
* Removed alarm from calculator

* Removed alarm from PrimeFactors
2017-01-24 13:00:19 +00:00
Rob c2392f005d Conversions: Ensuring support for "degrees centigrade" 2017-01-22 18:28:43 +00:00
Matthew Ramina edfa892e18 Stopwatch: add chronometer (fixes #3843) 2017-01-20 15:49:36 -05:00
Zaahir Moolla 06196e98b5 Revert "Calculator: Dumb down the trigger" (#3868) 2017-01-20 15:49:16 -05:00
Zach Thompson 8e5d7b46e8 Calculator: Dumb down the trigger (#3866)
* Dumb down the calculator regex

* No interpolation

* Add tests to ensure changes work
2017-01-18 13:23:49 -05:00
Mariano Simone 13d752a294 Use structured_answer for GoldenRatio
This addresses part of #1163
2017-01-02 20:28:53 +00:00
Gautam krishna.R bcda8cf430 Merge pull request #3809 from jarmokivekas/patch-1
GUID: add trigger word
2016-12-25 02:14:49 +05:30
Zaahir Moolla dbb9214312 ensure we handle upper case queries properly 2016-12-21 14:48:49 -05:00
Zaahir Moolla 6f0b4d9ac7 Use _event_ placeholder in answer as well 2016-12-21 14:48:21 -05:00
Zaahir Moolla e1681517ad add back article; Use placeholder to genereate triggers with and without article 2016-12-21 14:27:22 -05:00
Zaahir Moolla ac669718b0 rephrase question as answer in subtitle 2016-12-21 13:57:46 -05:00
Zaahir Moolla b56b68923f refactor to improve flexibility; more declarative yaml 2016-12-20 15:09:06 -05:00
Zaahir Moolla 2a049d11fc use more at url to send user to Wikipedia 2016-12-20 13:51:45 -05:00
Zaahir Moolla 26709bf4ad Create new HistoricalEvents Goodie 2016-12-20 13:35:27 -05:00
Manraj Singh 190fd4444c CSS Animations Goodie (#3424)
* Base created

* YML File Updated

* Codepen logo added

* Logo renamed | urls added

* Initial version added

* Removes unwanted CSS

* Remove codepen logo

* Removes cssanimations.js

* Restructuring things

* Fixes bareword test file issue

* Test File fixed

* CSS Tricks Demos added

* Changes to tile and data

* Title added and styled

* Adds 2 demos to Goodie

* Fixes margin between title and demo

* Modularizing demos

* CSS Animations: Makes code more modular

* Data YML updated

* Fixes no file exist issue

* Minor changes in test file

* Fix: Reduces width of tile, fixes animation overflows

* Feature: CodePen AutoPen Generation added

* Fix: Test File fixed

* Add: Proportional Animations

* Add: Changing transform-origin mid-animation

* Add: Negative transform-origins

* Add: Box shadow magic

* Fix: Fix conflict in CSS

* Update: Removes unnecessary keys

* Fix: Warnings and errors for https

* Fix: Fixes text in demo 1

* Formats: Formats all CSS Stylesheets

* Fix: Handles unnecessary triggering

* Fix: Handles if variables are undefined

* Adds: Adds more test cases

* Fix: Moves logic to a separate sub routine

* Fix: Removes external resource usage
2016-12-15 15:09:55 -05:00
Jarmo Kivekas d114359839 GUID goodie: add trigger word
I typed "GUID generator" into ddg in when I was looking to trigger this goodie. This change would make that trigger this Goodie.
2016-12-11 08:02:21 +02:00
Rob Emery c25c8573e8 ColorPicker: Fixing over eager triggering (#3789)
* ColorPicker: Adding tests for queries that should not return

* ColorPicker: If there is a string after the triggering it needs to be a valid colour name
2016-12-01 01:08:11 -05:00
mhasbini a17becb858 fix invalid email format 2016-11-14 17:22:03 +02:00
Akansh Gulati e9c9456f98 New SASS to CSS IA (#3635)
* Added the SasstoCSS library

* Started with IA

* updated the goodie var

* Updated the classes to handlebar

* Updated the URL

* Updated the test file

* Updated the cdn of sass library

* Updates on format of IA

* fix(sass_to_css): Updated the url of the library.

* fix(triggers): Updated the tests and pm file.

* fix: Updated the file to remove ID param.

* fix(sass.js): Updated the code for synchronous sass compile.

* fix(sass_to_css.js): Load library when data is actually entered.

* fix(layout): Updated the layout of buttons.
2016-10-26 13:25:45 -04:00
Akansh Gulati 9ce00a9e8e New JS Beautifier Goodie (#3640)
* Js Beautifier

* fix(js_beautifier.js): Updated the library URL to internal.

* fix(triggers): Added more triggers.

* fix(triggers): Added a few more triggers and tests.
2016-10-21 10:24:15 -04:00
Akansh Gulati c95afc52f7 New Html beautifier Goodie (#3658)
* Template Created

* Added the HTML beautifier files

* Updated the code

* Renamed the files

* Added more triggers and updated test file

* fix(html-beautify): Updated the url of library.

* fix(html_beautify): Added global scope to method.
2016-10-21 10:18:11 -04:00
apandey 026d3820dc fixed changes 2016-10-11 16:00:20 +00:00
Sahil Dua 1900b15c9d JSONValidator: Improve title/subtitle to clarify usage (#3648)
* JSONValidator: Improve title/subtitle to clarify usage
Fixes #3643

* JSONValidator: Change title/subtitle in corresponding tests
2016-10-07 09:23:47 -04:00
Eric Johnson 53e848c143 Make this work with DateTimev1.39 (#3633) 2016-09-27 11:22:56 -04:00
Ben Moon 56d6868480 RgbColor: Add support for color titles (#3574)
* Add color titles to output

* Add titles for color in front-end (hover)

Hovering over the circle gives the color 'title', and hovering over a
hex value gives the color 'name' (more suitable for HTML and similar).
2016-09-26 12:38:31 -04:00
Rob Emery a3c9cc3745 Merge pull request #3140 from duckduckgo/gd/new-lists-role
New List GoodieRole
2016-09-15 21:55:52 +01:00
Gautam krishna.R 4f361abae7 HTMLEntitiesEncode: Remove remaining html_enc (#3608)
Fixes #3607

* Update HTMLEntitiesEncode.pm

* i think this fixes it

* Update HTMLEntitiesEncode.pm

* Update HTMLEntitiesEncode.pm
2016-09-10 13:27:45 +01:00
Rasika Pohankar 51dafeaa31 Remove periods from titles, subtitles and plaintext responses (#3569)
* Remove periods from titles, subtitles and plaintext responses

* Update test files

* Remove concatenation

* Remove repeated tests from Cusip test file
2016-09-06 11:15:19 +01:00
Gautam krishna.R 85dfac253e Remove html_enc from HTMLEntitiesEncode (#3601) 2016-09-05 11:09:06 +01:00
Gautam krishna.R a3fecac876 Remove html_enc from Regexp (#3600) 2016-09-05 11:01:47 +01:00
Gautam krishna.R 94b217af1a Remove html_enc() from RandomDate.pm (#3599)
* removed all html_enc()

* fixed some tests still 2 failing

* Update RandomDate.pm
2016-09-05 10:40:02 +01:00
Gautam krishna.R 4d3cfd4001 Remove use of `html_enc` in Sha3 (#3578)
* Update SHA3.pm

* Update SHA3.t

* Update SHA3.t

* Update SHA3.t

* Update SHA3.t

* making tests pass
2016-09-04 16:43:40 +01:00
Harrison Chienjo b90188cfd7 Remove repeated \s* in character set. (#3596) 2016-09-04 11:59:44 +01:00
Ben Moon 3d6acf28b4 Merge pull request #3593 from hchienjo/add_triggers
Roman Numerals: Add more trigger words.
2016-09-03 15:44:06 +01:00
Jasmeet Singh Saini f79cef4cf4 Remove use of 'html_enc' (#3567)
* removed html_enc from ABC,ANAGRAM,AVERAGE,BASE64,BITSUM,CHARS

* string interpolation fixed

* string interpolation fix
2016-09-03 15:36:12 +01:00
hchienjo 42d1b11791 Make '10 to roman numerals' and 'D to arabic' trigger. 2016-09-03 13:19:15 +00:00
Manraj Singh 1b73ba6955 Remove use of `html_enc` (#3568)
* Few IAs updated

* Few more IAs updated

* Fixes string interpolation

* Fixes more string interpolation

* Fixes minor issue
2016-09-02 09:52:59 +01:00
Sahil Dua f13d396b5d Remove use of html_enc (#3571)
* Rot13: Remove HTML Encoding from output text

* Scramble: Remove HTML Encoding from output text

* Remove html encoding from TimezoneConverter and TitleCase IAs

* RIPEMD: Remove HTML encoding from output text

* Regexp: Remove HTML encoding

* Remove html_enc from NameDays and MD5 IAs

* Remove html_enc from MD4 and IDN

* FIGlet: Remove html enc

* Remove html enc from CaesarCipher and Braille

* Atbash: Remove html_enc from output text

* MD4: Simplify string concatenation in perl way

* NameDays: Simplify string concatenation the perl way

* NameDays: Refactor string concatenation
2016-08-31 19:58:57 +01:00
Zaahir Moolla 0982dc5e64 Merge pull request #3566 from sahildua2305/html-encoding-remove
Remove HTML encoding from multiple goodies
2016-08-24 18:35:26 -04:00
sdua 433a989c74 URLDecode: Remove HTML encoding from output text 2016-08-24 19:32:36 +00:00
sdua 3c8e910e54 URLEncode: Remove HTML Encoding of output text 2016-08-24 19:29:20 +00:00
sdua 3fc6dec7fc CSSColors: Remove redundant lc function call 2016-08-24 19:12:20 +00:00
sdua 4d3c77280a CSSColors: Improve handle to avoid over-triggering 2016-08-24 19:10:29 +00:00
Zaahir Moolla d6d3593dac Remove HTML Encoding of output text 2016-08-24 12:29:28 -04:00
Zaahir Moolla 6b4223a991 Merge pull request #3346 from duckduckgo/gd/rgb-color-new-ia
New RGBColor Instant Answer
2016-08-23 10:10:20 -04:00
Daniel Davis 91ef24236a Merge pull request #3533 from hchienjo/enhancing_roman_goodie
Improve triggering of Roman Numerals
2016-08-19 10:47:41 +09:00
Daniel Davis 3ff75f651c Merge pull request #3492 from shubh1m/feature-days_since
DaysBetween: Add 'Days since' feature
2016-08-17 17:07:17 +09:00
hchienjo 0dbffa089d Improve regex substitution.
Proposed fix for issue https://github.com/duckduckgo/zeroclickinfo-goodies/issues/3484
2016-08-15 10:26:19 +00:00
Rob Emery f8878c8237 Merge pull request #3511 from duckduckgo/jag/conversions-base
Conversions.pm: Switch group from 'text' to 'base'.
2016-08-14 21:58:53 +01:00
Ben Moon 6e31737cdd Add support for three-digit hex codes 2016-08-13 11:08:02 +01:00
Zaahir Moolla 53be50050d Merge pull request #3400 from sahildua2305/colors-goodie-new
New CSS Colors Goodie
2016-08-11 13:25:50 -04:00
sdua 10e134d981 CssColors: Perl code cleanup 2016-08-09 19:48:27 +00:00
sdua d8071f0460 CssColors: Clean up perl code 2016-08-09 19:46:10 +00:00
Zaahir Moolla aa595401d7 Merge pull request #3518 from duckduckgo/pr/3367
Continue PR #3367
2016-08-09 14:17:35 -04:00
jagtalon 1237b0eae2 Conversions.pm: Switch group from 'text' to 'base'.
Whenever we're adding a custom template, we always have to use the `base` template because it looks wonky when we use anything else.
2016-08-08 18:37:39 +00:00
Ben Moon d17319fdf2 Remove trailing space from subtitle prefixes 2016-08-06 18:19:58 +01:00
Zaahir Moolla f5a020b470 Merge pull request #3425 from duckduckgo/zaahir/js-minify-improvements
JS Minify Visual Improvements
2016-08-06 11:31:52 -04:00
tagawa 938789db51 Fixed typo 2016-08-04 05:29:10 +00:00
tagawa fbe40ef691 Edited code to pass tests 2016-08-04 05:27:37 +00:00
iamshubh22 48a7feba0b DaysBetween: Add 'Days since' feature 2016-08-04 03:24:31 +05:30
Daniel Davis 76837bcce0 Merge pull request #3218 from tagawa/tagawa/sha3
SHA-3: Added 'sha-3' trigger
2016-08-02 23:04:06 +09:00
Daniel Davis 3f027ec923 Merge pull request #3467 from shadabk/shadabk/dice-improved
Shadabk/dice improved
2016-08-02 10:25:34 +09:00
skhan4 7b660e0d3f Solves issue #3437 2016-08-01 17:25:13 +00:00
skhan4 8d66247b5d dice improved test-2 2016-07-31 10:52:32 +00:00
skhan4 2ec8928355 modified dice.pm test-1 2016-07-31 10:26:33 +00:00
sdua 021eac6715 Update subtitle to include mention of prettyprint feature 2016-07-30 16:58:00 +00:00
Maria Grazia Alastra 33f622f8c1 Merge pull request #3432 from sahildua2305/json-validator-new
New JSON Validator
2016-07-28 23:18:19 +02:00
Daniel Davis 51b64c295e Merge pull request #3409 from duckduckgo/gd/random-date-past-future
RandomDate: Add support for ranges
2016-07-28 17:35:07 +09:00
lowellosaurus 06563194b6 Add data for the Indian Armed Forces (#3444) 2016-07-27 21:02:23 +01:00
Daniel Davis a78468f3e7 Merge pull request #3368 from rasikapohankar/cron
CrontabCheatSheet: Remove Goodie
2016-07-27 00:18:38 +09:00
Zac Pappis 7ca0a066e8 Merge pull request #3243 from sahildua2305/frequency-improve
Frequency: Update IA to use List template
2016-07-25 09:18:55 -04:00
sdua 8c92d92123 JSONValidator: Improve Triggering 2016-07-24 19:30:44 +00:00
sdua f2f54f0e59 JSONValidator: Update subtitle section 2016-07-24 19:19:36 +00:00
sdua 44aa73ae73 JSONValidator: Add basic template and load library 2016-07-24 18:25:07 +00:00
Ben Moon eb7e4a5813 Ensure trailing punctuation is ignored 2016-07-23 19:14:10 +01:00
msingh2 6138d325c7 Fixes Color Picker Name 2016-07-22 19:53:58 +00:00
sdua 3c4ad30c4d JSONValidator: Init v1 2016-07-21 21:31:53 +00:00
sdua 6e4d73b847 JSONValidator: Init 2016-07-21 20:47:14 +00:00
Zaahir Moolla f2a0fe934f Merge pull request #3284 from 122131/minecraft-crafting-update
Minecraft: recipe update & other enhancements
2016-07-21 12:20:04 -04:00
Olivia Haas 92e476b216 Merge pull request #3398 from duckduckgo/mintsoft/parcelforce-eager-trigger
Parcelforce: Triggering on luhn!
2016-07-21 11:19:56 -04:00
Olivia Haas 59c235876d Merge pull request #3397 from duckduckgo/mintsoft/url_decode
URLDecode: Fixing case sensitive triggers
2016-07-21 11:03:47 -04:00
Zaahir Moolla 1a8c0f040e Adjust subtitle, and textarea height for mobile 2016-07-21 09:57:25 -04:00
Zaahir Moolla 7df2aab5ad Improve button sizing and position, add placeholder text 2016-07-21 09:53:36 -04:00
Zaahir Moolla 3e7bcfc8b5 Merge pull request #3417 from sahildua2305/refactor-js-minify
JsMinify: Code Refactor and Design Adjustments [WIP]
2016-07-21 08:17:36 -04:00
Daniel Davis d6fac752ed Merge pull request #3399 from regagain/luhn
Luhn Algorithm: Reduce subtitle redundancy
2016-07-21 11:40:32 +09:00