Datenbank Fundorte und Texte erfasst, Detailseite verfeinert

This commit is contained in:
Hilmer, Carsten 2016-09-08 16:32:10 +02:00
parent 55f544dd14
commit 4ac611f7f3
7 changed files with 159 additions and 50 deletions

View File

@ -2,6 +2,15 @@ md-input-container {
padding-bottom: 10px;
}
.half-image {
width: 50%;
}
.itemfontsize{
font-size: 14px;
}
.image-list-thumb {
padding: 2px 2px 2px 2px;
height: 64px;
@ -11,7 +20,7 @@ md-input-container {
text-align: center;
}
/* Attacken Bewertung */
.typnormal{
border-color: #0a9dc7;
background-color: #11c1f3;
@ -19,6 +28,7 @@ md-input-container {
text-align: center;
}
/* Attacken Bewertung */
.typnmittel{
border-color: #e6b500;
background-color: #ffc900;
@ -26,6 +36,7 @@ md-input-container {
text-align: center;
}
/* Attacken Bewertung */
.typschwach{
border-color: #28a54c;
background-color: #33cd5f;
@ -33,6 +44,7 @@ md-input-container {
text-align: center;
}
/* Attacken Bewertung */
.typstark{
border-color: #e42112;
background-color: #ef473a;
@ -117,11 +129,14 @@ md-input-container {
.pokemontypsx {
display: inline-block;
padding: 0 10px;
height: 16px;
height: 18px;
font-size: 8px;
line-height: 16px;
border-radius: 5px;
color: white;
border-style: solid;
border-color: white;
border-width: 1px;
}
.pokemontypsx img {
float: left;
@ -134,11 +149,14 @@ md-input-container {
.pokemontypsm {
display: inline-block;
padding: 0 25px;
height: 16px;
height: 18px;
font-size: 10px;
line-height: 16px;
border-radius: 5px;
color: white;
border-style: solid;
border-color:white;
border-width: 1px;
}
.pokemontypsm img {
@ -152,11 +170,14 @@ md-input-container {
.pokemontypnor {
display: inline-block;
padding: 0 25px;
height: 22px;
height: 24px;
font-size: 16px;
line-height: 22px;
border-radius: 6px;
color: white;
border-style: solid;
border-color:white;
border-width: 1px;
}
.pokemontypnor img {

Binary file not shown.

View File

@ -87,13 +87,13 @@ appControllers.controller('imageDownloadCtrl', function ($scope, $stateParams, $
console.log('Error. ' + error.code + ' ' + error.constant);
}, function (progress) {
//downloadprogress=(progress.loaded / progress.total) * 100;
$scope.progressprozent = Math.round(pokedexid / 721 * 100);
$scope.progressprozent = Math.round(pokedexid / 152 * 100);
$scope.progressval = pokedexid;
$scope.currentfile=filename; //+ downloadprogress;
});
console.log(pokedexid);
if (pokedexid<721){
if (pokedexid<152){
downloadtimer();
}
else{

View File

@ -24,47 +24,82 @@
</div>
<div class="item item-body">
<img class="full-image" src="{{pokemon.pokemonimage}}">
<p>
{{pokemon.pokemontext}}
</p>
</div>
</div>
<div class="card">
<div class="item item-divider">
Beschreibung
</div>
<div class="item item-text-wrap">
This is a basic Card with some text.
</div>
</div>
<div class="card">
<div class="item item-divider">
Typ
</div>
<div class="item item-text-wrap">
<div class="row">
<div class="row">
<div class="col-50">
<div ng-if="pokemon.pokemontypa > 0" class="pokemontyp{{ pokemon.pokemontypa }}">
<img class="full-image" src="{{pokemon.pokemonimage}}">
</div>
<div class="col-50">
<p><b>Trainer Infos:</b></p>
<div class="row">
<div class="col-66 itemfontsize">Fangchance:</div>
<div class="col-33 itemfontsize">{{pokemon.pokemonfangchance}}%</div>
</div>
<div class="row">
<div class="col-66 itemfontsize">Fluchtchance:</div>
<div class="col-33 itemfontsize">{{pokemon.pokemonfluchtchance}}%</div>
</div>
<div class="row">
<div class="col-66 itemfontsize">Ei-Distanz:</div>
<div class="col-33 itemfontsize">{{pokemon.pokemoneidistanz}} Km</div>
</div>
<div class="row">
<div class="col-100 itemfontsize">Entw. ab:</div>
</div>
<div class="row">
<div class="col-100 itemfontsize">{{pokemon.pokemonentwicklungtext}} {{pokemon.pokemonname}}-Bonbons</div>
</div>
</div>
</div>
<div class="row">
<div class="col-50">
<div ng-if="pokemon.pokemontypa > 0" class="pokemontypnor pokemontyp{{ pokemon.pokemontypa }} full-image">
<img src="img/typbilder/{{ pokemon.pokemontypa }}.png" alt="PokemonTyp" width="32" height="32">
{{ pokemon.pokemontypaString }}
</div>
</div>
<div class="col-50">
<div ng-if="pokemon.pokemontypb > 0" class="pokemontyp{{ pokemon.pokemontypb }}">
<div class="col-50">
<div nv class="pokemontypnor pokemontyp{{ pokemon.pokemontypb }} full-image">
<img src="img/typbilder/{{ pokemon.pokemontypb }}.png" alt="PokemonTyp" width="32" height="32">
{{ pokemon.pokemontypbString }}
</div>
</div>
</div>
<p><b>Beschreibung:</b></p>
<p>{{pokemon.pokemontext}}</p>
<p><b>Fundorte:</b></p>
<p>{{pokemon.pokemonfundort}}</p>
</div>
</div>
<div class="card">
<div class="item item-divider">
Entwicklung
</div>
<div class="item item-text-wrap">
<md-list>
<div class="row" ng-repeat="pokemonentwicklung in pokemonentwicklungliste" style="font-size: 10px;">
<div class="col-100 col-center mycenter" >
<div style="margin: 0 auto; width:100%">
<p ng-if="pokemonentwicklung.pokemonlistentyp == 2">{{ pokemonentwicklung.pokemonpokedexid }} Bonbons</p>
<img ng-if="pokemonentwicklung.pokemonlistentyp == 1" src="{{pokemonentwicklung.pokemonimage}}" width="64" height="64">
<p ng-if="pokemonentwicklung.pokemonlistentyp == 1">Pokedex-ID: {{ pokemonentwicklung.pokemonpokedexid }} </p>
</div>
</div>
</div>
</md-list>
</div>
</div>
<div class="card">
<div class="item item-divider">
Schaden durch Attacken-Typ
@ -73,7 +108,7 @@
<div class="row" ng-repeat="pokemonschwaeche in pokemonschwaechenliste">
<div class="col col-center" ng-class="pokemonschwaeche.pokemontyp1 == 1 ? 'typnmittel' : pokemonschwaeche.pokemontyp1 < 0.8 ? 'typschwach' : (pokemonschwaeche.pokemontyp1 == 0.8 ? 'typnormal' : 'typstark')">
<div class="pokemontyp{{ pokemonschwaeche.pokemontypid1}}sm" style="margin: 0 auto; width:100%">
<div class="pokemontypsm pokemontyp{{ pokemonschwaeche.pokemontypid1}}" style="margin: 0 auto; width:100%">
<img src="img/typbilder/{{ pokemonschwaeche.pokemontypid1}}.png" alt="PokemonTyp" width="32" height="32">
{{ pokemonschwaeche.pokemontyptext1 }}
</div>
@ -81,7 +116,7 @@
</div>
<div class="col col-center" ng-class="pokemonschwaeche.pokemontyp2 == 1 ? 'typnmittel' : pokemonschwaeche.pokemontyp2 < 0.8 ? 'typschwach' : (pokemonschwaeche.pokemontyp2 == 0.8 ? 'typnormal' : 'typstark')">
<div class="pokemontyp{{ pokemonschwaeche.pokemontypid2}}sm" style="margin: 0 auto; width:100%">
<div class="pokemontypsm pokemontyp{{ pokemonschwaeche.pokemontypid2}}" style="margin: 0 auto; width:100%">
<img src="img/typbilder/{{ pokemonschwaeche.pokemontypid2}}.png" alt="PokemonTyp" width="32" height="32">
{{ pokemonschwaeche.pokemontyptext2 }}
</div>
@ -89,7 +124,7 @@
</div>
<div class="col col-center" ng-class="pokemonschwaeche.pokemontyp3 == 1 ? 'typnmittel' : pokemonschwaeche.pokemontyp3 < 0.8 ? 'typschwach' : (pokemonschwaeche.pokemontyp3 == 0.8 ? 'typnormal' : 'typstark')">
<div class="pokemontyp{{ pokemonschwaeche.pokemontypid3}}sm" style="margin: 0 auto; width:100%">
<div class="pokemontypsm pokemontyp{{ pokemonschwaeche.pokemontypid3}}" style="margin: 0 auto; width:100%">
<img src="img/typbilder/{{ pokemonschwaeche.pokemontypid3}}.png" alt="PokemonTyp" width="32" height="32">
{{ pokemonschwaeche.pokemontyptext3 }}
</div>
@ -131,7 +166,7 @@
<div class="col-25 col-center">
<strong>Attacke</strong>
</div>
<div class="col-25 col-center">
<div class="col-20 col-center">
<strong>Typ</strong>
</div>
<div class="col-10 col-center mycenter">
@ -151,8 +186,8 @@
<div class="col-25 col-center">
{{ pokemonattacke.pokemonattacke }}
</div>
<div class="col-25 col-center">
<div class="pokemontyp{{ pokemonattacke.pokemonattacketyp}}sx" style="margin: 0 auto; width:97%;">
<div class="col-20 col-center">
<div class="pokemontypsx pokemontyp{{ pokemonattacke.pokemonattacketyp}}" style="margin: 0 auto; width:97%;">
<img src="img/typbilder/{{ pokemonattacke.pokemonattacketyp}}.png" alt="PokemonTyp" width="32" height="32">
{{ pokemonattacke.pokemonattacketyptext }}
</div>
@ -171,14 +206,6 @@
</md-list>
</div>
<div class="card">
<div class="item item-divider">
Evolution
</div>
<div class="item item-text-wrap">
{{ pokemon.pokemonentwa }}
</div>
</div>
</ion-content>
<div class="footer-fab-bar">

View File

@ -94,11 +94,34 @@ appControllers.controller('pokemonDetailCtrl', function ($mdBottomSheet, $mdToas
$scope.pokemonschwaechenliste = [];
$scope.pokemonattackenliste = [];
$scope.pokemonentwicklungliste = [];
// $scope.pokemon is the variable that store pokemon detail data that receive form pokemon list page.
// Parameter :
// $stateParams.pokemondetail(object) = pokemon that user select from pokemon list page.
$scope.pokemon = $scope.getPokemonData($stateParams.pokemondetail);
var entwarr = $scope.pokemon.pokemonentwicklung.split("|");
var entwkostenarr=$scope.pokemon.pokemonentwicklungkosten.split("|");
var index;
for (index = 0; index < entwarr.length; ++index) {
var dataItemEntwicklung = {
pokemonpokedexid : entwarr[index] ,
pokemonimage : $scope.getPokemonImage(entwarr[index]),
pokemonlistentyp : 1
};
$scope.pokemonentwicklungliste.push(dataItemEntwicklung);
if (entwkostenarr[index]>0){
var dataItemEntwicklung = {
pokemonpokedexid : entwkostenarr[index] ,
pokemonlistentyp : 2
};
$scope.pokemonentwicklungliste.push(dataItemEntwicklung);
}
}
//$scope.actionDelete is the variable for allow or not allow to delete data.
// It will allow to delete data when have data in the database.
$timeout(function () {
@ -120,6 +143,12 @@ appControllers.controller('pokemonDetailCtrl', function ($mdBottomSheet, $mdToas
$scope.pokemonschwaechenliste = pokedexDB.getTypenEffekte(pokedexid);
};//End getPokemonList.
// getPokemonList is for get all pokemons.
// By calling pokedexDB.all() service.
$scope.getPokemonImage = function (pokedexid) {
return pokedexDB.getPokemonImage(pokedexid);
};//End getPokemonList.
// getPokemonList is for get all pokemons.
// By calling pokedexDB.all() service.
$scope.getStandardAttacken = function (pokedexid) {

View File

@ -40,6 +40,8 @@ appServices.factory('pokedexDB', function ($cordovaSQLite)
var pokemontypen = [];
var pokemoneffektlist = [];
var pokemonstandardattackenliste= [];
var pokemonfundorte = [];
var pokemonimages = [];
return {
// Select all data from sqlite
@ -47,6 +49,7 @@ appServices.factory('pokedexDB', function ($cordovaSQLite)
{
pokemonList = [];
pokemontypen = [];
pokemonfundorte = [];
//Typen einlesen
var query = "SELECT * FROM tblPokemonTyp order by ID ASC";
@ -61,17 +64,34 @@ appServices.factory('pokedexDB', function ($cordovaSQLite)
}
}
});
//Typen einlesen
var query = "SELECT * FROM tblPokemonFundorte order by ID ASC";
$cordovaSQLite.execute(db, query).then(function (res)
{
if (res.rows.length > 0)
{
pokemonfundorte.push('');
for (var i = 0; i < res.rows.length; i++)
{
pokemonfundorte.push(res.rows.item(i).FUNDORT);
}
}
});
// Variable for prepare query statement to select all contracts.
var query = "SELECT * FROM tblPokemon";
var query = "SELECT * FROM tblPokemon order by POKEDEXID ASC";
// Execute query statement from query variable.
$cordovaSQLite.execute(db, query).then(function (res)
{
if (res.rows.length > 0)
{
pokemonimages.push('');
for (var i = 0; i < res.rows.length; i++)
{
var dummypokedexid='';
var dummyfundort='';
dummypokedexid=res.rows.item(i).POKEDEXID.toString();
@ -83,6 +103,14 @@ appServices.factory('pokedexDB', function ($cordovaSQLite)
dummypokedexid='0' + dummypokedexid;
}
if (res.rows.item(i).POKEMONTYPA > 0 ){
dummyfundort=dummyfundort + pokemonfundorte[res.rows.item(i).POKEMONTYPA];
}
if (res.rows.item(i).POKEMONTYPB > 0 ){
dummyfundort=dummyfundort + " " + pokemonfundorte[res.rows.item(i).POKEMONTYPB];
}
var dataItem = {
id : res.rows.item(i).ID ,
pokedexid : res.rows.item(i).POKEDEXID ,
@ -94,6 +122,7 @@ appServices.factory('pokedexDB', function ($cordovaSQLite)
pokemontypbString : pokemontypen[res.rows.item(i).POKEMONTYPB] ,
pokemonfangchance : res.rows.item(i).POKEMONFANGCHANCE ,
pokemonfluchtchance : res.rows.item(i).POKEMONFLUCHTCHANCE ,
pokemonfundort : dummyfundort ,
pokemoneidistanz : res.rows.item(i).POKEMONEIDISTANZ ,
pokemonentwicklungtext : res.rows.item(i).POKEMONENTWICKLUNGTEXT ,
pokemonentwicklung : res.rows.item(i).POKEMONENTWICKLUNG ,
@ -102,6 +131,7 @@ appServices.factory('pokedexDB', function ($cordovaSQLite)
pokemonnote : res.rows.item(i).POKEMONNOTE ,
pokemonimage : res.rows.item(i).POKEMONIMAGE
};
pokemonimages.push(res.rows.item(i).POKEMONIMAGE);
pokemonList.push(dataItem);
}
}
@ -208,8 +238,10 @@ appServices.factory('pokedexDB', function ($cordovaSQLite)
});
return pokemoneffektlist;
},
getPokemonImage: function (pokedexid)
{
return pokemonimages[pokedexid];
},
getStandardAttacken: function (pokedexid)
{

View File

@ -46,7 +46,7 @@
</head><!-- end head section-->
<!--body section-->
<body>
<body style="background-color:black;">
<div class="pokemontypnor pokemontyp18">
<img src="img/typbilder/1.png" alt="PokemonTyp" width="32" height="32">