Skip to content

Commit

Permalink
Versión 2.6.0
Browse files Browse the repository at this point in the history
Se reemplazó la Cookie por localStorage
  • Loading branch information
catedracosgaya committed May 6, 2018
1 parent b9f24dc commit 962b743
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 22 deletions.
2 changes: 1 addition & 1 deletion LICENSE.md
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2014-2016 Catedra Cosgaya
Copyright (c) 2014-2018 Catedra Cosgaya

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
7 changes: 5 additions & 2 deletions README.md
Expand Up @@ -2,7 +2,10 @@
Aplicación para desarrollar el sentido de ritmo y espaciado a través de figuras geométricas de peso óptico compensado.
El objetivo es componer un bloque de color homogéneo compuesto al menos de 4 líneas.

**Versión: 2.5.0 - (04/04/2016)**
**Versión: 2.6.0 - (06/04/2018)**

## Aplicación en línea
http://www.catedracosgaya.com.ar/espaciado/figuras/

## Aplicación en línea
http://www.catedracosgaya.com.ar/espaciado/figuras/
Expand All @@ -20,7 +23,7 @@ Facebook: www.facebook.com/catedracosgaya
Twitter: www.twitter.com/catedracosgaya

##### Licencia de la aplicación
[Está aplicación está disponible bajo la licencia MIT - Copyright (c) 2014-2016 Catedra Cosgaya.](LICENSE.md)
[Está aplicación está disponible bajo la licencia MIT - Copyright (c) 2014-2018 Catedra Cosgaya.](LICENSE.md)

##### Licencia del trabajo práctico
[Esta obra está bajo una licencia de Creative Commons Reconocimiento-CompartirIgual 4.0 Internacional.](http://creativecommons.org/licenses/by-sa/4.0/deed.es)
Expand Down
6 changes: 3 additions & 3 deletions index.html
Expand Up @@ -44,7 +44,7 @@
</nav>
</div>

<div id="pie">Cátedra Cosgaya | Aplicación | Sensibilización a la forma y al ritmo | Año 2016</div>
<div id="pie">Cátedra Cosgaya | Aplicación | Sensibilización a la forma y al ritmo | Año 2018</div>
</div>


Expand Down Expand Up @@ -95,7 +95,7 @@ <h2>Atención</h2>
<h2>Información</h2>

<article class="info-introduccion">
<p><strong>Versión actual:</strong> 2.5.0 - (04/04/2016)</p>
<p><strong>Versión actual:</strong> 2.6.0 - (06/04/2018)</p>
<p><strong>Elaboración ejercicio:</strong> Cuerpo docente de la Cátedra Cosgaya.</p>
<p><strong>Desarrollo versión 2014:</strong> Alejandro Sánchez Menéndez</p>
<p><strong>Desarrollo versión 2002:</strong> Leonardo Spinetto</p>
Expand All @@ -104,7 +104,7 @@ <h2>Información</h2>

<article class="info-licencia">
<h3>Licencia de la aplicación</h3>
<p><a href="LICENSE.md" target="_blank">Está aplicación está disponible bajo la licencia MIT - <span class="sincorte">Copyright (c) 2014-2016 Cátedra Cosgaya.</span></a></p>
<p><a href="LICENSE.md" target="_blank">Está aplicación está disponible bajo la licencia MIT - <span class="sincorte">Copyright (c) 2014-2018 Cátedra Cosgaya.</span></a></p>

<h3>Licencia del trabajo práctico</h3>
<p><a href="http://creativecommons.org/licenses/by-sa/4.0/deed.es" target="_blank">Esta obra está bajo una licencia de Creative Commons Reconocimiento-CompartirIgual 4.0 Internacional.</a></p>
Expand Down
79 changes: 63 additions & 16 deletions js/main.js
Expand Up @@ -8,6 +8,25 @@ $.removeCookie('tp_figuras_v220');
var Cookie_Nombre = "tp_figuras_v250";


/* localStorage borrar anteriores ------------------------------------------ */
localStorage.removeItem('tp_figuras_v250');


/* localStorage Nuevo Nombre ----------------------------------------------- */
var localStorage_Nombre = "cc_ap_figuras_v260";


/* localStorage detector --------------------------------------------------- */
if (JSON.parse(localStorage.getItem(localStorage_Nombre)) === null || JSON.parse(localStorage.getItem(localStorage_Nombre)) === "" || JSON.parse(localStorage.getItem(localStorage_Nombre)) === "null" || JSON.parse(localStorage.getItem(localStorage_Nombre)) === undefined){
/* No localStorage */
var localStorageEstado = "no";
} else {
var localStorageEstado = "si";
}





/* Detector de Internet Explorer ------------------------------------ */
var Detector_IE = !!navigator.userAgent.match(/Trident/);
Expand Down Expand Up @@ -64,13 +83,17 @@ $(document).ready(function(){
var JS_hoja_Alto = Pantalla_Alto;
}

if ($.cookie('tp_figuras_ajuste') === null || $.cookie('tp_figuras_ajuste') === "" || $.cookie('tp_figuras_ajuste') === "null" || $.cookie('tp_figuras_ajuste') === undefined){

var JS_hoja_Ancho = CSS_hoja_Ancho;
var JS_hoja_Alto = CSS_hoja_Alto;


// if ($.cookie('tp_figuras_ajuste') === null || $.cookie('tp_figuras_ajuste') === "" || $.cookie('tp_figuras_ajuste') === "null" || $.cookie('tp_figuras_ajuste') === undefined){
if ( localStorageEstado == "no" ){
// No cookie

} else {

$.removeCookie('tp_figuras_ajuste');
// $.removeCookie('tp_figuras_ajuste');

var coeficiente_normal = CSS_hoja_Ancho / JS_hoja_Ancho;
var coeficiente_ajuste = JS_hoja_Ancho / CSS_hoja_Ancho;
Expand Down Expand Up @@ -532,20 +555,42 @@ $(document).ready(function(){
$.cookie(Cookie_Nombre, attrArray, { expires: 365 });
});
}
cookieCrear();
// cookieCrear();

function localStorageCrear(){
$(".figura").bind( "mouseup", function() {
var attrArray = [];
for ( var i=1; i < $(".figura").length + 1; i++ ){

var fig_id = "#fig_"+i;
var fig_top = $(fig_id).css("top");
var fig_left = $(fig_id).css("left");

var attr_sin_coma = attr_quitar_px(fig_top)+";"+attr_quitar_px(fig_left)+";"+$(fig_id).attr('data-rotacion');
attrArray.push({ id: $(fig_id).attr('id'), atributos: attr_sin_coma });
}

localStorage.removeItem(localStorage_Nombre);
localStorage.setItem(localStorage_Nombre, JSON.stringify(attrArray));
});
}
localStorageCrear();


if ($.cookie(Cookie_Nombre) === null || $.cookie(Cookie_Nombre) === "" || $.cookie(Cookie_Nombre) === "null" || $.cookie(Cookie_Nombre) === undefined){


// if ($.cookie(Cookie_Nombre) === null || $.cookie(Cookie_Nombre) === "" || $.cookie(Cookie_Nombre) === "null" || $.cookie(Cookie_Nombre) === undefined){
if ( localStorageEstado == "no" ){

// No cookie

} else {
$.cookie.json = true;
var cookieArray = $.cookie(Cookie_Nombre);
// $.cookie.json = true;
// var cookieArray = $.cookie(Cookie_Nombre);
var cookieArray = JSON.parse(localStorage.getItem(localStorage_Nombre));
var localStorageAttrArray_length = cookieArray.length;

for (var i=0;i < $(".figura").length;i++){
// for (var i=0;i < $(".figura").length;i++){
for (var i=0; i<localStorageAttrArray_length; i++){
var fig_id = "#"+cookieArray[i]['id'];
var fig_attr_array = cookieArray[i]['atributos'].split(';');

Expand Down Expand Up @@ -607,7 +652,8 @@ $(document).ready(function(){

grupoBorrar();

$.removeCookie(Cookie_Nombre);
// $.removeCookie(Cookie_Nombre);
localStorage.removeItem(localStorage_Nombre);

$(".figura").each(function(){
if ($(this).hasClass("original") == false){
Expand All @@ -616,18 +662,19 @@ $(document).ready(function(){
});

inicio();
cookieCrear();
// cookieCrear();
localStorageCrear();
});



/* Ajuste Pantalla ---------------------------------------------- */
$('#ajustar_aceptar').click(function(event) {
event.preventDefault();
$.removeCookie(Cookie_Nombre);
$.removeCookie('tp_figuras_ajuste');
$.cookie('tp_figuras_ajuste', 'Ajuste Pantalla');
location.reload();
// event.preventDefault();
// $.removeCookie(Cookie_Nombre);
// $.removeCookie('tp_figuras_ajuste');
// $.cookie('tp_figuras_ajuste', 'Ajuste Pantalla');
// location.reload();
});


Expand Down

0 comments on commit 962b743

Please sign in to comment.