minor fixes

This commit is contained in:
Dro1d.Ru 2018-05-06 17:55:44 +05:00
parent b81e3b22f9
commit 8641b6fc63
4 changed files with 20 additions and 10 deletions

View file

@ -989,14 +989,15 @@
url += 'format=json';
$.post(url, data, zira_auth_popup_response, 'json');
});
if ($('.g-recaptcha').length>0) {
if (typeof zira_auth_popup_response.recaptcha == "undefined") {
if ($('#zira-auth-dialog .g-recaptcha').length>0) {
if (typeof zira_load_recaptcha.loaded == "undefined") {
zira_load_recaptcha();
zira_auth_popup_response.recaptcha = true;
} else {
try {
grecaptcha.render($('.g-recaptcha').get(0));
} catch(e) {}
grecaptcha.render($('#zira-auth-dialog .g-recaptcha').get(0));
} catch(e) {
console.log(e)
}
}
} else if ($('.captcha-refresh-btn').length>0) {
zira_init_captcha();
@ -1299,6 +1300,8 @@
zira_init_captcha = function() {
$('.captcha-refresh-btn').each(function(){
if ($(this).hasClass('jsed')) return true;
$(this).addClass('jsed');
$(this).click(zira_bind(this, function(){
var id = $(this).data('id');
if (typeof id == "undefined") return;
@ -1317,6 +1320,8 @@
zira_load_recaptcha = function() {
if (typeof zira_recaptcha_url == "undefined") return;
if (typeof zira_load_recaptcha.loaded != 'undefined') return;
zira_load_recaptcha.loaded = true;
$('body').append('<script src="'+zira_recaptcha_url+'"></script>');
$('.g-recaptcha').each(function(){

View file

@ -35,9 +35,9 @@ class Submit extends Form {
$html = $this->open();
$html .= $this->hidden('chat_id');
if(!User::isAuthorized()) {
$html .= $this->input(Locale::t('Name'), 'sender_name');
$html .= $this->input(Locale::t('Name'), 'sender_name', array('id'=>'chat-'.intval($this->getValue('chat_id')).'-sender-name'));
} else {
$html .= $this->hidden('sender_name');
$html .= $this->hidden('sender_name', array('id'=>'chat-'.intval($this->getValue('chat_id')).'-sender-name'));
}
$extra_items = \Zira\Hook::run(\Zira\Page::USER_TEXTAREA_HOOK);

View file

@ -338,6 +338,9 @@ class Files extends Window {
'order'=>$this->order,
'root'=>$root
));
$this->setTitle($root);
$title_suffix = '';
if ($this->pages>1) $title_suffix = ' ('.intval($this->page).'/'.intval($this->pages).')';
$this->setTitle($root.$title_suffix);
}
}

View file

@ -380,8 +380,10 @@ class Records extends Window {
$this->setBodyItems($items);
// window title
$title_suffix = '';
if ($this->pages>1) $title_suffix = ' ('.intval($this->page).'/'.intval($this->pages).')';
if (empty($root)) {
$this->setTitle(Zira\Locale::t(self::$_title));
$this->setTitle(Zira\Locale::t(self::$_title).$title_suffix);
} else {
$cats = explode('/',trim($root,'/'));
$_cat = '';
@ -392,7 +394,7 @@ class Records extends Window {
if (!array_key_exists($_cat, $categories)) continue;
$_cats []= Zira\Locale::t($categories[$_cat]);
}
$this->setTitle(Zira\Locale::t(self::$_title).': '.implode(' / ',$_cats));
$this->setTitle(Zira\Locale::t(self::$_title).': '.implode(' / ',$_cats).$title_suffix);
}
// menu