Commit Graph

7 Commits (master)

Author SHA1 Message Date
Zaahir Moolla 03ec6b3650 Calculator: Fix text selection across all browsers (#4417)
* Listen to calc--wrap and apply selected class as needed

* Remove unneeded mousedown handler

* Clean trailing spaces
2017-08-10 22:36:26 +01:00
Zaahir Moolla db434a22d0 Calculator: Fix text selection/copy for Firefox (#4351)
* Ensure mouseup doesn't remove focus for Firefox

* Use hover and selected classes to style calc input

* Ignore meta keys to allow copying in Firefox
2017-07-14 09:44:29 +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 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
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
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
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