PluginProbe
Booking Calendar / 11.8
Booking Calendar v11.8
11.8.1 11.8 11.7 11.6.1 11.6 11.5 11.4.3 11.4.2 11.4.1 11.4 11.3 11.2.1 11.2 11.1 11.0 10.15.7 10.15.6 10.1.3 10.10 10.10.1 10.10.2 10.11 10.11.2 10.11.3 10.11.4 All 201 releases
booking / includes / page-setup / _src / settings_obj.js

settings_obj.js in Booking Calendar 11.8, at includes/page-setup/_src/settings_obj.js

75 lines 2.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 "use strict";
2 // -----------------------------------------------------------------------------------------------------------------
3 // == Settings Obj ==
4 // -----------------------------------------------------------------------------------------------------------------
5 //TODO: place initial object in other JS file. Later we will use this obj. for all settings pages.
6 /**
7 * Request Object
8 * Here we can define parameters and Update it later, when some parameter was changed
9 *
10 */
11 var _wpbc_settings = (function ( obj, $) {
12
13 // -----------------------------------------------------------------------------------------------------------------
14 // Main Parameters
15 // -----------------------------------------------------------------------------------------------------------------
16 var p_general = obj.general_obj = obj.general_obj || {
17 // sort : "booking_id",
18 // page_num : 1,
19 // create_date : "",
20 // keyword : ""
21 };
22 obj.get_param__general = function ( param_key ) {
23 return p_general[ param_key ];
24 };
25 obj.set_param__general = function ( param_key, param_val ) {
26 p_general[ param_key ] = param_val;
27 };
28 // -------------------------------------------------------------
29 obj.set_all_params__general = function ( request_param_obj ) {
30 p_general = request_param_obj;
31 };
32 obj.get_all_params__general = function () {
33 return p_general;
34 };
35 // -------------------------------------------------------------
36 obj.set_params_arr__general = function( params_arr ){
37 _.each( params_arr, function ( p_val, p_key, p_data ){
38 obj.set_param__general( p_key, p_val );
39 } );
40 }
41
42
43 // -----------------------------------------------------------------------------------------------------------------
44 // Secure parameters for Ajax
45 // -----------------------------------------------------------------------------------------------------------------
46 var p_secure = obj.security_obj = obj.security_obj || {
47 user_id: 0,
48 nonce : '',
49 locale : ''
50 };
51 obj.set_param__secure = function ( param_key, param_val ) {
52 p_secure[ param_key ] = param_val;
53 };
54
55 obj.get_param__secure = function ( param_key ) {
56 return p_secure[ param_key ];
57 };
58
59
60 // -----------------------------------------------------------------------------------------------------------------
61 // Other parameters
62 // -----------------------------------------------------------------------------------------------------------------
63 var p_other = obj.other_obj = obj.other_obj || { };
64
65 obj.set_param__other = function ( param_key, param_val ) {
66 p_other[ param_key ] = param_val;
67 };
68
69 obj.get_param__other = function ( param_key ) {
70 return p_other[ param_key ];
71 };
72
73 return obj;
74 }( _wpbc_settings || {}, jQuery ));
75