Commit Graph

4672 Commits (master)

Author SHA1 Message Date
gargaml 026279bb6a Roman numerals (improvements) (#4402)
* First shot at improving roman numeral IA.

Added a new converter.
Added new default settings.
Added some tests.

* Added un upper bound on arabic numbers.

* Remove some typo…

* Added some new triggers.
Allowed uncorrect roman number to load the UI anyway.
Fixed a test.

* Added new triggers.
Fixed regular expressions involved in the UI configuration.
Added new tests.
2017-08-09 11:59:17 +03:00
PJ Hampton 27c5c308de Conversions: Add case sensitivity. Fix ambiguity collisions (#4406)
* Check in work.

* Fix casing ambiguity.

* Fix ambiguity selection.

* break out of outer loop.

* fix YAML
2017-08-08 16:37:13 -04:00
PJ Hampton d17dde90b6 Conversions: US locale defaulting (#4372)
* Add tests to drive development.

Check in work.

Fixed temp triggering ambiguity.

Add experimental conversions US default.

Update the tests.

* Update based on feedback.
2017-08-08 09:46:44 -04:00
PJ Hampton cd0871b9f4 New Timezonetime IA (#4393)
* Check in shivam99aa's work.

* Finish timezone/time IA.

* Refactor Timezonetime.pm

* fix indentation
2017-08-01 12:59:49 -04:00
PJ Hampton 6ba96f8286 Allow asinh and acosh through when triggering. (#4360) 2017-07-18 11:57:22 -04:00
PJ Hampton d5129df6e4 Improve coverage. (#4363) 2017-07-18 11:56:43 -04:00
Philip Kirkbride b082c3013e Palindrome: Convert to Structured (#4352)
* Convert palindrome to structured, tabs, negative tests

* remove comments, simplify subtitle function
2017-07-15 23:14:19 +01:00
PJ Hampton 9c581d9564 Calculator: Various Fixes (#4349)
* Fix weird error message.

* Stop algebra overtriggering.

* Fix overflow error.

* Fixed tests.

* Conclude big patch.

* Patch review bugs.
2017-07-13 18:04:32 -04:00
PJ Hampton 588c354075 New Text Converter IA (#4335)
* Initial commit.

* Prototype up and running.

* Check in work.

* Update work.

* Checking in work.

* Updates based on feedback.

* Code in design.

* Update padding / margin on controls.

* fix mobile styles
2017-07-13 17:46:49 -04:00
Lisa Georgiades b9297e004a Factors: Add support for negative numbers. Add negative cases and tidy (#4245) (#4299)
* Add support for negative numbers. Add negative cases and tidy (#4245)

* Remove extraneous regex match
2017-07-13 13:12:18 -04:00
PJ Hampton 6307864f65 Conversions: Updates UI + Triggering (#4345)
* Fix floz + add n miles.

* Support fractions.

* Update conversions.

* Update based on feedback.
2017-07-13 07:51:16 -04:00
Philip Kirkbride d7f897af3b converting random_name to return structured answer (#4061)
* converting random_name to return structured answer

* altSubtitle typo fix

* altSubtitle typo fix
2017-07-13 07:50:27 -04:00
Philip Kirkbride ab9ce37808 Convert poker goodie to a structured answer, add negative tests (#4350) 2017-07-13 07:43:13 -04:00
Kyle Daruwalla 215857e8dd ColorCodes: Triggers on any query ending in "color <name>" (#4220)
* ColorCodes: Triggers on any query ending in "color <name>"

- Added logic to prevent triggering when excess words are involved in
  the sentence that are not expected

Fixes #3294

* - Fixed regex for filler words to be simpler
- Fixed filler count return statement by removing the double negative

* Simplified regex to catch filler words

* Fixed whitespace changes

* Added more tests for when the IA should not trigger. Existing tests already sufficiently cover when the IA should trigger.
2017-07-12 07:19:17 -04:00
PJ Hampton af0a70222d Calculator: Fixes up trig functions. (#4339)
* Fixes up trig functions.

Replace regex.

* Fixed 1/(x) issues.

* Update dodgy lookahead.
2017-07-10 18:15:49 -04:00
PJ Hampton 8e5cd3f431 Add factorial support. (#4331)
Support factorials. Fix - remove bug.

Fixed a couple of iafd data issues.
2017-07-03 14:02:33 -04:00
PJ Hampton cf799ad23b Conversions: fix spelling. (#4332) 2017-07-02 21:01:55 +01:00
PJ Hampton 0fd68b0912 Conversions: Add expanded triggers. (#4328)
* Add expanded triggers.

* Update triggering / tests.

* Remove convert as a trigger.
2017-06-29 17:29:18 -04:00
PJ Hampton 65f69dab27 Calculator: Various improvements. (#4318)
* Various improvements.

query_nowhitespace removal workaround.

Updated code.

Update code.

Fix exponential state when squaring/cubing

Fix calculator bugs.

* Fix log.

* Various improvements.

* Update variable name.

* Remove debug statements.

* Fix logs/lns on front-end.
2017-06-29 16:55:27 -04:00
PJ Hampton 6457fdeb33 Conversions: Add general triggers. Add aditional aliases. (#4327)
* Add general triggers. Added aditional aliases.

* Remove blocking legacy code.

* Add french word for converter.

* Add missing closing brackets
2017-06-28 11:25:58 -04:00
PJ Hampton e1fe0c8fc0 Add failing tests. (#4325)
Update triggering.

Update triggering scheme.
2017-06-28 09:41:51 -04:00
PJ Hampton ee9d459966 Tips: Add interactivity (#4155)
* initial commit.

* Fixed NaN issue with bill amount.

* Finish up tips.

* Fixed markup.

* Remove mathjs as dep

* Finishing touches...

* Tweak design.

* Add class

* Add simplified css

* overhaul ui

* Add total per person.

* Add secondary text

* Update input class.

* Add further bindings.

* Removed rouge file.
2017-06-23 17:12:52 -04:00
Joshua Liu 9edc2f66bc Molar Mass: Resolve conflicting triggers issue and add new triggers (#4250)
* Molar Mass: Remove conflicting triggers and update tests

* Molar Mass: Increased flexibility of triggers

* Molar Mass: forgot the apostrophe

* Molar Mass: Fix Regex

* Molar Mass: widen triggers
2017-06-23 14:32:59 +01:00
Philip Kirkbride db93ca9b76 Don't trigger log or lg without brackets (as these don't work) (#4249)
* Add sed command example

* Move to file section

* Don't trigger log without brackets. 

Quick fix for issue #4246

* Remove test that uses log(10)

* Update Calculator.t

* dont trigger ln without brackets either

* remove ln and log without bracket tests

* previously removed wrong test bring it back
2017-06-22 16:01:58 +01:00
Billy Barbaro 9a401b5caf Calculator: Comma in Floating Point Numbers (#4199)
* Using detected number style to make sure queries use a . for a decimal and a , to seperate thousands

* Now using method in number styler to prepare numbers for computation.
2017-06-22 15:46:49 +01:00
PJ Hampton e3b649c2ec Conversions: Enable single unit triggers (#4316)
* Add failing tests.

Enable single unit queries.

Add units for triggering.

* Update indentation.
2017-06-21 14:30:34 -04:00
PJ Hampton 5daa945081 Add plural aliases (#4285)
Add speed generic trigs.

Update the natural language triggering scheme.

Update yml file. Remove dep

Reduce yaml file.

mint/mool refactor requests.

Update stuff.
2017-06-20 16:25:14 -04:00
Aastha 4c081b9598 change in Venezuela timezone (VET) (#4296) 2017-06-18 18:38:02 +01:00
Zaahir Moolla 1c867979c1 Conversions: Support single unit input, case-insensitive fallback check (#4261)
* Allow celcisu typo, updated tests accordingly

* Store regex captures in variables

* Allow single unit inputs through guard

* Pass through single unit input to frontend

* Explcitly match guard regex, better check for valid result

* Cleanup whitespace and indentation

* Lowercase symbols that are case-insensitive

* Fix and simplify guard regex

* Better handling of named captures, ensure left unit is not only match

* Case sensitive match first, fall back to lowercase match on symbol

* fix indentation

* remove redundant m on regex match

* Removed default if duplicate.
2017-06-15 15:51:24 +01:00
Aastha 07bbf47634 TimezoneConverter: fixes #4210 fixed error in timezone display (#4262)
* fixed error in timezone display

* minor change

* added new test cases
2017-06-14 21:38:18 +01:00
Zaahir Moolla e9e378f3c3 Conversions: Allow "celcius" typo, updated tests (#4260)
* Allow celcisu typo, updated tests accordingly

* correct typo, move new tests below

* simplify celsius regex
2017-06-09 18:17:11 +02:00
PJ Hampton 60db2ef0ba MolarMass: Fix syntactical error. (#4238)
* Fix syntactical error.

* Decuddle if/elsif/else blocks
2017-06-05 23:08:50 +02:00
PJ Hampton 6d9896cb8b 2048: Tweaks before production (#4027)
* Added additional trigger.

* Fixed container placement / alignment.

* Updated tests.

* Add async start.

* Revert "Add async start."

This reverts commit 54b3edb88221051393d818ccff35d9ae45d10049.

* Check for mobile device and return before onShow

* Ensure we return value from DDH.failed

* remove trailing spaces
2017-06-05 22:49:57 +02:00
PJ Hampton 8c5ac1d651 Conversions: Broaden Triggering (#4239)
* Add triggers to list.

* Remove smart match.

* Stash.

* Broaden triggering.

* Update test formatting.

* Revert "Update test formatting."

This reverts commit 390186743c07bffa5d57025e04926d2473a3ff2e.
Reverting because this creates big conflicts in the PR. We can address
the formatting later

* simply language trigger loading

* Add acronyms for teaspoon

* remove trailing spaces

* Add test for abbreviated teaspoon and tablespoon

* remove trailing spaces
2017-06-05 20:18:18 +02:00
Joshua Liu dbe30f8db7 Molar Mass: New Molar Mass Instant Answer (#4219)
* Add Molar Mass Calculation

* Add molar mass algorithm

* Update Molar Mass Handler

* Molar Mass: added input sanitization

* Molar Mass: Fix sanitation

* Molar Mass: Added tests, Changed mass table, Changed sanitation process

* Molar Mass: Documentation and Formatting

* Molar Mass: Fixed an input sanitation bug and changed instant answer format

* Molar Mass: Remove Boilerplate Comments

* Molar Mass: move data outside of code and add common compound support

* Molar Mass: Change regular expressions

* Molar Mass: Update YAML Format
2017-05-31 20:13:25 +01:00
PJ Hampton 900c5a3da5 Calculator: Fixes onload js issue / Patch triggering (#4230)
* catch value error on load.

* added quick win triggering edge cases from pixel logs.
2017-05-29 07:27:40 -04:00
Rob Emery e3cb2380e9 DatesRole: Adding support for partial time format (#4187)
* DatesRole: Failing tests for new relative date + time format

* DatesRole: Adding support for queries like "03 may 07:00"
2017-05-24 22:36:46 -04:00
PJ Hampton 72729b7c16 Calculator: (URGENT) Fix math.js log|ln simplify issue. (#4183)
* Fix math.js simplify issue.

* Remove debug statements.

* Adds fact to the mix.

* Stash

* Fix greedy quantifier in trig and log/ln

* Don't trigger on anything with stuff after =

* allow triggering on <func> <number>

* Both sides of =

* Fix expressions.

* Tighten up triggering based on valid expressions.

* Remove dumper obj

* Tighten up word triggering.

* Allow only one currency through.

* Kill off symbols in js if allowed through.

* Allow negative numbers.

* Add support for negated numbers.

* Fix initialize issue.

* Refactor code slightly

* Tightened regexs

* Require space between log and input
2017-05-24 17:44:13 -04:00
Robert Badea a588c17f81 html_entities: Added new triggers & tests (#4203)
* added new triggers

* added new test
2017-05-22 14:40:24 -04:00
Shivam Shukla 9ca979f198 Timer: Changed query_raw to query_lc (#4165)
* Timer: Changed query_raw to query_lc
* also fixes #4188 (regression from ambiguous triggers)

* Updated regex and also solve issue #4188

* Added one more test case
2017-05-18 16:54:35 -04:00
Aditya Tandon 8e21782c41 Conversions: Adds generic triggers (#4168)
* adding triggers

* indenting key value pairs

* using smart match

* removing liq vol for now

* shortening regex

* adding test

* removing earlier test but stil it fails

* update test

* formatting test
2017-05-16 15:49:13 +01:00
PJ Hampton 1ce7de6bdb Add in missing duration units. (#4195) 2017-05-12 14:55:36 -04:00
Owen Hines e6bbb3aaf1 Added 'count down' timer trigger (#4180) 2017-05-10 22:23:35 +01:00
PJ Hampton 137f98c31b Calculator: Add square root support from search bar. (#4182) 2017-05-09 16:53:43 -04:00
Zaahir Moolla 973969fde9 Conversions: Use stacked input/select on desktop (#4184)
* Stacked layout on desktop as well, larger input font

* ceanup whitespace

* 80% width desktop
2017-05-09 21:13:01 +01:00
Kyle Daruwalla 9e44abe1b4 PrimeFactors: Improve triggering (#4149)
* PrimeFactors: Improve triggering
- Added check to regex guard if query matches form "is <number> prime"
- Strips all preceeding non-digit characters from remainder

Fixes #2799

* Added support for new triggers:
- 'is <number> a prime'
- 'is <number> a prime number'
- 'is <number> prime number'
2017-05-05 17:57:48 -04:00
Manraj Singh c3595bdea0 ColorPicker: Makes triggering more generic (#4138)
* ColorPicker: Remove suffixed triggers

* ColorPicker: Handle extra words in remainder

* ColorPicker: Adds tests to check extra words in query

* ColorPicker: Add 'conversion' to remove from query

* ColorPicker: Add test for 'conversion' keyword in remainder

* ColorPicker: Simplify regex, lowercase query

* ColorPicker: Remove print statements
2017-05-05 16:13:35 -04:00
PJ Hampton 9a64e8dcc5 Removed some more perl. 2017-04-28 21:51:11 +00:00
PJ Hampton 0bf8da85f1 Deprecate some of the perl. 2017-04-28 21:24:10 +00:00
PJ Hampton f621609aae Removed plu stuff. 2017-04-28 21:01:23 +00:00
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