remotes/origin/1203
pavel 11 years ago
parent ead65c743c
commit 01c9462c0c
  1. 3
      templates/client/includes/accounts/current_user.html
  2. 1
      templates/client/includes/company/company_edit.html
  3. 17
      templates/client/static_client/js/_modules/page.company.js
  4. 54
      templates/client/static_client/js/_modules/page.profile.js
  5. 2
      templates/client/static_client/js_min/_modules/page.company.min.js
  6. 2
      templates/client/static_client/js_min/_modules/page.profile.min.js

@ -538,6 +538,9 @@
noImageSrc:"{% static 'client/img/no-userpic-big.gif' %}", noImageSrc:"{% static 'client/img/no-userpic-big.gif' %}",
// text and paths for dynamically rendered selectboxes // text and paths for dynamically rendered selectboxes
addCompanyButtonId:'add-new-company', addCompanyButtonId:'add-new-company',
companyAddInputMask:'http://expomap.ru/members/',
avatarInputId:"id_avatar",
selectBox:[ selectBox:[
{id:'id_country'}, {id:'id_country'},
{id:'id_theme', {id:'id_theme',

@ -606,6 +606,7 @@
editButtonClass:'e-btn', editButtonClass:'e-btn',
avatarButtonClass:'avatar-btn', avatarButtonClass:'avatar-btn',
avatarImageClass:'user-avatar', avatarImageClass:'user-avatar',
avatarInputId:"id_avatar",
noImageSrc:"{% static 'client/img/no-logo.png' %}", noImageSrc:"{% static 'client/img/no-logo.png' %}",
// text and paths for dynamically rendered selectboxes // text and paths for dynamically rendered selectboxes

@ -369,8 +369,9 @@ if (EXPO.company){
if($avatar.length){ if($avatar.length){
$avatar.attr('src', data.url); $avatar.attr('src', data.url);
this.refreshState();
} }
$('.p-editable').removeClass('pe-current');
} }
}; };
@ -657,6 +658,18 @@ if (EXPO.company){
self.forms[formName].refreshState(); self.forms[formName].refreshState();
return false; return false;
}); });
if($('.'+self.opt.avatarButtonClass).length){
/**
* avatar image choose button
*/
$('.'+self.opt.editButtonClass+','+' .'+self.opt.avatarButtonClass, $wrapper).on('click', function () {
var $input = $('#'+self.opt.avatarInputId);
$input.trigger('click');
return false;
});
}else{
/** /**
* edit button * edit button
*/ */
@ -701,9 +714,11 @@ if (EXPO.company){
return false; return false;
}); });
}
}); });
}); });
}; };

@ -363,8 +363,9 @@ if (EXPO.profile){
if($avatar.length){ if($avatar.length){
$avatar.attr('src', data.url); $avatar.attr('src', data.url);
this.refreshState();
} }
$('.p-editable').removeClass('pe-current');
} }
}; };
@ -468,7 +469,8 @@ if (EXPO.profile){
$(function () { $(function () {
var $editables = $('.'+self.opt.editableClass), var $editables = $('.'+self.opt.editableClass),
$country = $('#'+self.opt.selectBox[0].id), $country = $('#'+self.opt.selectBox[0].id),
$city = $('#'+self.opt.selectBox[2].id); $city = $('#'+self.opt.selectBox[2].id),
$companyUrl = $("#id_url");
$waiter = $('#wait-ajax').css({'z-index': '8012'}); $waiter = $('#wait-ajax').css({'z-index': '8012'});
/** /**
@ -627,6 +629,17 @@ if (EXPO.profile){
self.forms[formName].refreshState(); self.forms[formName].refreshState();
return false; return false;
}); });
if($('.'+self.opt.avatarButtonClass).length){
/**
* avatar image choose button
*/
$('.'+self.opt.editButtonClass+','+' .'+self.opt.avatarButtonClass, $wrapper).on('click', function () {
var $input = $('#'+self.opt.avatarInputId);
$input.trigger('click');
return false;
});
}else{
/** /**
* edit button * edit button
*/ */
@ -645,7 +658,7 @@ if (EXPO.profile){
if(self.forms[formId].refrashable){ if(self.forms[formId].refrashable){
self.forms[formId].refreshState(); self.forms[formId].refreshState();
$editable.removeClass(EXPO.profile.opt.formCurrentClass); $editable.removeClass(EXPO.company.opt.formCurrentClass);
}else{ }else{
$editable.removeClass(self.opt.formCurrentClass); $editable.removeClass(self.opt.formCurrentClass);
} }
@ -671,6 +684,7 @@ if (EXPO.profile){
return false; return false;
}); });
}
}); });
@ -682,7 +696,41 @@ if (EXPO.profile){
$.fancybox.open('#'+ self.opt.addCompany.modalId); $.fancybox.open('#'+ self.opt.addCompany.modalId);
return false; return false;
}); });
/**
* add company url placeholder
*/
$companyUrl.on('focus', function () {
var $this = $(this),
placeholder = self.opt.companyAddInputMask;
if($.trim($this.val()) == ''){
$this.val(placeholder);
}
return false;
});
$companyUrl.on('click', function () {
if (this.setSelectionRange && $.trim($(this).val()) == self.opt.companyAddInputMask){
var len = $(this).val().length;
this.setSelectionRange(len, len);
}
});
$companyUrl.on('keypress', function () {
var $this = $(this),
placeholder = self.opt.companyAddInputMask;
if($.trim($this.val()) == ''){
$this.val(placeholder);
}
});
$companyUrl.on('blur', function () {
var $this = $(this),
placeholder = self.opt.companyAddInputMask;
if($.trim($this.val()) == placeholder){
$this.val('');
}
});
}); });

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save