1(function ($) { 2 if (!$) return; 3 4 function normalize(value) { 5 return typeof value === 'string' ? value.replace(/\s+/g, ' ').trim() : ''; 6 } 7 8 function enhanceProfile() { 9 var popup = this; 10 if (!popup.querySelector('.cur-profile-popup')) return; 11 12 var dialog = popup.closest('.ui-dialog'); 13 if (!dialog) return; 14 15 $(popup).dialog('option', { draggable: false, resizable: false }); 16 dialog.classList.add('cur-profile-dialog'); 17 var title = dialog.querySelector('.ui-dialog-title'); 18 if (title) title.textContent = 'ÐÑоÑÐ¸Ð»Ñ ÑÑаÑÑника'; 19 20 var close = dialog.querySelector('.ui-dialog-titlebar-close'); 21 if (close) close.setAttribute('aria-label', 'ÐакÑÑÑÑ Ð¿ÑоÑилÑ'); 22 23 var buttonset = dialog.querySelector('.ui-dialog-buttonset'); 24 if (!buttonset) return; 25 26 var actions = [ 27 { label: window.menu_send || 'ÐÑпÑавиÑÑ ÑообÑение', className: 'cur-profile-dialog__message' }, 28 { label: window.menu_profile || 'ÐÑоÑмоÑÑ Ð¿ÑоÑилÑ', className: 'cur-profile-dialog__profile' }, 29 { label: window.menu_uedit || 'ÐдминÑенÑÑ', className: 'cur-profile-dialog__admin' } 30 ]; 31 var buttons = Array.prototype.slice.call(buttonset.querySelectorAll('button')); 32 var ordered = []; 33 34 actions.forEach(function (action) { 35 buttons.forEach(function (button) { 36 if (normalize(button.textContent) === normalize(action.label)) { 37 button.classList.add(action.className); 38 ordered.push(button); 39 } 40 }); 41 }); 42 buttons.forEach(function (button) { 43 if (ordered.indexOf(button) === -1) ordered.push(button); 44 }); 45 ordered.forEach(function (button) { 46 buttonset.appendChild(button); 47 }); 48 } 49 50 $(document).on('dialogcreate.curProfile dialogopen.curProfile', '#dleprofilepopup', enhanceProfile); 51 $('#dleprofilepopup').each(enhanceProfile); 52})(window.jQuery);
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.