Changeset 7267
- Timestamp:
- 06/05/2018 06:27:30 PM (7 years ago)
- Location:
- sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/css/wordcamp-budgets.css
r3859 r7267 53 53 margin-left: 1em; 54 54 margin-bottom: 1em; 55 } 56 57 .wcb-form li > .select2-container { 58 margin-left: 1em; 59 margin-bottom: 1em; 60 } 61 62 .wcb-budget-container .select2-selection { 63 border: none; 64 } 65 66 .select2-currency-dropdown .select2-results { 67 border-bottom: 1px solid #aaa; 55 68 } 56 69 -
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/includes/budget-tool.php
r6067 r7267 87 87 } 88 88 89 public static function enqueue_scripts() { 90 $screen = get_current_screen(); 91 if ( $screen->id == 'toplevel_page_wordcamp-budget' ) { 92 wp_enqueue_script( 'wcb-budget-tool', 93 plugins_url( 'javascript/budget-tool.js', __DIR__ ), 94 array( 'backbone', 'jquery', 'jquery-ui-sortable', 'heartbeat', 'underscore' ), 3 , true ); 95 } 96 } 89 public static function enqueue_scripts() { 90 $screen = get_current_screen(); 91 92 wp_enqueue_script( 'select2' ); 93 wp_enqueue_style( 'select2' ); 94 95 if ( $screen->id == 'toplevel_page_wordcamp-budget' ) { 96 wp_enqueue_script( 'wcb-budget-tool', 97 plugins_url( 'javascript/budget-tool.js', __DIR__ ), 98 array( 'backbone', 'jquery', 'jquery-ui-sortable', 'heartbeat', 'underscore', 'select2' ), 3 , true ); 99 } 100 } 97 101 98 102 private static function _get_budget() { -
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/includes/wordcamp-budgets.php
r6717 r7267 665 665 public static function get_currencies() { 666 666 $currencies = array ( 667 'EUR' => 'European Zone Euro',668 'USD' => 'United States Dollar',669 670 '' => '',671 672 667 'AFN' => 'Afghan Afghani', 673 668 'ALL' => 'Albanian Lek', … … 722 717 'ERN' => 'Eritrean Nakfa', 723 718 'ETB' => 'Ethiopian Birr', 719 'EUR' => 'European Zone Euro', 724 720 'FKP' => 'Falkland Islands Pound', 725 721 'FJD' => 'Fiji Dollar', … … 822 818 'AED' => 'United Arab Emirates Dirham', 823 819 'GBP' => 'United Kingdom Pound Sterling', 820 'USD' => 'United States Dollar', 824 821 'UZS' => 'Uzbekistan Sum', 825 822 'VUV' => 'Vanuatu Vatu', -
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/javascript/budget-tool.js
r4899 r7267 167 167 168 168 initialize: function() { 169 this.model.bind('change', this.render, this);170 169 this.model.bind('destroy', this.remove, this); 171 170 }, … … 229 228 this.$el.toggleClass('is-new', this.model.get('new')); 230 229 this.$el.data('wcb-cid', this.model.cid); 230 231 if( data.name === 'currency' && $.fn.hasOwnProperty( 'select2' ) ){ 232 var currSelect2Box = this.$el.find( 'select' ).select2( { width: '100%' } ); 233 currSelect2Box.data( 'select2' ).$dropdown.addClass( 'select2-currency-dropdown' ); 234 } 235 231 236 return this; 232 237 }, … … 263 268 this.model.set('amount', amount || 0); 264 269 } 265 } 270 this.render.apply( this ); 271 } 266 272 267 273 this.clearSelection.apply(this); 268 this.render.apply(this);269 274 return false; 270 275 }, -
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/javascript/payment-requests.js
r2682 r7267 11 11 try { 12 12 app.registerEventHandlers(); 13 wcb.setupSelect2( '#wcp_general_info select' ); 14 wcb.setupSelect2( '#vendor_country_iso3166' ); 13 15 wcb.attachedFilesView = new wcb.AttachedFilesView( { el: $( '#row-files' ) } ); 14 16 wcb.setupDatePicker( '#wcp_general_info' ); -
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/javascript/reimbursement-requests.js
r2715 r7267 21 21 app.registerEventHandlers(); 22 22 wcb.attachedFilesView = new wcb.AttachedFilesView( { el: $( '#wcbrr_general_information' ) } ); 23 wcb.setupSelect2( '#wcbrr_general_information select' ); 24 wcb.setupSelect2( '#wcbrr-expenses-container select' ); 23 25 } catch ( exception ) { 24 26 wcb.log( exception ); -
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/javascript/sponsor-invoices.js
r3308 r7267 11 11 try { 12 12 app.registerEventHandlers(); 13 wcb.setupSelect2( '#wcbsi_sponsor_invoice select' ); 13 14 $( '#_wcbsi_sponsor_id' ).trigger( 'change' ); // Populate the initial sponsor information 14 15 $( '#wcbsi-sponsor-information' ).removeClass( 'loading-content' ); -
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/javascript/wordcamp-budgets.js
r3105 r7267 251 251 console.log( 'WordCamp Budgets: ', error ); 252 252 } 253 }, 254 255 /** 256 * Setup select2 on select items. 257 * @param {string} selector 258 */ 259 setupSelect2 : function( selector ) { 260 if ( ! $.fn.hasOwnProperty( 'select2' ) ) { 261 return; 262 } 263 264 $( selector ).select2(); 253 265 } 254 266 }; -
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/views/reimbursement-request/metabox-general-information.php
r6067 r7267 43 43 <?php _e( '-- Select a Currency --', 'wordcamporg' ); ?> 44 44 </option> 45 <option value=""></option>46 45 47 46 <?php foreach ( $available_currencies as $currency_key => $currency_name ) : ?> -
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/views/sponsor-invoice/metabox-general.php
r6309 r7267 104 104 <?php _e( '-- Select a Currency --', 'wordcamporg' ); ?> 105 105 </option> 106 <option value=""></option>107 106 108 107 <?php foreach ( $available_currencies as $currency_key => $currency_name ) : ?> -
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/views/sponsor-payment/main.php
r7043 r7267 62 62 <select name="currency"> 63 63 <option value="" disabled selected><?php esc_html_e( 'Select a Currency', 'wordcamporg' ); ?></option> 64 <option value=""></option>65 64 66 65 <?php foreach ( $data['currencies'] as $currency_key => $currency_name ) : ?>
Note: See TracChangeset
for help on using the changeset viewer.