1 2/* 3* Title : Pinpoint Booking System WordPress Plugin (PRO) 4* Version : 2.1.2 5* File : assets/js/deposit/frontend-deposit.js 6* File Version : 1.0 7* Created / Last Modified : 08 November 2015 8* Author : Dot on Paper 9* Copyright : © 2012 Dot on Paper 10* Website : http://www.dotonpaper.net 11* Description : Frontend end deposit JavaScript class. 12*/ 13 14var DOPBSPFrontEndDeposit = new function(){ 15 'use strict'; 16 17 /* 18 * Private variables. 19 */ 20 var $ = jQuery.noConflict(); 21 22 /* 23 * Constructor 24 */ 25 this.__construct = function(){ 26 }; 27 28 /* 29 * Get deposit data. 30 * 31 * @param ID (Number): calendar ID 32 * 33 * @retun deposit data 34 */ 35 this.get = function(ID){ 36 var dataDeposit = DOPBSPFrontEnd.calendar[ID]['deposit']['data'], 37 dataWooCommerce = DOPBSPFrontEnd.calendar[ID]['woocommerce']['data'], 38 deposit = {'price': 0, 39 'price_type': 'percent'}; 40 41 if(window.methods_reservation !== undefined) { 42 43 if(window.methods_reservation['pay_full'] === true) { 44 deposit['price'] = 0; 45 deposit['price_type'] = dataDeposit['type']; 46 47 return deposit; 48 } 49 } 50 51 if (dataDeposit['deposit'] !== 0){ 52 deposit['price'] = dataDeposit['deposit']; 53 deposit['price_type'] = dataDeposit['type']; 54 } 55 56 return deposit; 57 }; 58 59 /* 60 * Get deposit value. 61 * 62 * @param ID (Number): calendar ID 63 * @param deposit (Object): deposit data 64 * @param totalPrice (Number): reservation total price 65 * 66 * @retun deposit price value 67 */ 68 this.getPrice = function(ID, 69 deposit, 70 totalPrice){ 71 var dataWooCommerce = DOPBSPFrontEnd.calendar[ID]['woocommerce']['data'], 72 price = 0; 73 74 price += parseFloat(deposit['price']) 75 *(deposit['price_type'] === 'fixed' ? 1:totalPrice)/ 76 (deposit['price_type'] === 'fixed' ? 1:100); 77 78 return price; 79 }; 80 81 /* 82 * Set coupon details. 83 * 84 * @param ID (Number): calendar ID 85 * @param deposit (Object): deposit data 86 * @param totalPrice (Number): reservation total price 87 * 88 * @retun HTML 89 */ 90 this.set = function(ID, 91 deposit, 92 totalPrice){ 93 var HTML = new Array(), 94 price = 0; 95 96 if (deposit['price'] !== 0){ 97 price = DOPBSPFrontEndDeposit.getPrice(ID, 98 deposit, 99 totalPrice); 100 101 HTML.push(' <tr class="dopbsp-deposit">'); 102 HTML.push(' <td class="dopbsp-label">'+DOPBSPFrontEnd.text(ID, 'deposit', 'title')+'</td>'); 103 HTML.push(' <td class="dopbsp-value">'+DOPBSPFrontEnd.setPrice(ID, price)+'</td>'); 104 HTML.push(' </tr>'); 105 } 106 107 return HTML.join(''); 108 }; 109 110 return this.__construct(); 111};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.