Commit Graph

27 Commits

Author SHA1 Message Date
George Stephanis 5e8ef8f18d Check for truthiness.
This avoids silliness where `’0’` evaluates to true.  Just parse it as
an int and evaluate that.
2015-08-10 17:21:52 -04:00
George Stephanis dff70a0509 Add more data attributes to the rows and fields. 2015-08-10 16:54:32 -04:00
George Stephanis f9331ab5c4 Should be comparing to `'1'` not `1`. 2015-08-08 11:03:46 -04:00
George Stephanis 521d8f4861 Migrate the logic and queries out of the template file.
Move them where they belong, in the class that calls it.
2015-08-07 17:28:44 -04:00
George Stephanis d854e8dc2a Remove the legacy pagination. 2015-08-07 17:22:07 -04:00
George Stephanis bba6f80d9d Don't set them for unexistent rates. 2015-08-07 17:06:50 -04:00
George Stephanis 5736d66a92 Pagination now works by first, prev, next, last.
Still need to get number based pagination working.
2015-08-07 16:58:42 -04:00
George Stephanis ba1d2d7bde Add in and populate pagination template.
The buttons don’t actually do anything yet, but it outputs accurately
and inherits core styles.
2015-08-07 16:36:50 -04:00
George Stephanis 2b2a54c5dc Pass rates in as an array, not an associative array, so it's an Array in js. 2015-08-07 16:01:57 -04:00
George Stephanis c627d49460 A default placeholder to show until the rendering code replaces it. 2015-08-07 15:44:23 -04:00
George Stephanis 4874408a98 Insert placeholder divs for search and pagination. 2015-08-07 15:25:09 -04:00
George Stephanis 56dc05d80e Whitespace tweaks 2015-08-07 15:24:49 -04:00
George Stephanis 516977bd01 JSHint fixes.
The other advantage of splitting js out of php files — jshint can run
on it! :) :) :)
2015-08-07 12:10:01 -04:00
George Stephanis b030927590 Extract 'No Rows Selected' string 2015-08-07 11:58:02 -04:00
George Stephanis bd30def6a1 Whitespace tidy! 2015-08-07 11:57:48 -04:00
George Stephanis 4221c7be24 Extract the autocomplete for states and countries data.
Localize it!
2015-08-07 11:57:38 -04:00
George Stephanis 65eb16fe8a Migrate csv columns to localize script. 2015-08-07 11:47:39 -04:00
George Stephanis 974b337fbb Move js in from php template file. 2015-08-07 11:42:49 -04:00
George Stephanis 64f48f8706 Rename and tweak how js is registered.
Thanks @claudiosmweb for the suggestion to match existing conventions.
2015-08-07 11:36:38 -04:00
George Stephanis cca93cd09e Prefix template name with `wc-`
Good call, @mikejolley
2015-08-07 11:14:55 -04:00
George Stephanis 729e6c924c Big changeover to JS templating for the table.
Switching over to building the table with JS — wp.template.

We are now using the same JS template for existing rows and newly
generated rows on the fly — this should simplify things moving forward.

I’ve also started building stuff in an external JS file rather than
straight on the page.  Will continue migrating things to it and
localizing as needed.

Saved ( 2 * displayed tax rates - 1 ) db queries per page load by doing
the locations all in one query and then parceling them out in php.

More coming.
2015-08-07 11:04:55 -04:00
George Stephanis f0656e7e38 Tax Rate Search: First whack.
This is by no means complete.  A number of things need to be relocated
and optimized still, but it does a rough search, purely in JS, and
highlights the results in yellow.
2015-08-06 17:41:12 -04:00
Mike Jolley ddd97b64c3 Remove white space to fix appearance of new rows
Fixes #8730
2015-08-06 11:38:46 +01:00
George Stephanis 29d9a7da8c Found two missing `esc_js()` calls as well. 2015-08-05 14:10:10 -04:00
George Stephanis c7ee929325 Partial _e() => esc_attr_e() changeover.
There’s a lot of them, so I’m breaking them into multiple commits.

This is safeguarding stuff in case some translation uses a double
quote, it will no longer risk breaking out of the attribute.
2015-08-05 14:10:09 -04:00
Mike Jolley 7f2a6b5e41 Fix pagination by preventing old query args from being re-added to the link
Fixes #7164
2015-01-20 09:43:56 +00:00
Claudio Sanches 03193b867b Creted new webhooks edit interface 2015-01-08 16:34:30 -02:00