Commit Graph

12876 Commits

Author SHA1 Message Date
George Stephanis b4682d7f2d Change how things are called to the new bb render. 2015-08-12 12:59:10 -04:00
George Stephanis f7c2223a23 Change the structure to Backbone models/views. 2015-08-12 12:59:10 -04:00
George Stephanis 9e5abc22ad Whoops! Comma, not semicolon. 2015-08-12 12:59:10 -04:00
George Stephanis c6e3a577c0 Set backbone and underscore as script dependencies. 2015-08-12 12:59:10 -04:00
George Stephanis 8a416f105b Should be comparing to `'1'` not `1`. 2015-08-12 12:59:10 -04:00
George Stephanis b75093b640 Optimization, save the $table selector to avoid some dom lookups. 2015-08-12 12:59:09 -04:00
George Stephanis 386ec26fb9 Whitespace tweaks. 2015-08-12 12:59:09 -04:00
George Stephanis e197bc242f Retool the export to use the global object, not parsing out of the dom. 2015-08-12 12:59:09 -04:00
George Stephanis ddba588987 Migrate the logic and queries out of the template file.
Move them where they belong, in the class that calls it.
2015-08-12 12:59:09 -04:00
George Stephanis 5f4cbf78d0 Remove the legacy pagination. 2015-08-12 12:59:09 -04:00
George Stephanis a1d7121c99 Update the current page when the number is changed. 2015-08-12 12:59:09 -04:00
George Stephanis 4df13e6ffb Don't set them for unexistent rates. 2015-08-12 12:59:09 -04:00
George Stephanis 7bebbaff9e Pagination now works by first, prev, next, last.
Still need to get number based pagination working.
2015-08-12 12:59:09 -04:00
George Stephanis cf59aec17d Add in and populate pagination template.
The buttons don’t actually do anything yet, but it outputs accurately
and inherits core styles.
2015-08-12 12:59:09 -04:00
George Stephanis d9b2907ae2 Begin to handle pagination.
This lets the initial view display only a single page, future commits
will add in the paginater.
2015-08-12 12:59:08 -04:00
George Stephanis be4c7db8bd Pass rates in as an array, not an associative array, so it's an Array in js. 2015-08-12 12:59:08 -04:00
George Stephanis 0608bcce19 The name resetter should also be run after each render. 2015-08-12 12:59:08 -04:00
George Stephanis c9a1ba2f39 A default placeholder to show until the rendering code replaces it. 2015-08-12 12:59:08 -04:00
George Stephanis f9fd4ada58 Wrap the rendering code inside a function that the data can be passed to. 2015-08-12 12:59:08 -04:00
George Stephanis 7985aec296 Ernest the JS so none of it evaluates before dom ready. 2015-08-12 12:59:08 -04:00
George Stephanis 26b95a4d80 Inline documentation explaining some functionality. 2015-08-12 12:59:08 -04:00
George Stephanis 7c60e48b0c Add some code comments. 2015-08-12 12:59:08 -04:00
George Stephanis 37f10c18cd Reposition when autocomplete is triggered.
Also, instead of searching through the whole dom, only search in the
tbody.
2015-08-12 12:59:07 -04:00
George Stephanis 536402c183 Insert placeholder divs for search and pagination. 2015-08-12 12:59:07 -04:00
George Stephanis 308c7f8676 Whitespace tweaks 2015-08-12 12:59:07 -04:00
George Stephanis ea0b9b96b9 Optimization: Don't use $.size(), use native Object.length instead. 2015-08-12 12:59:07 -04:00
George Stephanis 676af1f308 JSHint fixes.
The other advantage of splitting js out of php files — jshint can run
on it! :) :) :)
2015-08-12 12:59:07 -04:00
George Stephanis d3922a96cd Don't constantly rescan the dom for tbody
We have a cached version of $tbody a level up.
2015-08-12 12:59:07 -04:00
George Stephanis 1b035b43a3 Swap `jQuery` to `$`
It’s more readable, and safe to do as we’ve aliased it back in the
enclosure.
2015-08-12 12:59:07 -04:00
George Stephanis 8c47c0df1d Migrate current_class from php to js 2015-08-12 12:59:07 -04:00
George Stephanis 52d4ea822c Extract 'No Rows Selected' string 2015-08-12 12:59:07 -04:00
George Stephanis 973348d6ad Whitespace tidy! 2015-08-12 12:59:06 -04:00
George Stephanis 18293cf365 Extract the autocomplete for states and countries data.
Localize it!
2015-08-12 12:59:06 -04:00
George Stephanis 5d5a64753d Migrate csv columns to localize script. 2015-08-12 12:59:06 -04:00
George Stephanis 39749c4563 Move js in from php template file. 2015-08-12 12:59:06 -04:00
George Stephanis c128e4f826 Change variable name to consistent `$tbody` 2015-08-12 12:59:06 -04:00
George Stephanis a63ef876d7 Rename and tweak how js is registered.
Thanks @claudiosmweb for the suggestion to match existing conventions.
2015-08-12 12:59:06 -04:00
George Stephanis 0ed5f40fa2 Prefix template name with `wc-`
Good call, @mikejolley
2015-08-12 12:59:06 -04:00
George Stephanis a59ed70774 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-12 12:59:06 -04:00
George Stephanis cb4e3cb774 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-12 12:59:05 -04:00
Mike Jolley 817f8476ac Refund subjects when order contains downloadable product. 2015-08-12 17:50:57 +01:00
Mike Jolley 19e8cc4634 display_errors > error_reporting 2015-08-12 17:45:49 +01:00
Mike Jolley 7a58c5417c Only process downloads if valid order is found
Closes #8798
2015-08-12 17:21:07 +01:00
Mike Jolley c1c8a103af Merge remote-tracking branch 'origin/master'
Conflicts:
	readme.txt
2015-08-12 17:08:40 +01:00
Mike Jolley 457283bc3c Ajax variations: stripslashes to fix attributes with quotes. 2015-08-12 17:08:21 +01:00
Claudio Sanches 5aa919d822 Updated changelog 2015-08-12 12:00:28 -03:00
Claudio Sanches ac1986412c Stay on the same page when delete a variation 2015-08-12 11:39:55 -03:00
Mike Jolley a3d376b5c3 Tab hiding with some theme markup.
Closes #8791
2015-08-12 12:05:31 +01:00
Mike Jolley 9986240793 min 2015-08-12 11:51:10 +01:00
Mike Jolley 6a3f4ee969 Disable error_reporting during ajax requests to prevent malformed JSON. 2015-08-12 11:51:05 +01:00