1(function(App){ 2 window.App = App = App || {}; 3 4 App.Personal = { 5 6 MENU_ITEM:1, 7 8 block:{ 9 menu:'#personal_menu', 10 }, 11 form:{ 12 profile:'#user_profile' 13 }, 14 selector:{ 15 menuItem:'li:not(.active, .log-out)', 16 birthday:'input[name="PROFILE-UF_BIRTHDAY"]', 17 phone:'input[name="PROFILE-PHONE"]' 18 }, 19 cookie:{ 20 menuItem:'personalMenuItem' 21 }, 22 events: function(){ 23 var _app = App, 24 _this = this; 25 26 $(_this.block.menu).on('click', _this.selector.menuItem, function(){ 27 _this.getTabMenu({object:$(this)}); 28 }); 29 30 $(_this.form.profile).on('click', _this.selector.phone, function () { 31 $(_this.selector.phone).mask("+38 (999) 999-99-99", {placeholder: "+38 (___) ___-__-__"}); 32 }); 33 34 35 36 37 }, 38 init: function(){ 39 var _app = App, 40 _this = this; 41 42 //_app.getLogInit({message:'personal.js init..'}); 43
44 _this.getSelectedTab(); 45 46 _this.getTabMenu({ 47 object:$(_this.block.menu+' li[data-id="'+_this.MENU_ITEM+'"]') 48 }); 49 50 51 _this.getBirthday({ 52 block:$(_this.form.profile).find(_this.selector.birthday) 53 }); 54 55 _this.events(); 56 $(_this.selector.phone).unmask(); 57 58 $('.styler-js').styler(); 59 $('.select-data select').styler(); 60 }, 61 getSelectedTab:function(){ 62 var _this = this, 63 hash = location.hash.slice(1); 64 65 if(+hash > 0){ 66 $.cookie(_this.cookie.menuItem, hash); 67 } 68 if($.cookie(_this.cookie.menuItem)){ 69 return _this.MENU_ITEM = $.cookie(_this.cookie.menuItem); 70 } 71 return _this.MENU_ITEM; 72 }, 73 getTabMenu:function(params){ 74 params.object = params.object || {}; 75 if(!params.object.length) return false; 76 77 params.object 78 .addClass('active') 79 .siblings() 80 .removeClass('active') 81 .parents('.lk-page') 82 .find('.hist-cont-in') 83 .removeClass('active') 84 .eq(params.object.index()) 85 .addClass('active'); 86 87 var _this = this, 88 item = params.object.data().id; 89 90 $.cookie(_this.cookie.menuItem, item); 91 }, 92 getBirthday:function(params){ 93 params.block = params.block || {}; 94 95 if(!params.block.length) return false; 96 let langMonth = { 97 ru:[ 98 'ЯнваÑÑ', 99 'ФевÑалÑ', 100 'ÐаÑÑ', 101 'ÐпÑелÑ', 102 'Ðай', 103 'ÐÑнÑ', 104 'ÐÑлÑ', 105 'ÐвгÑÑÑ', 106 'СенÑÑбÑÑ', 107 'ÐкÑÑбÑÑ', 108 'ÐоÑбÑÑ', 109 'ÐекабÑÑ' 110 ], 111 ua:[ 112 'CÑÑенÑ', 113 'ÐÑÑий', 114 'ÐеÑезенÑ', 115 'ÐвÑÑенÑ', 116 'ТÑавенÑ', 117 'ЧеÑвнÑ', 118 'ÐипенÑ', 119 'СеÑпенÑ', 120 'ÐеÑеÑнÑ', 121 'ÐовÑенÑ', 122 'ÐиÑÑопад', 123 'ÐÑÑденÑ' 124 ], 125 en:[ 126 'January', 127 'February', 128 'March', 129 'April', 130 'May', 131 'June', 132 'July', 133 'August', 134 'September', 135 'October', 136 'November', 137 'December' 138 ], 139 }; 140 let lang = $('meta[name="language_id"]').attr('content'); 141 142 return params.block.bootstrapBirthday({ 143 maxAge:80, 144 minAge:5, 145 monthFormat:'long', 146 dateFormat:'bigEndian', 147 placeholder:true, 148 text: { 149 year:messagesTranslate.year, 150 month:messagesTranslate.month, 151 day:messagesTranslate.day, 152 months:{ 153 long: langMonth[lang] 154 } 155 }, 156 widget: { 157 wrapper: { 158 tag: 'div', 159 class: 'select-data' 160 }, 161 wrapperYear: { 162 use: true, 163 tag: 'div', 164 class: 'one-sel-year' 165 }, 166 wrapperMonth: { 167 use: true, 168 tag: 'div', 169 class: 'one-sel-month' 170 }, 171 wrapperDay: { 172 use: true, 173 tag: 'div', 174 class: 'one-sel-day' 175 }, 176 selectYear: { 177 name: 'birthday[year]', 178 class: '' 179 }, 180 selectMonth: { 181 name: 'birthday[month]', 182 class: '' 183 }, 184 selectDay: { 185 name: 'birthday[day]', 186 class: '' 187 } 188 }, 189 onChange: function(){ 190 console.log($(this)); 191 } 192 }); 193 }, 194 }; 195 196})(window.App); 197 198$(document).ready(function(){ 199 App.Personal.init(); 200});
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.