Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PlanetRed
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Digital Experience Group
PlanetRed
Commits
804a0fe7
Commit
804a0fe7
authored
15 years ago
by
Matthew Juhl
Browse files
Options
Downloads
Patches
Plain Diff
Profile editor awesomeness.
parent
8d93ecad
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
unl_theme/views/default/page_elements/header.php
+334
-9
334 additions, 9 deletions
unl_theme/views/default/page_elements/header.php
with
334 additions
and
9 deletions
unl_theme/views/default/page_elements/header.php
+
334
−
9
View file @
804a0fe7
...
...
@@ -55,7 +55,7 @@ if ($vars['title'] == "Edit profile") {
}
#maincontent
form
.cool
div
.element
{
margin
:
0
;
__
margin
:
0
;
}
#maincontent
form
.cool
label
{
...
...
@@ -85,34 +85,65 @@ if ($vars['title'] == "Edit profile") {
/* SET UP PROFILE EDIT FORM */
// get the dob_year for later use
// get the year and country values for later use
var
dob_year
=
$
(
"
input[name=form_data_profile_dob_year]
"
).
val
();
// remove the text input. will be replacing with a selector
var
from_year
=
$
(
"
input[name=form_data_profile_attended_from]
"
).
val
();
var
to_year
=
$
(
"
input[name=form_data_profile_attended_to]
"
).
val
();
var
home_country
=
$
(
"
input[name=form_data_profile_homecountry]
"
).
val
();
var
home_state
=
$
(
"
input[name=form_data_profile_homestate]
"
).
val
();
var
current_country
=
$
(
"
input[name=form_data_profile_country]
"
).
val
();
var
current_state
=
$
(
"
input[name=form_data_profile_state]
"
).
val
();
// remove the text inputs. will be replacing with selectors
$
(
"
input[name=form_data_profile_dob_year]
"
).
remove
();
// wrap the fields in
<
li
>
s
$
(
"
form.cool label
"
).
wrap
(
"
<li></li>
"
);
$
(
"
form.cool label
"
).
wrap
(
"
<li></li>
"
)
.
addClass
(
"
element
"
)
;
$
(
"
form.cool label br
"
).
remove
();
$
(
"
form.cool p.form-field-description
"
).
each
(
function
(){
$
(
this
).
appendTo
(
$
(
this
).
prev
()).
css
({
marginLeft
:
"
162px
"
,
marginLeft
:
"
164px
"
,
display
:
"
absolute
"
,
marginTop
:
"
33px
"
,
fontSize
:
"
75%
"
,
color
:
"
#1091D1
"
});
});
$
(
"
form.cool fieldset input, form.cool fieldset select
"
).
wrap
(
'
<div class="element"></div>
'
);
$
(
"
form.cool label div
"
).
each
(
function
(){
$
(
this
).
insertAfter
(
$
(
this
).
parent
());
});
// remove the country input
var
country_parent
=
$
(
"
input[name=form_data_profile_country]
"
).
parent
();
$
(
"
input[name=form_data_profile_country]
"
).
remove
();
var
state_parent
=
$
(
"
input[name=form_data_profile_state]
"
).
parent
();
$
(
"
input[name=form_data_profile_state]
"
).
remove
();
var
homecountry_parent
=
$
(
"
input[name=form_data_profile_homecountry]
"
).
parent
();
$
(
"
input[name=form_data_profile_homecountry]
"
).
remove
();
var
homestate_parent
=
$
(
"
input[name=form_data_profile_homestate]
"
).
parent
();
$
(
"
input[name=form_data_profile_homestate]
"
).
remove
();
var
from_parent
=
$
(
"
input[name=form_data_profile_attended_from]
"
).
parent
();
$
(
"
input[name=form_data_profile_attended_from]
"
).
remove
();
var
to_parent
=
$
(
"
input[name=form_data_profile_attended_to]
"
).
parent
();
$
(
"
input[name=form_data_profile_attended_to]
"
).
remove
();
country_parent
.
parent
().
css
(
"
border-bottom
"
,
"
#CCC 1px dotted
"
);
$
(
"
input[name=form_data_profile_city]
"
).
parent
().
parent
().
css
(
"
border-top
"
,
"
#CCC 1px dotted
"
);
/* set up various year inputs */
var
x
=
1900
,
html
=
""
;
var
curYear
=
(
new
Date
()).
getFullYear
();
var
selYear
=
document
.
createElement
(
"
select
"
);
selYear
.
name
=
"
form_data_profile_dob_year
"
;
var
x
=
1900
,
html
=
""
;
while
(
x
++
<
(
new
Date
()).
getFull
Year
()
)
{
while
(
x
++
<
cur
Year
)
{
html
+=
'
<option
'
;
if
(
x
==
dob_year
)
{
html
+=
'
selected="selected"
'
...
...
@@ -122,9 +153,303 @@ if ($vars['title'] == "Edit profile") {
}
selYear
.
innerHTML
=
html
;
var
selFrom
=
document
.
createElement
(
"
select
"
);
selFrom
.
name
=
"
form_data_profile_attended_from
"
;
x
=
1940
;
html
=
""
;
while
(
x
++
<
curYear
+
6
)
{
html
+=
'
<option
'
;
if
(
x
==
from_year
)
{
html
+=
'
selected="selected"
'
}
html
+=
'
>
'
+
x
+
'
</option>
'
;
}
selFrom
.
innerHTML
=
html
;
from_parent
.
append
(
selFrom
);
var
selTo
=
document
.
createElement
(
"
select
"
);
selTo
.
name
=
"
form_data_profile_attended_to
"
;
x
=
1940
;
html
=
""
;
while
(
x
++
<
curYear
+
6
)
{
html
+=
'
<option
'
;
if
(
x
==
to_year
)
{
html
+=
'
selected="selected"
'
}
html
+=
'
>
'
+
x
+
'
</option>
'
;
}
selTo
.
innerHTML
=
html
;
from_parent
.
append
(
"
to
"
);
from_parent
.
append
(
selTo
);
to_parent
.
parent
().
remove
();
var
states
=
[
""
,
"
AL
"
,
"
AK
"
,
"
AS
"
,
"
AZ
"
,
"
AR
"
,
"
CA
"
,
"
CO
"
,
"
CT
"
,
"
DE
"
,
"
DC
"
,
"
FM
"
,
"
FL
"
,
"
GA
"
,
"
GU
"
,
"
HI
"
,
"
ID
"
,
"
IL
"
,
"
IN
"
,
"
IA
"
,
"
KS
"
,
"
KY
"
,
"
LA
"
,
"
ME
"
,
"
MH
"
,
"
MD
"
,
"
MA
"
,
"
MI
"
,
"
MN
"
,
"
MS
"
,
"
MO
"
,
"
MT
"
,
"
NE
"
,
"
NJ
"
,
"
NM
"
,
"
NY
"
,
"
NC
"
,
"
ND
"
,
"
MP
"
,
"
OH
"
,
"
OK
"
,
"
OR
"
,
"
PW
"
,
"
PA
"
,
"
PR
"
,
"
RI
"
,
"
SC
"
,
"
SD
"
,
"
TN
"
,
"
TX
"
,
"
UT
"
,
"
VT
"
,
"
VI
"
,
"
VA
"
,
"
WA
"
,
"
WV
"
,
"
WI
"
,
"
WY
"
];
var
countries
=
[
"
USA
"
,
"
Afghanistan
"
,
"
Albania
"
,
"
Algeria
"
,
"
Andorra
"
,
"
Angola
"
,
"
Antigua and Barbuda
"
,
"
Argentina
"
,
"
Armenia
"
,
"
Australia
"
,
"
Austria
"
,
"
Azerbaijan
"
,
"
Bahamas
"
,
"
Bahrain
"
,
"
Bangladesh
"
,
"
Barbados
"
,
"
Belarus
"
,
"
Belgium
"
,
"
Belize
"
,
"
Benin
"
,
"
Bhutan
"
,
"
Bolivia
"
,
"
Bosnia and Herzegovina
"
,
"
Botswana
"
,
"
Brazil
"
,
"
Brunei
"
,
"
Bulgaria
"
,
"
Burkina Faso
"
,
"
Burundi
"
,
"
Cambodia
"
,
"
Cameroon
"
,
"
Canada
"
,
"
Cape Verde
"
,
"
Central African Republic
"
,
"
Chad
"
,
"
Chile
"
,
"
China
"
,
"
Colombi
"
,
"
Comoros
"
,
"
Congo (Brazzaville)
"
,
"
Congo
"
,
"
Costa Rica
"
,
"
Cote d'Ivoire
"
,
"
Croatia
"
,
"
Cuba
"
,
"
Cyprus
"
,
"
Czech Republic
"
,
"
Denmark
"
,
"
Djibouti
"
,
"
Dominica
"
,
"
Dominican Republic
"
,
"
East Timor (Timor Timur)
"
,
"
Ecuador
"
,
"
Egypt
"
,
"
El Salvador
"
,
"
Equatorial Guinea
"
,
"
Eritrea
"
,
"
Estonia
"
,
"
Ethiopia
"
,
"
Fiji
"
,
"
Finland
"
,
"
France
"
,
"
Gabon
"
,
"
Gambia, The
"
,
"
Georgia
"
,
"
Germany
"
,
"
Ghana
"
,
"
Greece
"
,
"
Grenada
"
,
"
Guatemala
"
,
"
Guinea
"
,
"
Guinea-Bissau
"
,
"
Guyana
"
,
"
Haiti
"
,
"
Honduras
"
,
"
Hungary
"
,
"
Iceland
"
,
"
India
"
,
"
Indonesia
"
,
"
Iran
"
,
"
Iraq
"
,
"
Ireland
"
,
"
Israel
"
,
"
Italy
"
,
"
Jamaica
"
,
"
Japan
"
,
"
Jordan
"
,
"
Kazakhstan
"
,
"
Kenya
"
,
"
Kiribati
"
,
"
Korea, North
"
,
"
Korea, South
"
,
"
Kuwait
"
,
"
Kyrgyzstan
"
,
"
Laos
"
,
"
Latvia
"
,
"
Lebanon
"
,
"
Lesotho
"
,
"
Liberia
"
,
"
Libya
"
,
"
Liechtenstein
"
,
"
Lithuania
"
,
"
Luxembourg
"
,
"
Macedonia
"
,
"
Madagascar
"
,
"
Malawi
"
,
"
Malaysia
"
,
"
Maldives
"
,
"
Mali
"
,
"
Malta
"
,
"
Marshall Islands
"
,
"
Mauritania
"
,
"
Mauritius
"
,
"
Mexico
"
,
"
Micronesia
"
,
"
Moldova
"
,
"
Monaco
"
,
"
Mongolia
"
,
"
Morocco
"
,
"
Mozambique
"
,
"
Myanmar
"
,
"
Namibia
"
,
"
Nauru
"
,
"
Nepa
"
,
"
Netherlands
"
,
"
New Zealand
"
,
"
Nicaragua
"
,
"
Niger
"
,
"
Nigeria
"
,
"
Norway
"
,
"
Oman
"
,
"
Pakistan
"
,
"
Palau
"
,
"
Panama
"
,
"
Papua New Guinea
"
,
"
Paraguay
"
,
"
Peru
"
,
"
Philippines
"
,
"
Poland
"
,
"
Portugal
"
,
"
Qatar
"
,
"
Romania
"
,
"
Russia
"
,
"
Rwanda
"
,
"
Saint Kitts and Nevis
"
,
"
Saint Lucia
"
,
"
Saint Vincent
"
,
"
Samoa
"
,
"
San Marino
"
,
"
Sao Tome and Principe
"
,
"
Saudi Arabia
"
,
"
Senegal
"
,
"
Serbia and Montenegro
"
,
"
Seychelles
"
,
"
Sierra Leone
"
,
"
Singapore
"
,
"
Slovakia
"
,
"
Slovenia
"
,
"
Solomon Islands
"
,
"
Somalia
"
,
"
South Africa
"
,
"
Spain
"
,
"
Sri Lanka
"
,
"
Sudan
"
,
"
Suriname
"
,
"
Swaziland
"
,
"
Sweden
"
,
"
Switzerland
"
,
"
Syria
"
,
"
Taiwan
"
,
"
Tajikistan
"
,
"
Tanzania
"
,
"
Thailand
"
,
"
Togo
"
,
"
Tonga
"
,
"
Trinidad and Tobago
"
,
"
Tunisia
"
,
"
Turkey
"
,
"
Turkmenistan
"
,
"
Tuvalu
"
,
"
Uganda
"
,
"
Ukraine
"
,
"
United Arab Emirates
"
,
"
United Kingdom
"
,
"
Uruguay
"
,
"
Uzbekistan
"
,
"
Vanuatu
"
,
"
Vatican City
"
,
"
Venezuela
"
,
"
Vietnam
"
,
"
Yemen
"
,
"
Zambia
"
,
"
Zimbabwe
"
];
var
selCountry
=
document
.
createElement
(
"
select
"
);
selCountry
.
name
=
"
form_data_profile_country
"
;
html
=
""
;
for
(
var
i
=
0
,
l
=
countries
.
length
;
i
<
l
;
i
++
){
html
+=
'
<option
'
;
if
(
countries
[
i
]
==
current_country
)
{
html
+=
'
selected="selected"
'
}
html
+=
'
>
'
+
countries
[
i
]
+
'
</option>
'
;
}
/*if (current_country == "") {
html += '<option selected="selected" value="">-Select your country-</option>';
}*/
selCountry
.
innerHTML
=
html
;
var
selState
=
document
.
createElement
(
"
select
"
);
selState
.
name
=
"
form_data_profile_state
"
;
html
=
""
;
for
(
var
i
=
0
,
l
=
states
.
length
;
i
<
l
;
i
++
){
html
+=
'
<option
'
;
if
(
states
[
i
]
==
current_state
)
{
html
+=
'
selected="selected"
'
}
html
+=
'
>
'
+
states
[
i
]
+
'
</option>
'
;
}
/*if (current_state == "") {
html += '<option selected="selected" value=""> </option>';
}*/
selState
.
innerHTML
=
html
;
var
selhomeCountry
=
document
.
createElement
(
"
select
"
);
selhomeCountry
.
name
=
"
form_data_profile_homecountry
"
;
html
=
""
;
for
(
var
i
=
0
,
l
=
countries
.
length
;
i
<
l
;
i
++
){
html
+=
'
<option
'
;
if
(
countries
[
i
]
==
home_country
)
{
html
+=
'
selected="selected"
'
}
html
+=
'
>
'
+
countries
[
i
]
+
'
</option>
'
;
}
/*if (home_country == "") {
html += '<option selected="selected" value="">-Select your country-</option>';
}*/
selhomeCountry
.
innerHTML
=
html
;
var
selhomeState
=
document
.
createElement
(
"
select
"
);
selhomeState
.
name
=
"
form_data_profile_homestate
"
;
html
=
""
;
for
(
var
i
=
0
,
l
=
states
.
length
;
i
<
l
;
i
++
){
html
+=
'
<option
'
;
if
(
states
[
i
]
==
home_state
)
{
html
+=
'
selected="selected"
'
}
html
+=
'
>
'
+
states
[
i
]
+
'
</option>
'
;
}
/*if (home_state == "") {
html += '<option selected="selected" value=""> </option>';
}*/
selhomeState
.
innerHTML
=
html
;
$
(
"
select[name=form_data_profile_dob_month]
"
).
parent
().
append
(
selYear
);
$
(
"
select[name=form_data_profile_dob_day]
"
).
insertBefore
(
$
(
"
select[name=form_data_profile_dob_year]
"
));
country_parent
.
append
(
selCountry
);
state_parent
.
append
(
selState
);
homecountry_parent
.
append
(
selhomeCountry
);
homestate_parent
.
append
(
selhomeState
);
$
(
"
select[name=form_data_profile_dob_day]
"
).
insertBefore
(
$
(
"
select[name=form_data_profile_dob_year]
"
));
// don't display the latitude/longitude fields
$
(
"
input[name=form_data_latitude],input[name=form_data_longitude]
"
).
parent
().
parent
().
hide
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment