Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: tomburger/mobile-prsi
base: dfc980c247
...
head fork: tomburger/mobile-prsi
compare: 4f209c7e3b
Checking mergeability… Don't worry, you can still create the pull request.
  • 4 commits
  • 14 files changed
  • 0 commit comments
  • 1 contributor
Commits on Sep 27, 2011
@tomburger New Rules page
Rating view after 2nd game
99b494c
@tomburger Text rendering
core.js introduced
Rules.html and About.html using text rendering and core.js
7253b4b
@tomburger Support view using text processor
index.html using core.js
c505b07
@tomburger Encoding -- so what is right? 4f209c7
View
54 assets/www/about.html
@@ -8,48 +8,12 @@
<script type="text/javascript" charset="utf-8" src="jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="lang.js"></script>
<script type="text/javascript" charset="utf-8" src="webintent.js"></script>
+ <script type="text/javascript" charset="utf-8" src="core.js"></script>
<script type="text/javascript">
$(document).ready(function() {
- parseQueryString();
- loadColors();
- $('.translate').map(function() {
- $(this).text(t($(this).text()));
- });
- $('div#app_rating').click(function() {
- window.plugins.webintent.startActivity(
- {
- action: WebIntent.ACTION_VIEW,
- url: 'https://market.android.com/details?id=cz.burger.android.phonegap.mobileprsi'
- },
- function() {},
- function() { alert('Failed to open Android Market'); }
- )
- });
+ initCore();
+ loadText('about', 'about_text');
});
- function parseQueryString() {
- var qs = window.location.search.substring(1);
- var parts = qs.split("&");
- window.prsi_color_scheme = parts[0];
- window.prsi_language = parts[1];
- }
- function loadColors() {
- var link = $('<link>');
- link.attr({
- type: 'text/css',
- rel: 'stylesheet',
- href: 'colors_' + window.prsi_color_scheme + '.css'
- });
- $('head').append(link);
- }
- function t(txt) {
- var text = texts[txt];
- if (!text) alert(txt);
- var formatted = text[window.prsi_language];
- for(arg in arguments) {
- if (arg > 0) formatted = formatted.replace("{" + arg + "}", arguments[arg]);
- }
- return formatted;
- }
</script>
</head>
<body>
@@ -60,17 +24,7 @@
</h1>
</div>
<div id="about" class="view">
- <div class="about_title translate">about_contact</div>
-
- <div class="about_ref"><span class="translate">facebook_homepage</span><br/>
- <a href="http://www.facebook.com/pages/mobile-prsi/166452220085020">facebook.com/mobile-prsi</a></div>
-
- <div class="about_ref"><span class="translate">twitter_contact</span><br/>
- <a href="http://twitter.com/#!/tomasburger">@tomasburger</a></div>
-
- <div class="about_ref"><span class="translate">app_rating_text</span><br/>
- <div id="app_rating" class="button translate">app_rating_button</div>
-
+ <div id="about_text"></div>
</div>
</body>
</html>
View
13 assets/www/about_cz.txt
@@ -0,0 +1,13 @@
+= Kontakt
+
+Hra má vlastní stránku na Facebooku
+[facebook.com/mobile-prsi|http://www.facebook.com/pages/mobile-prsi/166452220085020]
+
+Nebo můžete kontaktovat autora přes Twitter
+[@tomasburger|http://twitter.com/#!/tomasburger]
+
+Aplikace, která má lepší hodnoceni, zaujme víc uživatelů.
+Víc uživatelů znamená další vývoj a další funkce.
+Pomozte zlepšit hodnocení aplikace a ohodnoťte jí na Marketu.
+[Go to Market and provide rating|https://market.android.com/details?id=cz.burger.android.phonegap.mobileprsi]
+
View
13 assets/www/about_en.txt
@@ -0,0 +1,13 @@
+= Contact
+
+Game has homepage on Facebook
+[facebook.com/mobile-prsi|http://www.facebook.com/pages/mobile-prsi/166452220085020]
+
+You can also contact author on Twitter
+[@tomasburger|http://twitter.com/#!/tomasburger]
+
+If application gets a better rating, it gets better traction too.
+Better traction means development and more features.
+So help to improve the app by getting good rating on Market.
+[Go to Market and provide rating|https://market.android.com/details?id=cz.burger.android.phonegap.mobileprsi]
+
View
93 assets/www/core.js
@@ -0,0 +1,93 @@
+function initCore() {
+ parseQueryString();
+ loadColors();
+ $('.translate').map(function() {
+ $(this).text(t($(this).text()));
+ });
+}
+function parseQueryString() {
+ var qs = window.location.search.substring(1);
+ var parts = qs.split("&");
+ window.prsi_color_scheme = parts[0];
+ window.prsi_language = parts[1];
+}
+function loadColors() {
+ var link = $('<link>');
+ link.attr({
+ type: 'text/css',
+ rel: 'stylesheet',
+ href: 'colors_' + window.prsi_color_scheme + '.css'
+ });
+ $('head').append(link);
+}
+function t(txt) {
+ var text = texts[txt];
+ if (!text) alert(txt);
+ var formatted = text[window.prsi_language];
+ for(arg in arguments) {
+ if (arg > 0) formatted = formatted.replace("{" + arg + "}", arguments[arg]);
+ }
+ return formatted;
+}
+function buttonIntent(button_id, intent_url) {
+ $('div#' + button_id).click(function() {
+ window.plugins.webintent.startActivity(
+ {
+ action: WebIntent.ACTION_VIEW,
+ url: intent_url
+ },
+ function() {},
+ function() { alert('Failed to navigate to intent'); }
+ )
+ });
+}
+function loadText(file_name, div_ID) {
+ var filename = file_name + '_' + window.prsi_language + '.txt';
+ $.get(filename.toLowerCase(), function(data) {
+ var lines = data.split('\r\n');
+ var txt = '';
+ var div = '';
+ var title = false;
+ for (ix in lines) {
+ var line = lines[ix];
+ if (/^=\s/.test(line)) {
+ title = true;
+ div += line.replace(/^=\s+(.*)/, '$1');
+ continue;
+ }
+ if (!/^$/.test(line)) {
+ if (/^\[.*\]$/.test(line)) {
+ if (/\|\#/.test(line)) { // # specifies ID of button
+ line = line.replace(/^\[(.*)\|#(.*)\]$/,
+ '<div class="button" id="button_' + ix +'">$1</div>' +
+ '<script>$("div#button_' + ix + '").click($2);</script>');
+ }
+ else {
+ line = line.replace(/^\[(.*)\|(.*)\]$/,
+ '<div class="button" id="button_' + ix +'">$1</div>' +
+ '<script>buttonIntent("button_' + ix + '", "$2");</script>');
+ }
+ }
+ if (div != '') div += '<br/>';
+ div += line;
+ continue;
+ }
+ if (div != '') {
+ txt = txt
+ + '<div class="'
+ + (title ? 'about_title' : 'about_ref')
+ + '">' + div + '</div>';
+ }
+ title = false;
+ div = '';
+ };
+ if (div != '') {
+ txt = txt
+ + '<div class="'
+ + (title ? 'about_title' : 'about_ref')
+ + '">' + div + '</div>';
+ }
+ $('div#' + div_ID).html(txt);
+ }, 'text');
+}
+
View
5 assets/www/index.html
@@ -7,7 +7,9 @@
<script type="text/javascript" charset="utf-8" src="phonegap.js"></script>
<script type="text/javascript" charset="utf-8" src="jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="lang.js"></script>
+ <script type="text/javascript" charset="utf-8" src="webintent.js"></script>
<script type="text/javascript" charset="utf-8" src="game.js"></script>
+ <script type="text/javascript" charset="utf-8" src="core.js"></script>
<script type="text/javascript" charset="utf-8" src="main.js"></script>
</head>
<body>
@@ -75,5 +77,8 @@
<div class="button translate" id="nova_hra">new_game_button</div>
</div>
</div>
+ <div id="support" class="view">
+ <div id="support_text"></div>
+ </div>
</body>
</html>
View
16 assets/www/lang.js
@@ -32,19 +32,5 @@ var texts = {
'and_winner_is': { EN: 'WINNER', CZ: 'VÍTĚZ' },
'celebrate_hint': { EN: 'Celebrate a bit and start another game', CZ: 'Trochu to oslavte, a šup na odvetu' },
'new_game_button': { EN: 'New game', CZ: 'Nová hra' },
-
- 'about_contact': { EN: 'Contact', CZ: 'Kontakt' },
- 'facebook_homepage': { EN: 'Game has homepage on Facebook', CZ: 'Hra má stránku na Facebooku' },
- 'twitter_contact': { EN: 'You can also contact author on Twitter', CZ: 'S autorem se také můžete spojit přes Twitter' },
- 'app_rating_text': {
- EN: 'If application gets a better rating, it gets better traction too. '
- + 'Better traction means development and more features. '
- + 'So help to improve the app by getting good rating on Market.',
- CZ: 'Aplikace, která má lepší hodnoceni, zaujme víc uživatelů. '
- + 'Víc uživatelů znamená další vývoj a další funkce. '
- + 'Pomozte zlepšit hodnocení aplikace a ohodnoťte jí na Marketu.'},
- 'app_rating_button': { EN: 'Go to Market and provide rating', CZ: 'Ohodnoť aplikaci na Marketu' },
-
- 'rules_title': { EN: 'Rules', CZ: 'Pravidla' },
-
+
};
View
4 assets/www/main.css
@@ -69,6 +69,10 @@ div#predavka div.panel {
padding: 30px 0px;
}
+div#support div.panel span {
+ font-size: 25px;
+}
+
div#bot_hraje div.panel {
padding: 30px 0px;
}
View
55 assets/www/main.js
@@ -1,9 +1,5 @@
$(document).ready(function() {
- parseQueryString();
- loadColors();
- $('.translate').map(function() {
- $(this).text(t($(this).text()));
- });
+ initCore();
$('div#zacni_hru').click(clickZacniHru);
$('div#pridej_hrace').click(clickPridejHrace);
$('div#pridej_bot').click(clickPridejBot);
@@ -11,33 +7,23 @@ $(document).ready(function() {
$('div#tah_hotovy').click(clickTahHotovy);
$('div#nova_hra').click(clickNovaHra);
$('div.dalsibarva').click(clickDalsiBarva);
+ $('div#app_rating').click(clickGotoMarket);
$('div.view').css('display', 'none');
$('div.panel').height(300);
+ loadText('support', 'support_text');
+
initHraci();
});
-function parseQueryString() {
- var qs = window.location.search.substring(1);
- var parts = qs.split("&");
- window.prsi_color_scheme = parts[0];
- window.prsi_language = parts[1];
-}
-function loadColors() {
- var link = $('<link>');
- link.attr({
- type: 'text/css',
- rel: 'stylesheet',
- href: 'colors_' + window.prsi_color_scheme + '.css'
- });
- $('head').append(link);
-}
-function t(txt) {
- var text = texts[txt];
- var formatted = (!text) ? txt : text[window.prsi_language];
- for(arg in arguments) {
- if (arg > 0) formatted = formatted.replace("{" + arg + "}", arguments[arg]);
- }
- return formatted;
+function clickGotoMarket() {
+ window.plugins.webintent.startActivity(
+ {
+ action: WebIntent.ACTION_VIEW,
+ url: 'https://market.android.com/details?id=cz.burger.android.phonegap.mobileprsi'
+ },
+ function() {},
+ function() { alert('Failed to open Android Market'); }
+ )
}
function nextView(current, next, action) {
action();
@@ -105,6 +91,7 @@ function prepareHraciJmena() {
function initHraci() {
prepareHraciJmena();
changeHraciJmena(null);
+ window.pocitadlo = 0;
$('div#hraci').css('display', '');
}
function enabledZacniHru() {
@@ -420,7 +407,19 @@ function pripravVitez() {
$('div#hrac_vitez').text(hra.actualPlayer().name);
}
function clickNovaHra() {
- nextView('vitez', 'hraci', function() {
+ window.pocitadlo++;
+ if (window.pocitadlo === 2) {
+ nextView('vitez', 'support', function() {});
+ }
+ else {
+ nextView('vitez', 'hraci', function() {
+ prepareHraciJmena();
+ changeHraciJmena(null);
+ });
+ }
+}
+function clickSupport2Hra() {
+ nextView('support', 'hraci', function() {
prepareHraciJmena();
changeHraciJmena(null);
});
View
40 assets/www/rules.html
@@ -1,50 +1,19 @@
<!DOCTYPE html>
<html>
<head>
- <title>Karetní hra Prší</title>
+ <title>Karetní hra Prší</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" type="text/css" href="main.css">
<script type="text/javascript" charset="utf-8" src="phonegap.js"></script>
<script type="text/javascript" charset="utf-8" src="jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="lang.js"></script>
<script type="text/javascript" charset="utf-8" src="webintent.js"></script>
+ <script type="text/javascript" charset="utf-8" src="core.js"></script>
<script type="text/javascript">
$(document).ready(function() {
- parseQueryString();
- loadColors();
- $('.translate').map(function() {
- $(this).text(t($(this).text()));
- });
- loadRulesText();
+ initCore();
+ loadText('rules', 'rules_text');
});
- function parseQueryString() {
- var qs = window.location.search.substring(1);
- var parts = qs.split("&");
- window.prsi_color_scheme = parts[0];
- window.prsi_language = parts[1];
- }
- function loadColors() {
- var link = $('<link>');
- link.attr({
- type: 'text/css',
- rel: 'stylesheet',
- href: 'colors_' + window.prsi_color_scheme + '.css'
- });
- $('head').append(link);
- }
- function t(txt) {
- var text = texts[txt];
- if (!text) alert(txt);
- var formatted = text[window.prsi_language];
- for(arg in arguments) {
- if (arg > 0) formatted = formatted.replace("{" + arg + "}", arguments[arg]);
- }
- return formatted;
- }
- function loadRulesText() {
- var filename = 'rules_' + window.prsi_language + '.txt';
- $('div#rules_text').load(filename);
- }
</script>
</head>
<body>
@@ -55,7 +24,6 @@
</h1>
</div>
<div id="about" class="view">
- <div class="about_title translate">rules_title</div>
<div id="rules_text"></div>
</div>
</body>
View
2  assets/www/rules_cz.txt
@@ -1,3 +1,5 @@
+= Pravidla
+
Každý hráč obdrží na začátku 4 karty, které drží tak, aby je ostatní neviděli
Další karta z balíčku se položí na stůl barvou nahoru
Hráč, který je na řadě, vyhodí na stůl jednu z karet, které má v ruce
View
2  assets/www/rules_en.txt
@@ -1,3 +1,5 @@
+= Rules
+
Each player gets 4 cards at the beginning, which holds so that others could not see them
Another card from the deck is placed face up on the table
A player who is on the line, throw on the table one of the cards in his hand
View
9 assets/www/support_cz.txt
@@ -0,0 +1,9 @@
+= Podpořte Prší na mobil
+
+Aplikace, která má lepší hodnoceni, zaujme víc uživatelů.
+Víc uživatelů znamená další vývoj a další funkce.
+Pomozte zlepšit hodnocení aplikace a ohodnoťte jí na Marketu.
+[Ohodnoťte aplikace na Marketu|https://market.android.com/details?id=cz.burger.android.phonegap.mobileprsi]
+
+Děkujeme!!
+[Pokračujte ve hře|#clickSupport2Hra]
View
9 assets/www/support_en.txt
@@ -0,0 +1,9 @@
+= Support MauMau Mobile
+
+If application gets a better rating, it gets better traction too.
+Better traction means development and more features.
+So help to improve the app by getting good rating on Market.
+[Go to Market and provide rating|https://market.android.com/details?id=cz.burger.android.phonegap.mobileprsi]
+
+Thank You!!
+[Continue game|#clickSupport2Hra]
View
2  support/test/testframe.html
@@ -1,7 +1,7 @@
<html><head><title>Test frame - mobile-prsi</title></head>
<body><center>
- <iframe scrolling="no" width="600" height="800" src="../../assets/www/rules.html?blue&EN"></iframe>
+ <iframe scrolling="no" width="400" height="800" src="../../assets/www/index.html?blue&EN"></iframe>
<!-- iframe scrolling="no" width="600" height="600" src="../../assets/www/about.html?blue&EN"></iframe -->
</center></body></html>

No commit comments for this range

Something went wrong with that request. Please try again.