From 3a9a9e6a1c07c253bfbe6d437d1311497e947086 Mon Sep 17 00:00:00 2001 From: rabuzarus <> Date: Fri, 10 Jun 2016 11:24:38 +0200 Subject: [PATCH 01/32] frio + core: some restructure in profiles.php + frio template for profiles settings --- include/datetime.php | 15 +- mod/profiles.php | 164 ++++----- view/templates/field_input.tpl | 2 +- view/templates/profile_edit.tpl | 214 ++++++----- view/templates/profile_entry.tpl | 16 +- view/templates/profile_listing_header.tpl | 9 +- view/theme/frio/css/style.css | 57 ++- view/theme/frio/templates/field_input.tpl | 2 +- view/theme/frio/templates/field_textarea.tpl | 7 + view/theme/frio/templates/profile_edit.tpl | 331 ++++++++++++++++++ view/theme/frio/templates/profile_entry.tpl | 15 + .../frio/templates/profile_listing_header.tpl | 15 + .../frost-mobile/templates/profile_edit.tpl | 123 ++++--- view/theme/frost/templates/profile_edit.tpl | 123 ++++--- view/theme/vier/templates/profile_edit.tpl | 218 ++++++------ 15 files changed, 855 insertions(+), 456 deletions(-) create mode 100644 view/theme/frio/templates/field_textarea.tpl create mode 100644 view/theme/frio/templates/profile_edit.tpl create mode 100644 view/theme/frio/templates/profile_entry.tpl create mode 100644 view/theme/frio/templates/profile_listing_header.tpl diff --git a/include/datetime.php b/include/datetime.php index 89305a240..e27f54e09 100644 --- a/include/datetime.php +++ b/include/datetime.php @@ -162,7 +162,7 @@ function datetime_convert($from = 'UTC', $to = 'UTC', $s = 'now', $fmt = "Y-m-d * @brief Wrapper for date selector, tailored for use in birthday fields. * * @param string $dob Date of Birth - * @return string + * @return string Formatted html */ function dob($dob) { list($year,$month,$day) = sscanf($dob,'%4d-%2d-%2d'); @@ -175,7 +175,18 @@ function dob($dob) { else $value = (($year) ? datetime_convert('UTC','UTC',$dob,'Y-m-d') : datetime_convert('UTC','UTC',$dob,'m-d')); - $o = ''; + $age = ((intval($value)) ? age($value, $a->user["timezone"], $a->user["timezone"]) : ""); + + $o = replace_macros(get_markup_template("field_input.tpl"), array( + '$field' => array( + 'dob', + t('Birthday:'), + $value, + (((intval($age)) > 0 ) ? t('Age: ') . $age : ""), + '', + 'placeholder="' . t('YYYY-MM-DD or MM-DD') . '"' + ) + )); // if ($dob && $dob != '0000-00-00') // $o = datesel($f,mktime(0,0,0,0,0,1900),mktime(),mktime(0,0,0,$month,$day,$year),'dob'); diff --git a/mod/profiles.php b/mod/profiles.php index 780a279b5..a39fd9598 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -255,7 +255,7 @@ function profiles_post(&$a) { if(count($links)) { foreach($links as $link) { if($link['@attributes']['rel'] === 'http://webfinger.net/rel/profile-page') { - $prf = $link['@attributes']['href']; + $prf = $link['@attributes']['href']; } } } @@ -304,8 +304,8 @@ function profiles_post(&$a) { $sexual = notags(trim($_POST['sexual'])); $homepage = notags(trim($_POST['homepage'])); if ((strpos($homepage, 'http') !== 0) && (strlen($homepage))) { - // neither http nor https in URL, add them - $homepage = 'http://'.$homepage; + // neither http nor https in URL, add them + $homepage = 'http://'.$homepage; } $hometown = notags(trim($_POST['hometown'])); $politic = notags(trim($_POST['politic'])); @@ -663,25 +663,29 @@ function profiles_content(&$a) { '$detailled_profile' => $detailled_profile, '$details' => array( - 'detailled_profile', //Name - t('Show more profile fields:'), //Label - $detailled_profile, //Value - '', //Help string - array(t('No'),t('Yes')) //Off - On strings - ), + 'detailled_profile', //Name + t('Show more profile fields:'), //Label + $detailled_profile, //Value + '', //Help string + array(t('No'),t('Yes')) //Off - On strings + ), + + '$multi_profiles' => feature_enabled(local_user(),'multi_profiles'), + '$form_security_token' => get_form_security_token("profile_edit"), + '$form_security_token_photo' => get_form_security_token("profile_photo"), + '$profile_clone_link' => ((feature_enabled(local_user(),'multi_profiles')) ? 'profiles/clone/' . $r[0]['id'] . '?t=' . get_form_security_token("profile_clone") : ""), + '$profile_drop_link' => 'profiles/drop/' . $r[0]['id'] . '?t=' . get_form_security_token("profile_drop"), + + '$profile_action' => t('Profile Actions'), + '$banner' => t('Edit Profile Details'), + '$submit' => t('Submit'), + '$profpic' => t('Change Profile Photo'), + '$viewprof' => t('View this profile'), + '$editvis' => t('Edit visibility'), + '$cr_prof' => t('Create a new profile using these settings'), + '$cl_prof' => t('Clone this profile'), + '$del_prof' => t('Delete this profile'), - '$multi_profiles' => feature_enabled(local_user(),'multi_profiles'), - '$form_security_token' => get_form_security_token("profile_edit"), - '$form_security_token_photo' => get_form_security_token("profile_photo"), - '$profile_clone_link' => 'profiles/clone/' . $r[0]['id'] . '?t=' . get_form_security_token("profile_clone"), - '$profile_drop_link' => 'profiles/drop/' . $r[0]['id'] . '?t=' . get_form_security_token("profile_drop"), - '$banner' => t('Edit Profile Details'), - '$submit' => t('Submit'), - '$profpic' => t('Change Profile Photo'), - '$viewprof' => t('View this profile'), - '$cr_prof' => t('Create a new profile using these settings'), - '$cl_prof' => t('Clone this profile'), - '$del_prof' => t('Delete this profile'), '$lbl_basic_section' => t('Basic information'), '$lbl_picture_section' => t('Profile picture'), '$lbl_location_section' => t('Location'), @@ -689,81 +693,58 @@ function profiles_content(&$a) { '$lbl_status_section' => t('Status information'), '$lbl_about_section' => t('Additional information'), '$lbl_interests_section' => t('Interests'), + '$lbl_personal_section' => t('Personal'), + '$lbl_relation_section' => t('Relation'), + '$lbl_miscellaneous_section' => t('Miscellaneous'), + '$lbl_profile_photo' => t('Upload Profile Photo'), - '$lbl_profname' => t('Profile Name:'), - '$lbl_fullname' => t('Your Full Name:'), - '$lbl_title' => t('Title/Description:'), '$lbl_gender' => t('Your Gender:'), - '$lbl_bd' => t("Birthday :"), - '$lbl_address' => t('Street Address:'), - '$lbl_city' => t('Locality/City:'), - '$lbl_zip' => t('Postal/Zip Code:'), - '$lbl_country' => t('Country:'), - '$lbl_region' => t('Region/State:'), '$lbl_marital' => t(' Marital Status:'), - '$lbl_with' => t("Who: \x28if applicable\x29"), - '$lbl_ex1' => t('Examples: cathy123, Cathy Williams, cathy@example.com'), - '$lbl_howlong' => t('Since [date]:'), '$lbl_sexual' => t('Sexual Preference:'), - '$lbl_homepage' => t('Homepage URL:'), - '$lbl_hometown' => t('Hometown:'), - '$lbl_politic' => t('Political Views:'), - '$lbl_religion' => t('Religious Views:'), - '$lbl_pubkey' => t('Public Keywords:'), - '$lbl_prvkey' => t('Private Keywords:'), - '$lbl_likes' => t('Likes:'), - '$lbl_dislikes' => t('Dislikes:'), '$lbl_ex2' => t('Example: fishing photography software'), - '$lbl_pubdsc' => t("\x28Used for suggesting potential friends, can be seen by others\x29"), - '$lbl_prvdsc' => t("\x28Used for searching profiles, never shown to others\x29"), - '$lbl_about' => t('Tell us about yourself...'), - '$lbl_hobbies' => t('Hobbies/Interests'), - '$lbl_social' => t('Contact information and Social Networks'), - '$lbl_music' => t('Musical interests'), - '$lbl_book' => t('Books, literature'), - '$lbl_tv' => t('Television'), - '$lbl_film' => t('Film/dance/culture/entertainment'), - '$lbl_love' => t('Love/romance'), - '$lbl_work' => t('Work/employment'), - '$lbl_school' => t('School/education'), + '$disabled' => (($is_default) ? 'onclick="return false;" style="color: #BBBBFF;"' : ''), '$baseurl' => $a->get_baseurl(true), '$profile_id' => $r[0]['id'], - '$profile_name' => $r[0]['profile-name'], + '$profile_name' => array('profile_name', t('Profile Name:'), $r[0]['profile-name'], t('Required'), '*'), + '$is_default' => $is_default, '$default' => (($is_default) ? '

' . t('This is your public profile.
It may be visible to anybody using the internet.') . '

' : ""), - '$name' => $r[0]['name'], - '$pdesc' => $r[0]['pdesc'], + '$name' => array('name', t('Your Full Name:'), $r[0]['name']), + '$pdesc' => array('pdesc', t('Title/Description:'), $r[0]['pdesc']), '$dob' => dob($r[0]['dob']), '$hide_friends' => $hide_friends, - '$address' => $r[0]['address'], - '$locality' => $r[0]['locality'], - '$region' => $r[0]['region'], - '$postal_code' => $r[0]['postal-code'], - '$country_name' => $r[0]['country-name'], + '$address' => array('address', t('Street Address:'), $r[0]['address']), + '$locality' => array('locality', t('Locality/City:'), $r[0]['locality']), + '$region' => array('region', t('Region/State:'), $r[0]['region']), + '$postal_code' => array('postal_code', t('Postal/Zip Code:'), $r[0]['postal-code']), + '$country_name' => array('country_name', t('Country:'), $r[0]['country-name']), '$age' => ((intval($r[0]['dob'])) ? '(' . t('Age: ') . age($r[0]['dob'],$a->user['timezone'],$a->user['timezone']) . ')' : ''), '$gender' => gender_selector($r[0]['gender']), '$marital' => marital_selector($r[0]['marital']), - '$with' => strip_tags($r[0]['with']), - '$howlong' => ($r[0]['howlong'] === '0000-00-00 00:00:00' ? '' : datetime_convert('UTC',date_default_timezone_get(),$r[0]['howlong'])), + '$with' => array('with', t("Who: \x28if applicable\x29"), strip_tags($r[0]['with']), t('Examples: cathy123, Cathy Williams, cathy@example.com')), + '$howlong' => array('howlong', t('Since [date]:'), ($r[0]['howlong'] === '0000-00-00 00:00:00' ? '' : datetime_convert('UTC',date_default_timezone_get(),$r[0]['howlong']))), '$sexual' => sexpref_selector($r[0]['sexual']), - '$about' => $r[0]['about'], - '$homepage' => $r[0]['homepage'], - '$hometown' => $r[0]['hometown'], - '$politic' => $r[0]['politic'], - '$religion' => $r[0]['religion'], - '$pub_keywords' => $r[0]['pub_keywords'], - '$prv_keywords' => $r[0]['prv_keywords'], - '$likes' => $r[0]['likes'], - '$dislikes' => $r[0]['dislikes'], - '$music' => $r[0]['music'], - '$book' => $r[0]['book'], - '$tv' => $r[0]['tv'], - '$film' => $r[0]['film'], - '$interest' => $r[0]['interest'], - '$romance' => $r[0]['romance'], - '$work' => $r[0]['work'], - '$education' => $r[0]['education'], - '$contact' => $r[0]['contact'] + '$about' => array('about', t('Tell us about yourself...'), $r[0]['about']), + '$homepage' => array('homepage', t('Homepage URL:'), $r[0]['homepage']), + '$hometown' => array('hometown', t('Hometown:'), $r[0]['hometown']), + '$politic' => array('politic', t('Political Views:'), $r[0]['politic']), + '$religion' => array('religion', t('Religious Views:'), $r[0]['religion']), + '$pub_keywords' => array('pub_keywords', t('Public Keywords:'), $r[0]['pub_keywords'], t("\x28Used for suggesting potential friends, can be seen by others\x29")), + '$prv_keywords' => array('prv_keywords', t('Private Keywords:'), $r[0]['prv_keywords'], t("\x28Used for searching profiles, never shown to others\x29")), + '$likes' => array('likes', t('Likes:'), $r[0]['likes']), + '$dislikes' => array('dislikes', t('Dislikes:'), $r[0]['dislikes']), + '$music' => array('music', t('Musical interests'), $r[0]['music']), + '$book' => array('book', t('Books, literature'), $r[0]['book']), + '$tv' => array('tv', t('Television'), $r[0]['tv']), + '$film' => array('film', t('Film/dance/culture/entertainment'), $r[0]['film']), + '$interest' => array('interest', t('Hobbies/Interests'), $r[0]['interest']), + '$romance' => array('romance',t('Love/romance'), $r[0]['romance']), + '$work' => array('work', t('Work/employment'), $r[0]['work']), + '$education' => array('education', t('School/education'), $r[0]['education']), + '$contact' => array('contact', t('Contact information and Social Networks'), $r[0]['contact']), + + //eigene + )); $arr = array('profile' => $r[0], 'entry' => $o); @@ -791,19 +772,9 @@ function profiles_content(&$a) { local_user()); if(count($r)) { - $tpl_header = get_markup_template('profile_listing_header.tpl'); - $o .= replace_macros($tpl_header,array( - '$header' => t('Edit/Manage Profiles'), - '$chg_photo' => t('Change profile photo'), - '$cr_new' => t('Create New Profile'), - '$cr_new_link' => 'profiles/new?t=' . get_form_security_token("profile_new") - )); - - $tpl = get_markup_template('profile_entry.tpl'); - foreach($r as $rr) { - $o .= replace_macros($tpl, array( + $profiles .= replace_macros($tpl, array( '$photo' => $a->remove_baseurl($rr['thumb']), '$id' => $rr['id'], '$alt' => t('Profile Image'), @@ -812,6 +783,15 @@ function profiles_content(&$a) { : '' . t('Edit visibility') . '') )); } + + $tpl_header = get_markup_template('profile_listing_header.tpl'); + $o .= replace_macros($tpl_header,array( + '$header' => t('Edit/Manage Profiles'), + '$chg_photo' => t('Change profile photo'), + '$cr_new' => t('Create New Profile'), + '$cr_new_link' => 'profiles/new?t=' . get_form_security_token("profile_new"), + '$profiles' => $profiles + )); } return $o; } diff --git a/view/templates/field_input.tpl b/view/templates/field_input.tpl index 8db8e545f..495493f2f 100644 --- a/view/templates/field_input.tpl +++ b/view/templates/field_input.tpl @@ -1,6 +1,6 @@
- + {{$field.3}}
diff --git a/view/templates/profile_edit.tpl b/view/templates/profile_edit.tpl index 76445685d..4623c77a8 100644 --- a/view/templates/profile_edit.tpl +++ b/view/templates/profile_edit.tpl @@ -24,20 +24,20 @@ {{if $detailled_profile}} {{include file="field_yesno.tpl" field=$details}}
- -
*
+ +
*
- - + +
- - + +
@@ -49,10 +49,7 @@
- -
-{{$dob}} {{$age}} -
+{{$dob}}
@@ -65,45 +62,45 @@
- - + +
- - + +
- - + +
- - +
- +
- - + +
@@ -116,10 +113,10 @@ {{$marital}} - - - - + + + +
@@ -132,33 +129,33 @@
- - + +
- - + +
- - + +
- - -
{{$lbl_pubdsc}}
+ + +
{{$pub_keywords.3}}
- - -
{{$lbl_prvdsc}}
+ + +
{{$prv_keywords.3}}
@@ -169,10 +166,10 @@

-{{$lbl_about}} +{{$about.1}}

- +
@@ -180,10 +177,10 @@

-{{$lbl_hobbies}} +{{$interest.1}}

- +
@@ -191,10 +188,10 @@

-{{$lbl_likes}} +{{$likes.1}}

- +
@@ -202,10 +199,10 @@

-{{$lbl_dislikes}} +{{$dislikes.1}}

- +
@@ -213,10 +210,10 @@

-{{$lbl_social}} +{{$contact.1}}

- +
@@ -230,20 +227,20 @@

-{{$lbl_music}} +{{$music.1}}

- +

-{{$lbl_book}} +{{$book.1}}

- +
@@ -252,10 +249,10 @@

-{{$lbl_tv}} +{{$tv.1}}

- +
@@ -264,10 +261,10 @@

-{{$lbl_film}} +{{$film.1}}

- +
@@ -281,10 +278,10 @@

-{{$lbl_love}} +{{$romance.1}}

- +
@@ -293,10 +290,10 @@

-{{$lbl_work}} +{{$work.1}}

- +
@@ -305,10 +302,10 @@

-{{$lbl_school}} +{{$education.1}}

- +
@@ -325,14 +322,14 @@ {{include file="field_yesno.tpl" field=$details}} {{/if}}
- -
*
+ +
*
- - + +
@@ -344,77 +341,74 @@
- -
-{{$dob}} {{$age}} -
+{{$dob}}
{{/if}}
- - + +
{{$hide_friends}}
- - + +
- - + +
- - + +
- - +
- +
- - -
{{$lbl_pubdsc}}
+ + +
{{$pub_keywords.3}}
- - -
{{$lbl_prvdsc}}
+ + +
{{$prv_keywords.3}}

-{{$lbl_about}} +{{$about.1}}

- +
@@ -424,25 +418,25 @@
- - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + {{/if}} - + diff --git a/view/templates/profile_entry.tpl b/view/templates/profile_entry.tpl index 3b0e88a87..69b39b9b3 100644 --- a/view/templates/profile_entry.tpl +++ b/view/templates/profile_entry.tpl @@ -1,12 +1,12 @@ -
-
-{{$alt}} -
-
-
{{$profile_name}}
-
{{$visible}}
+
+ {{$alt}} +
+
+
+ {{$profile_name}} +
+
{{$visible}}
- diff --git a/view/templates/profile_listing_header.tpl b/view/templates/profile_listing_header.tpl index a0fa1f499..88514c554 100644 --- a/view/templates/profile_listing_header.tpl +++ b/view/templates/profile_listing_header.tpl @@ -1,9 +1,14 @@

{{$header}}

+

-{{$chg_photo}} + {{$chg_photo}}

+ +
+ {{$profiles}} +
diff --git a/view/theme/frio/css/style.css b/view/theme/frio/css/style.css index 0ecb56441..90288ef21 100644 --- a/view/theme/frio/css/style.css +++ b/view/theme/frio/css/style.css @@ -1681,12 +1681,13 @@ ul.dropdown-menu li:hover { /* PAGES */ /* Profile-page */ -#profile-page, .photos-content-wrapper, .settings-content-wrapper, +.generic-page-wrapper ,#profile-page, .settings-content-wrapper, .contacts-content-wrapper, .suggest-content-wrapper, .common-content-wrapper, .allfriends-content-wrapper, .match-content-wrapper, .dirfind-content-wrapper, .directory-content-wrapper, .manage-content-wrapper, .notes-content-wrapper, .events-content-wrapper, .message-content-wrapper, .apps-content-wrapper, -.notifications-content-wrapper, .admin-content-wrapper, .group-content-wrapper { +.notifications-content-wrapper, .admin-content-wrapper, .group-content-wrapper, +.profile_photo-content-wrapper, photos-content-wrapper { min-height: calc(100vh - 150px); padding: 15px; padding-bottom: 20px; @@ -1884,6 +1885,58 @@ ul li:hover .contact-wrapper a.contact-action-link:hover { #poke-wrapper-end { clear: both; } + +/* Profiles Page */ +.profile-listing-table { + display: table; + width: 100%; +} +.profile-listing-row { + display: table-row; +} +.profile-listing-cell { + display: table-cell; +} +.profile-listing-photo { + width: 48px; + height: 48px; + margin: 10px 0px; +} +#profile-listing-new-link-wrapper { + margin-bottom: 20px; +} +.profiles-content-wrapper #profile-edit-wrapper { + margin-left: -15px; + margin-right: -15px; +} +.profiles-content-wrapper #profile-edit-wrapper > .panel { + padding-left: 15px; + padding-right: 15px; +} +.profiles-content-wrapper #profile-photo-upload-section { + display: none; + margin-left: -15px; + margin-right: -15px; + margin-top: 15px; + padding: 15px; +} +#profile-photo-upload-close { + font-size: 14px; +} + +/* Settings */ +.section-subtitle-wrapper { + padding: 1px 10px; +} +.panel .section-subtitle-wrapper a.accordion-toggle:before { + font-family: FontAwesome; + content: "\f0d7"; + padding-right: 5px; +} +.panel .section-subtitle-wrapper a.accordion-toggle.collapsed:before { + font-family: FontAwesome; + content: "\f0da"; +} /* * Overwriting for transparency and other colors */ diff --git a/view/theme/frio/templates/field_input.tpl b/view/theme/frio/templates/field_input.tpl index 181360271..c7b0bbfb2 100644 --- a/view/theme/frio/templates/field_input.tpl +++ b/view/theme/frio/templates/field_input.tpl @@ -1,7 +1,7 @@
- + {{$field.3}}
diff --git a/view/theme/frio/templates/field_textarea.tpl b/view/theme/frio/templates/field_textarea.tpl new file mode 100644 index 000000000..e70e3cbb4 --- /dev/null +++ b/view/theme/frio/templates/field_textarea.tpl @@ -0,0 +1,7 @@ + +
+ + + {{$field.3}} +
+
diff --git a/view/theme/frio/templates/profile_edit.tpl b/view/theme/frio/templates/profile_edit.tpl new file mode 100644 index 000000000..7286611d3 --- /dev/null +++ b/view/theme/frio/templates/profile_edit.tpl @@ -0,0 +1,331 @@ + +
+ {{include file="section_title.tpl" title=$banner}} + + {{* The actions dropdown which can performed to the current profile *}} + + + + +
+ + + +
+ +
+ + +
+ +
+ +
+
+
+
+ + {{* Most of the Variables used below are arrays in the following style + 0 => Some kind of identifier (e.g. for the ID) + 1 => The label description + 2 => The input values + 3 => The additional help text (if available) + *}} + +
+ + + {{* Some hints to characteristics of the current profile (if available) *}} + {{if $is_default}} + + {{/if}} + + {{* friendica differs in $detailled_profile (all fields available and a short Version if this is variable false *}} + {{if $detailled_profile}} +
+ {{* The personal settings *}} +
+ + {{* for the $detailled_profile we use bootstraps collapsable panel-groups to have expandable groups *}} +
+
+ {{include file="field_yesno.tpl" field=$details}} + + {{include file="field_input.tpl" field=$profile_name}} + + {{include file="field_input.tpl" field=$name}} + + {{include file="field_input.tpl" field=$pdesc}} + + +
+ + {{$gender}} +
+
+ + {{$dob}} + + {{$hide_friends}} + +
+ +
+
+
+
+
+ + {{* The location settings *}} +
+ +
+
+ {{include file="field_input.tpl" field=$address}} + + {{include file="field_input.tpl" field=$locality}} + + + {{include file="field_input.tpl" field=$postal_code}} + +
+ + +
+
+ +
+ + +
+
+ + {{include file="field_input.tpl" field=$hometown}} + +
+ +
+
+
+
+
+ + {{* The settings for relations *}} +
+ +
+
+
+ + {{$marital}} +
+
+ + {{include file="field_input.tpl" field=$with}} + + {{include file="field_input.tpl" field=$howlong}} + +
+ + {{$sexual}} +
+
+ +
+ +
+
+
+
+
+ + {{* The miscellanous other settings *}} +
+ +
+
+ {{include file="field_input.tpl" field=$homepage}} + + {{include file="field_input.tpl" field=$pub_keywords}} + + {{include file="field_input.tpl" field=$prv_keywords}} + + {{include file="field_input.tpl" field=$politic}} + + {{include file="field_input.tpl" field=$religion}} + + + {{include file="field_textarea.tpl" field=$about}} + + {{include file="field_textarea.tpl" field=$contact}} + + {{include file="field_textarea.tpl" field=$interest}} + + {{include file="field_textarea.tpl" field=$likes}} + + {{include file="field_textarea.tpl" field=$dislikes}} + + {{include file="field_textarea.tpl" field=$music}} + + {{include file="field_textarea.tpl" field=$book}} + + {{include file="field_textarea.tpl" field=$tv}} + + {{include file="field_textarea.tpl" field=$film}} + + {{include file="field_textarea.tpl" field=$romance}} + + {{include file="field_textarea.tpl" field=$work}} + + {{include file="field_textarea.tpl" field=$education}} + +
+ +
+
+
+
+
+
+ + {{else}} + {{* if $detailled_profile not available a short version of the setting page is displayed *}} + {{if $personal_account}} + {{include file="field_yesno.tpl" field=$details}} + {{/if}} + + {{include file="field_input.tpl" field=$profile_name}} + + {{include file="field_input.tpl" field=$name}} + + {{if $personal_account}} +
+ + {{$gender}} +
+
+ + {{$dob}} + + {{/if}} + + {{include file="field_input.tpl" field=$homepage}} + + {{$hide_friends}} + + {{include file="field_input.tpl" field=$address}} + + {{include file="field_input.tpl" field=$locality}} + + + {{include file="field_input.tpl" field=$postal_code}} + +
+ + +
+
+ +
+ + +
+
+ + {{include file="field_input.tpl" field=$pub_keywords}} + + {{include file="field_input.tpl" field=$prv_keywords}} + + {{include file="field_textarea.tpl" field=$about}} + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + {{/if}} +
+
+ + diff --git a/view/theme/frio/templates/profile_entry.tpl b/view/theme/frio/templates/profile_entry.tpl new file mode 100644 index 000000000..fb5436fb5 --- /dev/null +++ b/view/theme/frio/templates/profile_entry.tpl @@ -0,0 +1,15 @@ + +
+
+ {{$alt}} +
+
+
+ {{$profile_name}} +
+
+ {{$visible}} +
+
+
+ diff --git a/view/theme/frio/templates/profile_listing_header.tpl b/view/theme/frio/templates/profile_listing_header.tpl new file mode 100644 index 000000000..7b612f959 --- /dev/null +++ b/view/theme/frio/templates/profile_listing_header.tpl @@ -0,0 +1,15 @@ + +
+
+

{{$header}}

+
+ +
+ +
+ {{$profiles}} +
+
+
diff --git a/view/theme/frost-mobile/templates/profile_edit.tpl b/view/theme/frost-mobile/templates/profile_edit.tpl index 2855e8fb1..8d7407b09 100644 --- a/view/theme/frost-mobile/templates/profile_edit.tpl +++ b/view/theme/frost-mobile/templates/profile_edit.tpl @@ -21,20 +21,20 @@
- -
*
+ +
*
- - + +
- - + +
@@ -46,10 +46,7 @@
- -
-{{$dob}} {{$age}} -
+{{$dob}}
@@ -62,45 +59,45 @@
- - + +
- - + +
- - + +
- - +
- +
- - + +
@@ -113,10 +110,10 @@ {{$marital}} - - - - + + + +
@@ -129,33 +126,33 @@
- - + +
- - + +
- - + +
- - -
{{$lbl_pubdsc}}
+ + +
{{$pub_keywords.3}}
- - -
{{$lbl_prvdsc}}
+ + +
{{$prv_keywords.3}}
@@ -166,10 +163,10 @@

-{{$lbl_about}} +{{$about.1}}

- +
@@ -177,10 +174,10 @@

-{{$lbl_hobbies}} +{{$interest.1}}

- +
@@ -188,10 +185,10 @@

-{{$lbl_likes}} +{{$likes.1}}

- +
@@ -199,10 +196,10 @@

-{{$lbl_dislikes}} +{{$dislikes.1}}

- +
@@ -210,10 +207,10 @@

-{{$lbl_social}} +{{$contact.1}}

- +
@@ -227,20 +224,20 @@

-{{$lbl_music}} +{{$music.1}}

- +

-{{$lbl_book}} +{{$book.1}}

- +
@@ -249,10 +246,10 @@

-{{$lbl_tv}} +{{$tv.1}}

- +
@@ -261,10 +258,10 @@

-{{$lbl_film}} +{{$film.1}}

- +
@@ -278,10 +275,10 @@

-{{$lbl_love}} +{{$romance.1}}

- +
@@ -290,10 +287,10 @@

-{{$lbl_work}} +{{$work.1}}

- +
@@ -302,10 +299,10 @@

-{{$lbl_school}} +{{$education.1}}

- +
diff --git a/view/theme/frost/templates/profile_edit.tpl b/view/theme/frost/templates/profile_edit.tpl index a7c57c99a..40a3c86a2 100644 --- a/view/theme/frost/templates/profile_edit.tpl +++ b/view/theme/frost/templates/profile_edit.tpl @@ -21,20 +21,20 @@
- -
*
+ +
*
- - + +
- - + +
@@ -46,10 +46,7 @@
- -
-{{$dob}} {{$age}} -
+{{$dob}}
@@ -62,45 +59,45 @@
- - + +
- - + +
- - + +
- - +
- +
- - + +
@@ -113,10 +110,10 @@ {{$marital}} - - - - + + + +
@@ -129,33 +126,33 @@
- - + +
- - + +
- - + +
- - -
{{$lbl_pubdsc}}
+ + +
{{$pub_keywords.3}}
- - -
{{$lbl_prvdsc}}
+ + +
{{$prv_keywords.3}}
@@ -166,10 +163,10 @@

-{{$lbl_about}} +{{$about.1}}

- +
@@ -177,10 +174,10 @@

-{{$lbl_hobbies}} +{{$interest.1}}

- +
@@ -188,10 +185,10 @@

-{{$lbl_likes}} +{{$likes.1}}

- +
@@ -199,10 +196,10 @@

-{{$lbl_dislikes}} +{{$dislikes.1}}

- +
@@ -210,10 +207,10 @@

-{{$lbl_social}} +{{$contact.1}}

- +
@@ -227,20 +224,20 @@

-{{$lbl_music}} +{{$music.1}}

- +

-{{$lbl_book}} +{{$book.1}}

- +
@@ -249,10 +246,10 @@

-{{$lbl_tv}} +{{$tv.1}}

- +
@@ -261,10 +258,10 @@

-{{$lbl_film}} +{{$film.1}}

- +
@@ -278,10 +275,10 @@

-{{$lbl_love}} +{{$romance.1}}

- +
@@ -290,10 +287,10 @@

-{{$lbl_work}} +{{$work.1}}

- +
@@ -302,10 +299,10 @@

-{{$lbl_school}} +{{$education.1}}

- +
diff --git a/view/theme/vier/templates/profile_edit.tpl b/view/theme/vier/templates/profile_edit.tpl index 927041056..fa2cd1857 100644 --- a/view/theme/vier/templates/profile_edit.tpl +++ b/view/theme/vier/templates/profile_edit.tpl @@ -29,7 +29,7 @@
- + {{if $detailled_profile}} @@ -67,17 +67,17 @@ {{if $multi_profiles}}
- -
*
+ +
*
{{else}} - + {{/if}}
- - + +
@@ -88,51 +88,48 @@
- - + +
- - + +
- -
- {{$dob}} {{$age}} -
+ {{$dob}}
{{$hide_friends}}
-
{{$lbl_about}}
- +
{{$about.1}}
+
-
{{$lbl_social}}
- +
{{$contact.1}}
+
- - + +
-
{{$lbl_pubdsc}}
+
{{$pub_keywords.3}}
- - + +
-
{{$lbl_prvdsc}}
+
{{$prv_keywords.3}}
@@ -151,42 +148,42 @@
{{$lbl_location_section}}
- - + +
- - + +
- - + +
- - +
- +
- - + +
@@ -201,26 +198,26 @@
- - + +
- - + +
-
{{$lbl_likes}}
- +
{{$likes.1}}
+
-
{{$lbl_dislikes}}
- +
{{$dislikes.1}}
+
@@ -241,27 +238,27 @@ {{$marital}}
- - - - + + + +
-
{{$lbl_love}}
- +
{{$romance.1}}
+
-
{{$lbl_work}}
- +
{{$work.1}}
+
-
{{$lbl_school}}
- +
{{$education.1}}
+
@@ -279,32 +276,32 @@
{{$pub_keywords.3}}
- - -
{{$lbl_prvdsc}}
+ + +
{{$prv_keywords.3}}

-{{$lbl_about}} +{{$about.1}}

- +
@@ -419,26 +413,26 @@
- - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + {{/if}}
- + From e773da9ea26cc9eefa7daca3d2d7ff6478a8d35f Mon Sep 17 00:00:00 2001 From: rabuzarus <> Date: Fri, 10 Jun 2016 11:29:23 +0200 Subject: [PATCH 02/32] frio + core: forgot to delete a comment --- mod/profiles.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/mod/profiles.php b/mod/profiles.php index a39fd9598..9cd1ed8a0 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -742,9 +742,6 @@ function profiles_content(&$a) { '$work' => array('work', t('Work/employment'), $r[0]['work']), '$education' => array('education', t('School/education'), $r[0]['education']), '$contact' => array('contact', t('Contact information and Social Networks'), $r[0]['contact']), - - //eigene - )); $arr = array('profile' => $r[0], 'entry' => $o); From 53fb8b1181b279e234d60e332fd0b52f8bb5e63e Mon Sep 17 00:00:00 2001 From: rabuzarus <> Date: Sat, 11 Jun 2016 01:28:25 +0200 Subject: [PATCH 03/32] frio: a short contact informations will be provided at the second nav bar by scrolling down (on pages where vcard is available) --- view/theme/frio/css/style.css | 45 +++ .../frameworks/jquery-scrollspy/README.md | 183 ++++++++++++ .../frameworks/jquery-scrollspy/bower.json | 18 ++ .../frameworks/jquery-scrollspy/gulpfile.js | 65 +++++ .../jquery-scrollspy/jquery-scrollspy.js | 267 ++++++++++++++++++ .../jquery-scrollspy/jquery-scrollspy.min.js | 1 + .../frameworks/jquery-scrollspy/package.json | 21 ++ view/theme/frio/js/theme.js | 24 ++ view/theme/frio/templates/head.tpl | 1 + view/theme/frio/templates/nav.tpl | 2 +- view/theme/frio/templates/profile_vcard.tpl | 12 + view/theme/frio/templates/vcard-widget.tpl | 14 + 12 files changed, 652 insertions(+), 1 deletion(-) create mode 100644 view/theme/frio/frameworks/jquery-scrollspy/README.md create mode 100644 view/theme/frio/frameworks/jquery-scrollspy/bower.json create mode 100644 view/theme/frio/frameworks/jquery-scrollspy/gulpfile.js create mode 100644 view/theme/frio/frameworks/jquery-scrollspy/jquery-scrollspy.js create mode 100644 view/theme/frio/frameworks/jquery-scrollspy/jquery-scrollspy.min.js create mode 100644 view/theme/frio/frameworks/jquery-scrollspy/package.json diff --git a/view/theme/frio/css/style.css b/view/theme/frio/css/style.css index 0ecb56441..591b82462 100644 --- a/view/theme/frio/css/style.css +++ b/view/theme/frio/css/style.css @@ -941,6 +941,51 @@ aside .vcard #dfrn-request-link, aside .vcard #wallmessage-link { width: 100%; } +/* vcard-short-info */ +#vcard-short-info, +#nav-short-info .contact-wrapper { + margin-top: 3px; + height: 40px; + white-space: nowrap; + overflow: hidden; + padding-right: 20px; +} +#vcard-short-photo-wrapper img, +#nav-short-info .contact-wrapper img { + height: 34px; + width: 34px; +} +#vcard-short-desc, +#nav-short-info .contact-wrapper .media-body { + display: block; + height: 34px; + width: 100%; + text-overflow: ellipsis; +} +#vcard-short-desc > .media-heading, +#vcard-short-desc > .vcard-short-addr, +#nav-short-info .contact-wrapper .media-heading, +#nav-short-info .contact-wrapper #contact-entry-url-network { + text-overflow: ellipsis; + overflow: hidden; +} +#vcard-short-desc > .media-heading, +#nav-short-info .contact-wrapper .media-heading { + margin-bottom: 1px; + font-weight: bold; +} +#nav-short-info .contact-wrapper .media-heading a { + color: #555; + font-size: 14px !important; +} +#nav-short-info .contact-wrapper #contact-entry-url-network { + color: #777; +} +.network-content-wrapper > #viewcontact_wrapper-network, +#nav-short-info .contact-wrapper .contact-photo-overlay, +#nav-short-info .contact-wrapper .contact-actions{ + display: none +} aside #peoplefind-sidebar input, aside #follow-sidebar input { diff --git a/view/theme/frio/frameworks/jquery-scrollspy/README.md b/view/theme/frio/frameworks/jquery-scrollspy/README.md new file mode 100644 index 000000000..5707f31fe --- /dev/null +++ b/view/theme/frio/frameworks/jquery-scrollspy/README.md @@ -0,0 +1,183 @@ +# NOTE: This is the latest version of ScrollSpy, which includes a ton of bug fixes and efficiency improvements. It's recommended that you use this version for now instead of the official (which hasn't been updated in a while). + +# jQuery-ScrollSpy + +An adaptation of the Mootools Scrollspy (http://davidwalsh.name/mootools-scrollspy) plugin for jQuery + +(c) 2011 Samuel Alexander (https://github.com/sxalexander/jquery-scrollspy) + +(c) 2015 SoftwareSpot + +Released under The MIT License. + +## Description: + +ScrollSpy is a simple jQuery plugin for firing events based on where the user has scrolled to in a page. + +## Homepage: + +https://github.com/softwarespot/jquery-scrollspy + +## Source: + +Hosted at GitHub; browse at: + + https://github.com/softwarespot/jquery-scrollspy/tree/master + +Or clone from: + + git://github.com/softwarespot/jquery-scrollspy.git + +## Usage: + +1. Insert the necessary elements in to your document's `` section, e.g.: + +```html + + +``` + +2. Initialise ScrollSpy once the DOM has been loaded: + +```javascript + +``` + +Check out the /examples for more info ! + +## Documentation: + +ScrollSpy function signature: +```javascript + $('container').scrollspy(options, action) +``` + +Default options for ScrollSpy: +```javascript +// default options for ScrollSpy +var defaults = { + // the offset to be applied to the left and top positions of the container + buffer: 0, + + // the element to apply the 'scrolling' event to (default window) + container: window, + + // the maximum value of the X or Y coordinate, depending on mode the selected + max: 0, + + // the maximum value of the X or Y coordinate, depending on mode the selected + min: 0, + + // whether to listen to the X (horizontal) or Y (vertical) scrolling + mode: 'vertical', + + // namespace to append to the 'scroll' event + namespace: 'scrollspy', + + // call the following callback function every time the user enters the min / max zone + onEnter: null, + + // call the following callback function every time the user leaves the min / max zone + onLeave: null, + + // call the following callback function every time the user leaves the top zone + onLeaveTop: null, + + // call the following callback function every time the user leaves the bottom zone + onLeaveBottom: null, + + // call the following callback function on each scroll event within the min and max parameters + onTick: null, + + // call the following callback function on each scroll event when the element is inside the viewable view port + onView: null +}; +``` + +Events are triggered by ScrollSpy are: + + scrollTick: Fires on each scroll event within the min and max parameters: + position: an object with the current X and Y position. + inside: a Boolean value for whether or not the user is within the min and max parameters + enters: the number of times the min / max has been entered. + leaves: the number of times the min / max has been left. + + scrollEnter: Fires every time the user enters the min / max zone: + position: an object with the current X and Y position. + enters: the number of times the min / max has been entered. + + scrollLeave: Fires every time the user leaves the min / max zone: + position: an object with the current X and Y position. + leaves: the number of times the min / max has been left. + + scrollLeaveTop: Fires every time the user leaves the top zone: + position: an object with the current X and Y position. + leaves: the number of times the min / max has been left. + + scrollLeaveBottom: Fires every time the user leaves the bottom zone: + position: an object with the current X and Y position. + leaves: the number of times the min / max has been left. + + scrollView: Fires every time the element is inside the viewable view port: + position: an object with the current X and Y position. + leaves: the number of times the min / max has been left. + +### Tidy up + +To destroy ScrollSpy for a particular container, simple pass 'destroy' as the action parameter. The only options that will be honoured are `container` and `namespace`. + +## A note about forking: + +By forking this project you hereby grant permission for any commits to your fork to be +merged back into this repository and, with attribution, be released under the terms of +the MIT License. + +## Contribute + +To contribute to the project, you will first need to install [node](https://nodejs.org) globally on your system. Once installation has completed, change the working directory to the plugin's location and run the following command: + +```shell + npm install +``` + +After installation of the local modules, you're ready to start contributing to the project. Before you submit your PR, please don't forget to call `gulp`, which will run against [JSHint](http://jshint.com) for any errors, but will also minify the plugin. + +##### Watch +Call the following command to start 'watching' for any changes to the main JavaScript file(s). This will automatically invoke JSHint and Uglify. +```shell + gulp watch +``` + +##### JSHint +Call the following command to invoke JSHint and check that the changes meet the requirements set in .jshintrc. +```shell + gulp jshint +``` + +##### Uglify +Call the following command to invoke Uglify, which will minify the main JavaScript file(s) and output to a .min.js file respectively. +```shell + gulp uglify +``` + +##### Build +Call the following command to invoke both JSHint and Uglify. +```shell + gulp +``` diff --git a/view/theme/frio/frameworks/jquery-scrollspy/bower.json b/view/theme/frio/frameworks/jquery-scrollspy/bower.json new file mode 100644 index 000000000..8257ebdd8 --- /dev/null +++ b/view/theme/frio/frameworks/jquery-scrollspy/bower.json @@ -0,0 +1,18 @@ +{ + "name": "jquery-scrollspy", + "homepage": "https://github.com/sxalexander/jquery-scrollspy/", + "description": "scrollspy is a simple jQuery plugin for firing events based on where the user has scrolled to in a page.", + "main": "jquery-scrollspy.min.js", + "keywords": [ + "scrolling", + "scroll" + ], + "license": "MIT", + "ignore": [ + ], + "dependencies": { + "jquery": ">=1.7.0" + }, + "devDependencies": { + } +} diff --git a/view/theme/frio/frameworks/jquery-scrollspy/gulpfile.js b/view/theme/frio/frameworks/jquery-scrollspy/gulpfile.js new file mode 100644 index 000000000..4c7563c5d --- /dev/null +++ b/view/theme/frio/frameworks/jquery-scrollspy/gulpfile.js @@ -0,0 +1,65 @@ +/* global require */ + +var gulp = require('gulp'); +var eslint = require('gulp-eslint'); +var gulpIf = require('gulp-if'); +var rename = require('gulp-rename'); +var uglify = require('gulp-uglify'); + +// Assets for the project +var Assets = { + main: './jquery-scrollspy.js', + minified: './jquery-scrollspy.min.js', + package: './package.json', + readme: './README.md', + source: './', +}; + +// See the uglify documentation for more details +var _uglifySettings = { + compress: { + comparisons: true, + conditionals: true, + /* jscs: disable */ + dead_code: true, + drop_console: true, + /* jscs: enable */ + unsafe: true, + unused: true, + }, +}; + +// Check the main js file(s) meets the following standards outlined in .eslintrc +gulp.task('eslint', function esLintTask() { + // Has ESLint fixed the file contents? + function isFixed(file) { + return file.eslint !== undefined && file.eslint !== null && file.eslint.fixed; + } + + return gulp.src(Assets.main) + .pipe(eslint({ + fix: true, + useEslintrc: '.eslintrc', + })) + .pipe(eslint.format()) + .pipe(gulpIf(isFixed, gulp.dest(Assets.source))); +}); + +// Uglify aka minify the main file +gulp.task('uglify', function uglifyTask() { + return gulp.src(Assets.main) + .pipe(uglify(_uglifySettings)) + .pipe(rename(Assets.minified)) + .pipe(gulp.dest(Assets.source)); +}); + +// Watch for changes to the main file +gulp.task('watch', function watchTask() { + gulp.watch(Assets.main, ['eslint', 'uglify']); +}); + +// Register the default task +gulp.task('default', ['eslint', 'uglify']); + +// 'gulp eslint' to check the syntax of the main js file(s) +// 'gulp uglify' to uglify the main file diff --git a/view/theme/frio/frameworks/jquery-scrollspy/jquery-scrollspy.js b/view/theme/frio/frameworks/jquery-scrollspy/jquery-scrollspy.js new file mode 100644 index 000000000..4fd4f53a6 --- /dev/null +++ b/view/theme/frio/frameworks/jquery-scrollspy/jquery-scrollspy.js @@ -0,0 +1,267 @@ +/* + * jQuery ScrollSpy Plugin + * Author: @sxalexander, softwarespot + * Licensed under the MIT license + */ +(function jQueryScrollspy(window, $) { + // Plugin Logic + + $.fn.extend({ + scrollspy: function scrollspy(options, action) { + // If the options parameter is a string, then assume it's an 'action', therefore swap the parameters around + if (_isString(options)) { + var tempOptions = action; + + // Set the action as the option parameter + action = options; + + // Set to be the reference action pointed to + options = tempOptions; + } + + // override the default options with those passed to the plugin + options = $.extend({}, _defaults, options); + + // sanitize the following option with the default value if the predicate fails + _sanitizeOption(options, _defaults, 'container', _isObject); + + // cache the jQuery object + var $container = $(options.container); + + // check if it's a valid jQuery selector + if ($container.length === 0) { + return this; + } + + // sanitize the following option with the default value if the predicate fails + _sanitizeOption(options, _defaults, 'namespace', _isString); + + // check if the action is set to DESTROY/destroy + if (_isString(action) && action.toUpperCase() === 'DESTROY') { + $container.off('scroll.' + options.namespace); + return this; + } + + // sanitize the following options with the default values if the predicates fails + _sanitizeOption(options, _defaults, 'buffer', $.isNumeric); + _sanitizeOption(options, _defaults, 'max', $.isNumeric); + _sanitizeOption(options, _defaults, 'min', $.isNumeric); + + // callbacks + _sanitizeOption(options, _defaults, 'onEnter', $.isFunction); + _sanitizeOption(options, _defaults, 'onLeave', $.isFunction); + _sanitizeOption(options, _defaults, 'onLeaveTop', $.isFunction); + _sanitizeOption(options, _defaults, 'onLeaveBottom', $.isFunction); + _sanitizeOption(options, _defaults, 'onTick', $.isFunction); + + if ($.isFunction(options.max)) { + options.max = options.max(); + } + + if ($.isFunction(options.min)) { + options.min = options.min(); + } + + // check if the mode is set to VERTICAL/vertical + var isVertical = window.String(options.mode).toUpperCase() === 'VERTICAL'; + + return this.each(function each() { + // cache this + var _this = this; + + // cache the jQuery object + var $element = $(_this); + + // count the number of times a container is entered + var enters = 0; + + // determine if the scroll is with inside the container + var inside = false; + + // count the number of times a container is left + var leaves = 0; + + // create a scroll listener for the container + $container.on('scroll.' + options.namespace, function onScroll() { + // cache the jQuery object + var $this = $(this); + + // create a position object literal + var position = { + top: $this.scrollTop(), + left: $this.scrollLeft(), + }; + + var containerHeight = $container.height(); + + var max = options.max; + + var min = options.min; + + var xAndY = isVertical ? position.top + options.buffer : position.left + options.buffer; + + if (max === 0) { + // get the maximum value based on either the height or the outer width + max = isVertical ? containerHeight : $container.outerWidth() + $element.outerWidth(); + } + + // if we have reached the minimum bound, though are below the max + if (xAndY >= min && xAndY <= max) { + // trigger the 'scrollEnter' event + if (!inside) { + inside = true; + enters++; + + // trigger the 'scrollEnter' event + $element.trigger('scrollEnter', { + position: position, + }); + + // call the 'onEnter' function + if (options.onEnter !== null) { + options.onEnter(_this, position); + } + } + + // trigger the 'scrollTick' event + $element.trigger('scrollTick', { + position: position, + inside: inside, + enters: enters, + leaves: leaves, + }); + + // call the 'onTick' function + if (options.onTick !== null) { + options.onTick(_this, position, inside, enters, leaves); + } + } else { + if (inside) { + inside = false; + leaves++; + + // trigger the 'scrollLeave' event + $element.trigger('scrollLeave', { + position: position, + leaves: leaves, + }); + + // call the 'onLeave' function + if (options.onLeave !== null) { + options.onLeave(_this, position); + } + + if (xAndY <= min) { + // trigger the 'scrollLeaveTop' event + $element.trigger('scrollLeaveTop', { + position: position, + leaves: leaves, + }); + + // call the 'onLeaveTop' function + if (options.onLeaveTop !== null) { + options.onLeaveTop(_this, position); + } + } else if (xAndY >= max) { + // trigger the 'scrollLeaveBottom' event + $element.trigger('scrollLeaveBottom', { + position: position, + leaves: leaves, + }); + + // call the 'onLeaveBottom' function + if (options.onLeaveBottom !== null) { + options.onLeaveBottom(_this, position); + } + } + } else { + // Idea taken from: http://stackoverflow.com/questions/5353934/check-if-element-is-visible-on-screen + var containerScrollTop = $container.scrollTop(); + + // Get the element height + var elementHeight = $element.height(); + + // Get the element offset + var elementOffsetTop = $element.offset().top; + + if ((elementOffsetTop < (containerHeight + containerScrollTop)) && (elementOffsetTop > (containerScrollTop - elementHeight))) { + // trigger the 'scrollView' event + $element.trigger('scrollView', { + position: position, + }); + + // call the 'onView' function + if (options.onView !== null) { + options.onView(_this, position); + } + } + } + } + }); + }); + }, + }); + + // Fields (Private) + + // Defaults + + // default options + var _defaults = { + // the offset to be applied to the left and top positions of the container + buffer: 0, + + // the element to apply the 'scrolling' event to (default window) + container: window, + + // the maximum value of the X or Y coordinate, depending on mode the selected + max: 0, + + // the maximum value of the X or Y coordinate, depending on mode the selected + min: 0, + + // whether to listen to the X (horizontal) or Y (vertical) scrolling + mode: 'vertical', + + // namespace to append to the 'scroll' event + namespace: 'scrollspy', + + // call the following callback function every time the user enters the min / max zone + onEnter: null, + + // call the following callback function every time the user leaves the min / max zone + onLeave: null, + + // call the following callback function every time the user leaves the top zone + onLeaveTop: null, + + // call the following callback function every time the user leaves the bottom zone + onLeaveBottom: null, + + // call the following callback function on each scroll event within the min and max parameters + onTick: null, + + // call the following callback function on each scroll event when the element is inside the viewable view port + onView: null, + }; + + // Methods (Private) + + // check if a value is an object datatype + function _isObject(value) { + return $.type(value) === 'object'; + } + + // check if a value is a string datatype with a length greater than zero when whitespace is stripped + function _isString(value) { + return $.type(value) === 'string' && $.trim(value).length > 0; + } + + // check if an option is correctly formatted using a predicate; otherwise, return the default value + function _sanitizeOption(options, defaults, property, predicate) { + // set the property to the default value if the predicate returned false + if (!predicate(options[property])) { + options[property] = defaults[property]; + } + } +}(window, window.jQuery)); diff --git a/view/theme/frio/frameworks/jquery-scrollspy/jquery-scrollspy.min.js b/view/theme/frio/frameworks/jquery-scrollspy/jquery-scrollspy.min.js new file mode 100644 index 000000000..2782536b3 --- /dev/null +++ b/view/theme/frio/frameworks/jquery-scrollspy/jquery-scrollspy.min.js @@ -0,0 +1 @@ +!function(e,n){function o(e){return"object"===n.type(e)}function i(e){return"string"===n.type(e)&&n.trim(e).length>0}function t(e,n,o,i){i(e[o])||(e[o]=n[o])}n.fn.extend({scrollspy:function(l,s){if(i(l)){var a=s;s=l,l=a}l=n.extend({},r,l),t(l,r,"container",o);var c=n(l.container);if(0===c.length)return this;if(t(l,r,"namespace",i),i(s)&&"DESTROY"===s.toUpperCase())return c.off("scroll."+l.namespace),this;t(l,r,"buffer",n.isNumeric),t(l,r,"max",n.isNumeric),t(l,r,"min",n.isNumeric),t(l,r,"onEnter",n.isFunction),t(l,r,"onLeave",n.isFunction),t(l,r,"onLeaveTop",n.isFunction),t(l,r,"onLeaveBottom",n.isFunction),t(l,r,"onTick",n.isFunction),n.isFunction(l.max)&&(l.max=l.max()),n.isFunction(l.min)&&(l.min=l.min());var u="VERTICAL"===e.String(l.mode).toUpperCase();return this.each(function(){var e=this,o=n(e),i=0,t=!1,r=0;c.on("scroll."+l.namespace,function(){var s=n(this),a={top:s.scrollTop(),left:s.scrollLeft()},f=c.height(),p=l.max,m=l.min,v=u?a.top+l.buffer:a.left+l.buffer;if(0===p&&(p=u?f:c.outerWidth()+o.outerWidth()),v>=m&&p>=v)t||(t=!0,i++,o.trigger("scrollEnter",{position:a}),null!==l.onEnter&&l.onEnter(e,a)),o.trigger("scrollTick",{position:a,inside:t,enters:i,leaves:r}),null!==l.onTick&&l.onTick(e,a,t,i,r);else if(t)t=!1,r++,o.trigger("scrollLeave",{position:a,leaves:r}),null!==l.onLeave&&l.onLeave(e,a),m>=v?(o.trigger("scrollLeaveTop",{position:a,leaves:r}),null!==l.onLeaveTop&&l.onLeaveTop(e,a)):v>=p&&(o.trigger("scrollLeaveBottom",{position:a,leaves:r}),null!==l.onLeaveBottom&&l.onLeaveBottom(e,a));else{var g=c.scrollTop(),L=o.height(),h=o.offset().top;f+g>h&&h>g-L&&(o.trigger("scrollView",{position:a}),null!==l.onView&&l.onView(e,a))}})})}});var r={buffer:0,container:e,max:0,min:0,mode:"vertical",namespace:"scrollspy",onEnter:null,onLeave:null,onLeaveTop:null,onLeaveBottom:null,onTick:null,onView:null}}(window,window.jQuery); \ No newline at end of file diff --git a/view/theme/frio/frameworks/jquery-scrollspy/package.json b/view/theme/frio/frameworks/jquery-scrollspy/package.json new file mode 100644 index 000000000..27ca19663 --- /dev/null +++ b/view/theme/frio/frameworks/jquery-scrollspy/package.json @@ -0,0 +1,21 @@ +{ + "name": "jquery-scrollspy", + "version": "1.0.0", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/softwarespot/jquery-scrollspy.git" + }, + "devDependencies": { + "del": "^2.1.0", + "eslint": "^2.5.1", + "eslint-config-airbnb": "^6.2.0", + "gulp": "^3.9.1", + "gulp-eslint": "^2.0.0", + "gulp-if": "^2.0.0", + "gulp-rename": "~1.2.2", + "gulp-replace": "^0.5.4", + "gulp-uglify": "^1.5.3", + "merge2": "^1.0.1" + } +} diff --git a/view/theme/frio/js/theme.js b/view/theme/frio/js/theme.js index 9be1b9456..23c1f096e 100644 --- a/view/theme/frio/js/theme.js +++ b/view/theme/frio/js/theme.js @@ -120,7 +120,31 @@ $(document).ready(function(){ // initialize the bootstrap-select $('.selectpicker').selectpicker(); + // append the vcard-short-info to the second nav after passing the element + // with .p-addr (vcard). Use scrollspy to get the scroll position. + if( $("aside .vcard .p-addr").length) { + $(".vcard .p-addr").scrollspy({ + min: $(".vcard .p-addr").position().top - 50, + onLeaveTop: function onLeave(element) { + $("#vcard-short-info").appendTo("#vcard-short-info-wrapper"); + $("#vcard-short-info").fadeOut(500); + }, + onEnter: function(element) { + $("#vcard-short-info").appendTo("#nav-short-info"); + $("#vcard-short-info").fadeIn(500); + }, + }); + } + + // move the forum contact information of the network page into the second navbar + if( $(".network-content-wrapper > #viewcontact_wrapper-network").length) { + // get the contact-wrapper element and append it to the second nav bar + // Note: We need the first() element with this class since at the present time we + // store also the js template information in the html code and thats why + // there are two elements with this class but we don't want the js template + $(".network-content-wrapper > #viewcontact_wrapper-network .contact-wrapper").first().appendTo("#nav-short-info"); + } }); //function commentOpenUI(obj, id) { // $(document).unbind( "click.commentOpen", handler ); diff --git a/view/theme/frio/templates/head.tpl b/view/theme/frio/templates/head.tpl index afdfaa785..57148736d 100644 --- a/view/theme/frio/templates/head.tpl +++ b/view/theme/frio/templates/head.tpl @@ -73,6 +73,7 @@ + {{* own js files *}} diff --git a/view/theme/frio/templates/nav.tpl b/view/theme/frio/templates/nav.tpl index b8d5b2307..78f1024d3 100644 --- a/view/theme/frio/templates/nav.tpl +++ b/view/theme/frio/templates/nav.tpl @@ -250,7 +250,7 @@ {{* The second navbar which contains nav points of the actual page - (nav points are actual handled by this theme throug js *}}
- +
diff --git a/view/theme/frio/templates/profile_vcard.tpl b/view/theme/frio/templates/profile_vcard.tpl index e0babdc3a..de448b82b 100644 --- a/view/theme/frio/templates/profile_vcard.tpl +++ b/view/theme/frio/templates/profile_vcard.tpl @@ -20,7 +20,19 @@
+ {{* The short information which will appended to the second navbar by scrollspy *}} +
diff --git a/view/theme/frio/templates/vcard-widget.tpl b/view/theme/frio/templates/vcard-widget.tpl index e5aebecc8..472dced2b 100644 --- a/view/theme/frio/templates/vcard-widget.tpl +++ b/view/theme/frio/templates/vcard-widget.tpl @@ -6,6 +6,20 @@
{{$name}}
{{/if}} + {{* The short information which will appended to the second navbar by scrollspy *}} + +
{{$name}}
{{if $addr}}
{{$addr}}
{{/if}} From 3c49a410e58fef7c9296f4662fec55e88e6170e4 Mon Sep 17 00:00:00 2001 From: rabuzarus <> Date: Sat, 11 Jun 2016 01:32:29 +0200 Subject: [PATCH 04/32] frio: a short contact informations - add border-radius to profile picture (this fits better to the rest of the profile pictures) --- view/theme/frio/css/style.css | 1 + 1 file changed, 1 insertion(+) diff --git a/view/theme/frio/css/style.css b/view/theme/frio/css/style.css index 591b82462..54b1e2c4e 100644 --- a/view/theme/frio/css/style.css +++ b/view/theme/frio/css/style.css @@ -954,6 +954,7 @@ aside .vcard #wallmessage-link { #nav-short-info .contact-wrapper img { height: 34px; width: 34px; + border-radius: 3px; } #vcard-short-desc, #nav-short-info .contact-wrapper .media-body { From 70f97a3536d1b0d1183627d51d097c3dacffe775 Mon Sep 17 00:00:00 2001 From: rabuzarus <> Date: Sat, 11 Jun 2016 01:40:28 +0200 Subject: [PATCH 05/32] frio: a short contact informations - better fadeOut handling --- view/theme/frio/js/theme.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/view/theme/frio/js/theme.js b/view/theme/frio/js/theme.js index 23c1f096e..418c233e7 100644 --- a/view/theme/frio/js/theme.js +++ b/view/theme/frio/js/theme.js @@ -126,8 +126,10 @@ $(document).ready(function(){ $(".vcard .p-addr").scrollspy({ min: $(".vcard .p-addr").position().top - 50, onLeaveTop: function onLeave(element) { - $("#vcard-short-info").appendTo("#vcard-short-info-wrapper"); - $("#vcard-short-info").fadeOut(500); + $("#vcard-short-info").fadeOut(500, function () { + $("#vcard-short-info").appendTo("#vcard-short-info-wrapper"); + }); + }, onEnter: function(element) { From 35b6c93ba4c0d1791bcab8c9df478b47191de3f0 Mon Sep 17 00:00:00 2001 From: rabuzarus <> Date: Sat, 11 Jun 2016 10:57:45 +0200 Subject: [PATCH 06/32] reset gitignore --- .gitignore | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..b300f579e --- /dev/null +++ b/.gitignore @@ -0,0 +1,44 @@ +favicon.* +.htconfig.php +.htpreconfig.php +\#* +include/jquery-1.4.2.min.js +*.log +*.out +*.version* +favicon.* +home.html +addon +*~ +robots.txt + +#ignore documentation, it should be newly built +doc/html + +#ignore reports, should be generted with every build +report/ + +#ignore config files from eclipse, we don't want IDE files in our repository +.project +.buildpath +.externalToolBuilders +.settings +#ignore OSX .DS_Store files +.DS_Store + +/nbproject/private/ + +#ignore smarty cache +/view/smarty3/compiled/ + +#ignore cache folders +/privacy_image_cache/ +/photo/ +/proxy/ +nbproject + +#ignore vagrant dir +.vagrant/ + +#ignore local folder +/local/ From c2f116f8fdbf85bcc99cd6a26baa72387d9844ae Mon Sep 17 00:00:00 2001 From: rabuzarus <> Date: Sat, 11 Jun 2016 17:43:02 +0200 Subject: [PATCH 07/32] frio short contact informations - some optical polishing --- view/theme/frio/css/style.css | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/view/theme/frio/css/style.css b/view/theme/frio/css/style.css index 96dae629d..cc667c2b9 100644 --- a/view/theme/frio/css/style.css +++ b/view/theme/frio/css/style.css @@ -947,11 +947,12 @@ aside .vcard #wallmessage-link { /* vcard-short-info */ #vcard-short-info, #nav-short-info .contact-wrapper { - margin-top: 3px; + margin-top: 2px; height: 40px; white-space: nowrap; overflow: hidden; padding-right: 20px; + margin-left: -14px; } #vcard-short-photo-wrapper img, #nav-short-info .contact-wrapper img { @@ -982,8 +983,10 @@ aside .vcard #wallmessage-link { color: #555; font-size: 14px !important; } +#vcard-short-desc > .vcard-short-addr, #nav-short-info .contact-wrapper #contact-entry-url-network { color: #777; + font-size: 12px; } .network-content-wrapper > #viewcontact_wrapper-network, #nav-short-info .contact-wrapper .contact-photo-overlay, From 8ac7575d5b6d3c3176ec7de15894b1176cbf5bd8 Mon Sep 17 00:00:00 2001 From: rabuzarus <> Date: Sat, 11 Jun 2016 18:51:20 +0200 Subject: [PATCH 08/32] frio: closed profile setting sections on page load --- view/theme/frio/templates/profile_edit.tpl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/view/theme/frio/templates/profile_edit.tpl b/view/theme/frio/templates/profile_edit.tpl index 7286611d3..09dfc33f2 100644 --- a/view/theme/frio/templates/profile_edit.tpl +++ b/view/theme/frio/templates/profile_edit.tpl @@ -74,13 +74,13 @@
{{* for the $detailled_profile we use bootstraps collapsable panel-groups to have expandable groups *}} -
+
{{include file="field_yesno.tpl" field=$details}} @@ -113,7 +113,7 @@