Skip to content
This repository was archived by the owner on Jul 11, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
e006b7e
Cambios Esther
EstherManrique Apr 7, 2020
6d9b8aa
guardando cambios dian
DianyelaMaldonado Apr 7, 2020
f63b0aa
Cambios Vero
verobega Apr 7, 2020
9921c3c
Merge pull request #1 from DianyelaMaldonado/Esther-HU_1-T-2
EstherManrique Apr 7, 2020
7739b35
Merge branch 'dianyela/-development' into Vero-H.U.1-T1
DianyelaMaldonado Apr 7, 2020
bfddeab
Merge pull request #2 from DianyelaMaldonado/Vero-H.U.1-T1
verobega Apr 7, 2020
6bb4790
Merge branch 'dianyela/-development' into dian--HU_1--T3
verobega Apr 7, 2020
6896d5f
Merge pull request #3 from DianyelaMaldonado/dian--HU_1--T3
DianyelaMaldonado Apr 7, 2020
ab9b8fc
changes were made in index.html nav was added with the content of tas…
DianyelaMaldonado Apr 8, 2020
1772a99
Merge branch 'dian--HU_1--T3' of https://github.com/DianyelaMaldonado…
DianyelaMaldonado Apr 8, 2020
18f7b94
merge everything
DianyelaMaldonado Apr 15, 2020
66e8682
Merge pull request #4 from DianyelaMaldonado/dian--HU_1--T3
DianyelaMaldonado Apr 15, 2020
7505222
Add complements colors at style.css and index.html
EstherManrique Apr 15, 2020
0244826
Merge pull request #5 from DianyelaMaldonado/feature/newcolors
EstherManrique Apr 15, 2020
a249a5f
Add style at first mobile ok.
EstherManrique Apr 15, 2020
5dabe31
Finished prototype at index.html and css.
EstherManrique Apr 15, 2020
0a6cb77
Merge pull request #6 from DianyelaMaldonado/feature/newcolors
EstherManrique Apr 15, 2020
8977edd
Added in index.js and added their respective id in index, html; Proof…
DianyelaMaldonado Apr 16, 2020
37186e1
Merge branch 'dianyela/-development' into feature/prueba-register-fir…
DianyelaMaldonado Apr 16, 2020
d05cee9
Merge pull request #7 from DianyelaMaldonado/feature/prueba-register-…
DianyelaMaldonado Apr 16, 2020
6565cc6
add files loginandexit.js register.js in to folder view, information …
DianyelaMaldonado Apr 17, 2020
90fb702
Merge pull request #8 from DianyelaMaldonado/feature/prueba-register-…
DianyelaMaldonado Apr 17, 2020
c09422a
Add proof of concept unfinished
DianyelaMaldonado Apr 19, 2020
1362a03
add more trials about SPA
DianyelaMaldonado Apr 20, 2020
f820e44
More changes about spa. All ok
DianyelaMaldonado Apr 21, 2020
5ba2f14
changes were added in index.html index.js and style.css, the mobile n…
DianyelaMaldonado Apr 21, 2020
4111c69
In index.js changes were added, the iteration that says you do not ha…
DianyelaMaldonado Apr 21, 2020
ac839fb
In index.html and style.css
DianyelaMaldonado Apr 21, 2020
e483196
In index.html he views on both desktop and mobile have been added in …
DianyelaMaldonado Apr 21, 2020
763127c
Add changes index.html
DianyelaMaldonado Apr 21, 2020
5d33905
They adjusted in index.js change regarding functionality. The desktop…
DianyelaMaldonado Apr 21, 2020
c27fd23
SPA and MVC ok
EstherManrique Apr 22, 2020
fbf95bc
localStorage function is ready at posts
verobega Apr 23, 2020
3338740
added images
verobega Apr 24, 2020
23977fa
Added the functionality to post an image in index.js. Comment functio…
DianyelaMaldonado Apr 24, 2020
a941c49
add in style.css new style to image post user
DianyelaMaldonado Apr 24, 2020
07d7d88
add SPA's changes
DianyelaMaldonado Apr 24, 2020
d0e55cb
add changes in index.html index.js style.css new pictures add changes…
DianyelaMaldonado Apr 26, 2020
2eab38d
Obtaining Persistence Data ok
DianyelaMaldonado Apr 27, 2020
33443d3
added post's trials
verobega Apr 28, 2020
d2b2012
readPosts function works
verobega Apr 28, 2020
9817c0e
added editPost function
verobega Apr 28, 2020
b0735ff
add render of view forum changes in index.html index.js and fuorum.js
DianyelaMaldonado Apr 29, 2020
ec7a1e5
add changes render view forum people
DianyelaMaldonado Apr 29, 2020
184ec2b
Save Our life
EstherManrique Apr 29, 2020
5919c2b
MVC and SPA ok
EstherManrique May 1, 2020
15d7661
Add Changes Modules 010520
EstherManrique May 1, 2020
1c0087a
Finished Project
EstherManrique May 2, 2020
41963f4
Merge pull request #9 from DianyelaMaldonado/Ramita-Esther-29-04-20
EstherManrique May 3, 2020
940b146
Last Version 1.0
EstherManrique May 3, 2020
d1f3e5c
Merge pull request #10 from DianyelaMaldonado/Ramita-Esther-29-04-20
EstherManrique May 3, 2020
6c96d0c
Merge pull request #11 from DianyelaMaldonado/dianyela/-development
DianyelaMaldonado May 3, 2020
0a5d73a
Add changes about almost finished
EstherManrique May 4, 2020
49ffc44
Almost finished app 1.1
EstherManrique May 5, 2020
4c177c3
Update Readme.md
DianyelaMaldonado May 6, 2020
a366f84
Update Readme.md
DianyelaMaldonado May 6, 2020
3c92a1e
Update Readme.md
DianyelaMaldonado May 6, 2020
dd865ea
Update Readme.md
DianyelaMaldonado May 6, 2020
38b401c
Update Readme.md
DianyelaMaldonado May 6, 2020
b6f9bd7
Update Readme.md
DianyelaMaldonado May 6, 2020
7ee5f9d
Update Readme.md
DianyelaMaldonado May 6, 2020
507cb0a
Update Readme.md
verobega May 6, 2020
ba54323
Update Readme.md
verobega May 6, 2020
c98e02f
Update Readme.md
verobega May 6, 2020
0f40d83
Update Readme.md
verobega May 6, 2020
eb621c7
Update Readme.md
verobega May 6, 2020
03b1601
Update Readme.md
verobega May 6, 2020
e6f9cbb
Update Readme.md
verobega May 6, 2020
93a2f56
add changes about images
DianyelaMaldonado May 6, 2020
18989ec
Add files via upload
verobega May 6, 2020
86e4dc1
Update Readme.md
verobega May 6, 2020
fe3acba
Update Readme.md
verobega May 6, 2020
af5b8a7
Update Readme.md
verobega May 6, 2020
561c871
Add files via upload
verobega May 6, 2020
f953a8f
Update Readme.md
verobega May 6, 2020
e3ce50e
Update Readme.md
verobega May 7, 2020
565152b
changes about test
DianyelaMaldonado May 7, 2020
3aedb9a
add changes in styles of comments of forum page
DianyelaMaldonado Jul 29, 2020
e7d8396
Update Readme.md
DianyelaMaldonado Jul 30, 2020
7808ab7
add changes in styles responsive
DianyelaMaldonado Sep 17, 2020
b66c1ca
Merge branch 'dianyela/-development' into feature/copy-version-presen…
DianyelaMaldonado Sep 17, 2020
855d314
Merge pull request #12 from DianyelaMaldonado/feature/copy-version-pr…
DianyelaMaldonado Sep 17, 2020
72a6c86
Merge branch 'master' into feature/fixes-in-styles-new-dm
DianyelaMaldonado Sep 17, 2020
7540bba
add changes in some styles
DianyelaMaldonado Sep 17, 2020
d6c94c6
Merge pull request #13 from DianyelaMaldonado/feature/fixes-in-styles…
DianyelaMaldonado Sep 17, 2020
2b42911
Merge branch 'master' into feature/fixes-in-styles-new-dm
DianyelaMaldonado Sep 17, 2020
c34c6de
Merge pull request #14 from DianyelaMaldonado/feature/fixes-in-styles…
DianyelaMaldonado Sep 17, 2020
cd8782e
Merge pull request #15 from DianyelaMaldonado/dianyela/-development
DianyelaMaldonado Sep 17, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
287 changes: 31 additions & 256 deletions Readme.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@
"stylelint": "^10.1.0",
"stylelint-config-recommended": "^2.2.0"
}
}
}
Binary file added prototype/prototipo-actual.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added prototype/prototipo-inicial.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions src/digitalplatform/firebase.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Your web app's Firebase configuration
var firebaseConfig = {
apiKey: "AIzaSyCkfImtzIXqG7KbK3b6Tu3MABA91hPqdFA",
authDomain: "social-network-pruebas.firebaseapp.com",
databaseURL: "https://social-network-pruebas.firebaseio.com",
projectId: "social-network-pruebas",
storageBucket: "social-network-pruebas.appspot.com",
messagingSenderId: "327573056555",
appId: "1:327573056555:web:38bda7ccadbd1fb70c0e6e",
measurementId: "G-ZLRFD83MS0"
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
firebase.analytics();
var db = firebase.firestore()
3 changes: 0 additions & 3 deletions src/example.js

This file was deleted.

38 changes: 38 additions & 0 deletions src/functions/clickmenus.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { viewProfile } from '../view/profile.js';
import { out } from './logout.js';
import { editionOfProfile } from '../view/editprofile.js';
import { viewForum } from '../view/fuorum.js';
import { publicPost, addNewPost } from './publicpoust.js';
import { readPosts } from './readposts.js';
import { editProfileUser } from './editprofile.js';

function clickMenus(obtainingPersistenceData) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Qué pasó aqui con la identación?

let nameMenus = document.querySelectorAll('ul.clickMenu li a');
nameMenus.forEach(function(viewMenus) {
viewMenus.addEventListener('click', function(clickedMenu) {
clickedMenu.preventDefault();
let userClickMenu = clickedMenu.target.dataset.nav;
if (userClickMenu == "/Foro") {
viewForum(obtainingPersistenceData)
.then(function() {
publicPost(obtainingPersistenceData);
readPosts();
});
window.history.pushState('Foro', 'Foro', '/Foro');
} else if (userClickMenu == "/Perfil") {
viewProfile(obtainingPersistenceData);
window.history.pushState('perfil', 'Perfil', '/Perfil');
} else if (userClickMenu == "/editarPerfil") {
editionOfProfile(obtainingPersistenceData)
.then(function() {
editProfileUser(obtainingPersistenceData);
});
window.history.pushState('Editar Perfil', 'Editar Perfil', '/EditarPerfil');
} else if (userClickMenu == "/cerrarSesion") {
out();
};
});
});
};

export { clickMenus }
94 changes: 94 additions & 0 deletions src/functions/editprofile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
import { clickMenus } from './clickmenus.js';
import { viewForum } from '../view/fuorum.js';
import { publicPost, addNewPost } from './publicpoust.js';
import { readPosts } from './readposts.js';


function editProfileUser(user) {
let savesChanges = document.getElementById('saveChangesButton');
let profilePictureInput = document.getElementById('newProfilePhoto'); //aquí pongo en id del input donde voy dar click para entrar a carpeta que muestra imágenes
let imageUrl = ''; //la variable está vacia,porque solamente cuando el usuario mande una imagen y la imagen sea subida a firebase, tendremos solo así el link. En caso de que el usuario ponga una imagen se llenará.

profilePictureInput.onchange = changeProfilePhoto => {
console.log(changeProfilePhoto);

let file = changeProfilePhoto.target.files[0];
firebase.storage().ref("devpost").child(file.name).put(file) //le digo a firebase que voy a ocupar su servicio de storage haciendo referencia a la carpeta devpost y que voy a declarar un hijito como mi file que ya declaramos arriba .name ahí entramos a la propiedad name de file, y luego le decimos quiero poner que es PUT este archivo(file) y es tal cual todo el objeto del archivo
.then(snap => { ///cuando ya sea exitoso snap es el que me va a retornar la respuesta del storage de firebase
return snap.ref.getDownloadURL() //retorname el ref y la url de descarga de mi imagen que acabo de subir a tu servicio, esta url la recibe la siguiente promesa como link
})
.then(link => { //entonces..Si todo exitoso:
console.log(link)
imageUrl = link; //devuelveme la url de esta imagen que subiste
let img = document.getElementById('userPhoto'); //recueparmos la imagen con su id
img.src = imageUrl; //y le decimos que su srrc va ser igual a esa imagen y ya se ve el preview en el circulito
});
};

savesChanges.onclick = function() {

let callName = document.querySelector('#changeName');
let callProfession = document.querySelector('#changeProfession');

let editDataProfile = {
user: callName.value,
job: callProfession.value,
img: imageUrl,
uid: user.uid,
};

addInformationProfileEdit(editDataProfile)
.then(function() {
// Get the existing data
let existing = localStorage.getItem('userdata');
// If no existing data, create an array
// Otherwise, convert the localStorage string to an array
existing = existing ? JSON.parse(existing) : {}; //un objeto vacio en el caso de que no haya para yo llenarlo
// Add new data to localStorage Array
existing['displayName'] = editDataProfile.user;
existing['job'] = editDataProfile.job;
existing['photoURL'] = editDataProfile.img;
// Save back to localStorage
localStorage.setItem('userdata', JSON.stringify(existing));
return existing;
})
.then(function(existing) { //esto es la promesa
console.log('este es el bueno', existing);

alert('se guardaron los datos') //este es el resultado de la promesa
viewForum(existing)
.then(function() {
publicPost(existing);
readPosts();
})
.then(function() {
clickMenus(existing);
updatePostPic(user.uid, imageUrl);
})
})
.catch(err => {
console.log(err) //esto es el error cuando la respuesta es negativa
});
};

};

function addInformationProfileEdit(editDataProfile) {
console.log(editDataProfile);
return firebase.database().ref('users/' + editDataProfile.uid).set(editDataProfile);
}

function updatePostPic(uid, photo) {
return db.collection("pruebas_020520").where("uid", "==", uid)
.get()
.then(function(resultAllPost) {
resultAllPost.forEach(function(post) {
db.collection("pruebas_020520").doc(post.id).update({
photo: photo,
});
});
});

};

export { editProfileUser }
37 changes: 37 additions & 0 deletions src/functions/loginfacebook.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { clickMenus } from './clickmenus.js';
import { viewForum } from '../view/fuorum.js';
import { publicPost, addNewPost } from './publicpoust.js';


//Login with Facebook
function facebookButton() {
let provider = new firebase.auth.FacebookAuthProvider();
let movilIcon = document.getElementById('movilIcon');

firebase.auth().signInWithPopup(provider)
.then(function(data) {
// This gives you a Facebook Access Token. You can use it to access the Facebook API.
let token = data.credential.accessToken;
// The signed-in user info.
let user = data.user;
clickMenus(user);
viewForum(user)
.then(function() {
publicPost();
})
.then(function() {
localStorage.setItem('userdata', JSON.stringify(user));
})
movilIcon.classList.add('shown');
document.getElementById('hideAndShow').style.display = 'block';
})
.catch(function(error) {
console.log(error);
let errorCode = error.code;
let errorMessage = error.message;
let email = error.email;
let credential = error.credential;
});
};

export { facebookButton }
37 changes: 37 additions & 0 deletions src/functions/logingoogle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { clickMenus } from './clickmenus.js';
import { viewForum } from '../view/fuorum.js';
import { publicPost, addNewPost } from './publicpoust.js';


//Login with Google Acount
function googleButton() {
let provider = new firebase.auth.GoogleAuthProvider();
let movilIcon = document.getElementById('movilIcon');

firebase.auth().signInWithPopup(provider)
.then(function(data) {
// This gives you a Google Access Token. You can use it to access the Google API.
let token = data.credential.accessToken;
// The signed-in user info.
let user = data.user;
clickMenus(user);
viewForum(user)
.then(function() {
publicPost();
})
.then(function() {
localStorage.setItem('userdata', JSON.stringify(user));
});
document.getElementById('hideAndShow').style.display = 'block';
movilIcon.classList.add('shown');

})
.catch(function(error) {
let errorCode = error.code;
let errorMessage = error.message;
let email = error.email;
let credential = error.credential;
});
}

export { googleButton }
35 changes: 35 additions & 0 deletions src/functions/loginpageone.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
//Page one Login
import { viewForum } from '../view/fuorum.js';
import { readPosts } from './readposts.js';
import { clickMenus } from './clickmenus.js';
import { publicPost, addNewPost } from './publicpoust.js';

function loginPageOne() {
let email = document.getElementById('email').value;
let pass = document.getElementById('pass').value;
let movilIcon = document.getElementById('movilIcon');
firebase.auth().signInWithEmailAndPassword(email, pass,)
.then((data) => {
clickMenus(data.user);
viewForum(data.user)
.then(function() {
publicPost(data.user);
readPosts();
})
.then(function() {
localStorage.setItem('userdata', JSON.stringify(data.user));
});

document.getElementById('hideAndShow').style.display = 'block';
movilIcon.classList.add('shown');
})
.catch(function(error) {
alert('Los datos ingresados no son correctos');
let errorCode = error.code;
let errorMessage = error.message;
alert(errorMessage);
});
let cred = firebase.auth.EmailAuthProvider.credential(email, pass);
}

export { loginPageOne }
68 changes: 68 additions & 0 deletions src/functions/logout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
//Log out
import { viewLogin } from '../view/login.js';
import { loginPageOne } from './loginpageone.js';
import { viewRegister } from '../view/register.js';
import { register } from './register.js';
import { googleButton } from './logingoogle.js';
import { facebookButton } from './loginfacebook.js';

function out() {
console.log('revisando out');

firebase.auth().signOut()
.then(function() {
document.getElementById('movilIcon').classList.toggle('shown');
document.getElementById('hideAndShow').style.display = 'none';
})
.then(function() {
viewLogin()
.then(function() {
localStorage.setItem('userdata', null);
})
.then(function() {
let buttonLogin = document.querySelector('#doLogin');
buttonLogin.addEventListener('click', function(e) {
e.preventDefault();
loginPageOne();
movilIcon.classList.add('shown');
});
})
.then(function() {
let buttonGoogle = document.querySelector('#loginGoogle');
buttonGoogle.addEventListener('click', function(e) {
e.preventDefault();
googleButton();
});
})
.then(function() {
let buttonFacebook = document.querySelector('#loginFacebook');
buttonFacebook.addEventListener('click', function(e) {
e.preventDefault();
facebookButton();
document.getElementById('hideAndShow').style.display = 'block';
movilIcon.classList.add('shown');
});
})
.then(function() {
let ntAccount = document.querySelector('#reg');
ntAccount.addEventListener('click', function(e) {
e.preventDefault();
viewRegister()
.then(function() {
let buttonReg = document.querySelector('#doRegister');
buttonReg.addEventListener('click', function(e) {
e.preventDefault();
register();
});
});
});
});

window.history.pushState('cerrar sesion', 'cerrar sesion', '/');
})
.catch(function(error) {
console.log(error);
});
};

export { out }
Loading