Commit Graph

1060 Commits

Author SHA1 Message Date
George Stephanis 0608bcce19 The name resetter should also be run after each render. 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 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 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
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
Claudio Sanches aae3581a28 Minify files for 2.4.2 2015-08-11 14:22:54 -03:00
Mike Jolley 08c751f4fe Minify scripts 2015-08-11 10:46:25 +01:00
Mike Jolley 03f16d6833 Made tab panel selector more specific to avoid theme conflicts. 2015-08-11 10:46:21 +01:00
Claudio Sanches 5e91d27b66 Minify 2015-08-05 16:52:54 -03:00
Claudio Sanches 054dfe0c7b Changed default Underscore's template for wp.template in API Keys 2015-08-05 15:02:55 -03:00
Brent Shepherd 501f0b752f Save product type before saving variations
WooCommerce prior to WC 2.4 saved the product type before any variations were saved because
WC_Meta_Box_Product_Data::save_variations() was called by WC_Meta_Box_Product_Data::save().
However, in WC 2.4 the variations are saved independently of other data about the containing
variable product, including product type. Because the product type hasn't been saved yet,
extensions that need to save their own variation level meta data can't know when saving
variations if the product is of the type they want to act on. They also can't check `$_POST`
to find out when saving variations, because 'product-type' isn't passed to that as it's
variable level meta data, not variation level meta data.

This patch passes the product type along with the variation level meta data when saving variations.
It then uses that to save the product type if the variable product has not yet been saved (and
therefore the product type has never been stored, which means calling get_product() would instantiate
a 'simple' product, as that is the default product type). This can lead to fatal errors if callbacks
expect the product type to be variable and attempt to call methods that only exist on those product
types, like variable_product_sync().

It will also update the product type if it was previously saved but has since changed. This prevents
fatal errors like that mentioned above but caused by switching from one product type, like a simple
product, to another, like a variable product.
2015-07-31 11:42:21 -07:00
Mike Jolley 67788f971d Merge pull request #8696 from franticpsyx/animate-variations-changes
[2.4] Animate variations script DOM modifications
2015-07-31 12:44:18 +01:00
Mike Jolley 82f50cedb0 Allow menu_order sorting like in 2.3
Also allow setting manually to allow sorting between pages.

Fixes #8690
2015-07-31 12:39:23 +01:00
Manos Psychogyiopoulos f5691fd82a animate variations script markup changes 2015-07-31 14:04:55 +03:00
Claudio Sanches b28c6db7f5 Added button to dismiss variation error notices 2015-07-29 19:56:33 -03:00
Claudio Sanches d0e34588aa Updated all .page-selector when change page, closes #8681 2015-07-29 19:25:17 -03:00
Claudio Sanches 8780f2c1ef Fixed chmod to jquery-serializejson 2015-07-29 19:16:27 -03:00
Mike Jolley e3ff9d6e24 Minify 2015-07-28 16:22:00 +01:00
Manos Psychogyiopoulos dae10a962c allow product variations data refresh 2015-07-28 15:34:04 +03:00
Mike Jolley 890bcff302 Fix cart ajax endpoint
@claudiosmweb @BFTrick
2015-07-27 20:02:40 +01:00
Mike Jolley ef5b2007f6 min 2015-07-27 19:03:17 +01:00
Mike Jolley 97bbdb63fa Merge pull request #8663 from roykho/gallery-images
gallery images where not saving
2015-07-27 18:27:00 +01:00
roykho 4203a2cf83 minified file 2015-07-27 10:21:58 -07:00
Claudio Sanches b0ce578541 Show errors for admin ajax variations 2015-07-27 14:16:52 -03:00
roykho 4a8712053f gallery images where not saving 2015-07-27 09:57:21 -07:00
Mike Jolley d0c2c10c47 Made the linter happy 2015-07-27 17:55:37 +01:00
Mike Jolley 0ab151562a Fix issues with trailing slashes on permalinks
Closes #8658
2015-07-27 11:56:07 +01:00
Claudio Sanches f8dfc64db7 Fixed postcode/zip reset in address i18n script, closes #8646 2015-07-24 18:24:33 -03:00
Claudio Sanches 77e8c19330 Minify files for #8631 2015-07-21 20:36:46 -03:00
Brent Shepherd 23418214d0 Trigger do_variation_action + '_ajax_data'
To allow extensions which add their own variation bulk actions to pass
data back to WooCommerce core's handler so that only one ajax call
is necessary for updating the data.

Previously, a duplicate ajax call would be required as trigger() does
not capture the callbacks return value.
2015-07-21 15:41:13 -07:00
Claudio Sanches 791c20ae51 Added param for exclude posts from wc-product-search, closes #8613 2015-07-20 13:41:14 -03:00
Claudio Sanches 5e97a68e3d Fixed calendar when added new variation, closes #8533 2015-07-15 12:26:38 -03:00