Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 2449 | Rev 4069 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 www 1
<?php
2
 
3
$this->inlineScript()->appendFile('https://maps.googleapis.com/maps/api/js?key=' . $google_map_key . '&libraries=places');
4
 
5
// months
6
$months = [
7
  'LABEL_MONTH_JANUARY',
8
  'LABEL_MONTH_FEBRUARY',
9
  'LABEL_MONTH_MARCH',
10
  'LABEL_MONTH_APRIL',
11
  'LABEL_MONTH_MAY',
12
  'LABEL_MONTH_JUNE',
13
  'LABEL_MONTH_JULY',
14
  'LABEL_MONTH_AUGUST',
15
  'LABEL_MONTH_SEPTEMBER',
16
  'LABEL_MONTH_OCTOBER',
17
  'LABEL_MONTH_NOVEMBER',
18
  'LABEL_MONTH_DECEMBER',
19
];
20
 
21
// vars to json
22
$userExperiences = json_encode($user_experiences);
23
$userEducations = json_encode($user_educations);
24
$monthsJson = json_encode($months);
25
$userLanguages = json_encode($user_languages);
26
$userSkills = json_encode($user_skills);
27
$companySizesOptions = json_encode($company_sizes);
28
$degreesOptions = json_encode($degrees);
29
$industriesOptions = json_encode($industries);
30
$languagesOptions = json_encode($languages);
31
$skillsOptions = json_encode($skills);
3912 efrain 32
$userAptitudes = json_encode($user_aptitudes);
33
$userHobbiesAndInterests = json_encode($user_hobbies_and_interests);
34
$aptitudesOptions = json_encode($aptitudes);
35
$hobbiesAndInterestsOptions = json_encode($hobbies_and_interests);
36
 
1 www 37
$googleMapPlacesUrl = 'https://maps.googleapis.com/maps/api/js?key=' . $google_map_key . '&libraries=places';
38
$error_msg = "Por favor seleccione una ubicación real";
39
 
40
 
41
 
42
$js = <<<JS
43
 
44
 
45
// autoComplete place
46
let autoComplete;
47
 
48
function handleScriptLoad(updateQuery, autoCompleteRef, setAddresObject, setError) {
49
  autoComplete = new window.google.maps.places.Autocomplete(
50
    autoCompleteRef.current,
51
    { types: ["(cities)"]}
52
  );
53
  autoComplete.setFields(["address_components", "formatted_address", "geometry"]);
54
  autoComplete.addListener("place_changed", () =>
55
    handlePlaceSelect(updateQuery, setAddresObject, setError)
56
  );
57
}
58
 
59
async function handlePlaceSelect(updateQuery, setAddresObject, setError) {
60
  const addressObject = autoComplete.getPlace();
61
  // console.log(addressObject.geometry.location.lat());
62
  // console.log(addressObject.geometry.location.lng());
63
  const query = addressObject.formatted_address;
64
  if(query){
65
    setError("");
66
    updateQuery(query);
67
    setAddresObject({...addressObject, address_components:[...addressObject.address_components, {latitude: addressObject.geometry.location.lat(),longitude: addressObject.geometry.location.lng(), types:["geometry"]}]});
68
  }else{
69
    setError("$error_msg");
70
  }
71
}
72
 
73
const backendVars = {
74
  userIdEncrypted:"$user_uuid",
75
  userProfileIdEncrypted:"$user_profile_uuid",
76
  cover:"$cover",
77
  following:"$following",
78
  follower:"$follower",
79
  image:"$image",
80
  facebook: "$facebook",
81
  twitter: "$twitter",
82
  instagram: "$instagram",
83
  fullName: `$full_name`,
84
  overview: `$overview`,
85
  userExperiences: JSON.parse('$userExperiences'),
86
  userEducations: JSON.parse('$userEducations'),
87
  months: JSON.parse('$monthsJson'),
88
  formattedAddress: "$formatted_address",
89
  userLanguages: JSON.parse('$userLanguages'),
90
  userSkills: JSON.parse('$userSkills'),
3912 efrain 91
  userAptitudes: JSON.parse('$userAptitudes'),
92
  userHobbiesAndInterests: JSON.parse('$userHobbiesAndInterests'),
1 www 93
  imageSizeCover: "$image_size_cover",
94
  imageProfileCover: "$image_size_profile",
95
  companySizesOptions: JSON.parse('$companySizesOptions'),
96
  degreesOptions: JSON.parse('$degreesOptions'),
97
  industriesOptions: JSON.parse('$industriesOptions'),
98
  // industriesOptions: [],
99
  newIndustrisOptions: JSON.parse('$industriesOptions'),
100
  languagesOptions: JSON.parse('$languagesOptions'),
101
  skillsOptions: JSON.parse('$skillsOptions'),
3912 efrain 102
  aptitudesOptions: JSON.parse('$aptitudesOptions'),
103
  hobbiesAndInterestsOptions: JSON.parse('$hobbiesAndInterestsOptions'),
104
 
105
 
1 www 106
}
107
JS;
108
$this->inlineScript()->appendScript($js);
2449 stevensc 109
$this->headLink()->appendStylesheet('/react-bundles/profile/edit/main.css');
1 www 110
$this->inlineScript()->appendFile('/react-bundles/profile/edit/profileEditBundle.js');
111
?>
112
 
113
 
114
<div id="react-my-profile-edit">
115
  <div class="process-comm" id="paginator-process-comm">
116
    <div class="spinner">
117
      <div class="bounce1"></div>
118
      <div class="bounce2"></div>
119
      <div class="bounce3"></div>
120
    </div>
121
  </div>
122
</div>
123
<script src="https://cdn.ckeditor.com/4.16.0/standard/ckeditor.js"></script>