diff --git a/README.md b/README.md index 56e1a08..70437db 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# [Flip.io Puzzle Game](http://flip.io) +# [IslamBosna.ba Rijeci](http://www.islambosna.ba/rijeci/) -An HTML5 puzzle app, and puzzle file generator. MIT licensed. Code is running at http://flip.io +An HTML5 puzzle app, and puzzle file generator. MIT licensed. Code is running at http://www.islambosna.ba/rijeci/ Here's a quick rundown of the files: diff --git a/app.js b/app.js index 0f0c0d4..5266037 100644 --- a/app.js +++ b/app.js @@ -4,7 +4,17 @@ var App = {}; App.init = function(){ - App.name = 'Flip.io'; + App.rijeci_serivce_url = "http://localhost:3000/" + App.forum_service_url = "http://www.islambosna.ba/forum/" + + // get the username from islambosna forum + + $.get(App.forum_service_url + "rijeci_get_user.php", + function (data) { + App.username = data; + }); + + App.name = 'IslamBosna Riječi'; $('.title').text(App.name); App.touch = ('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch; @@ -136,6 +146,7 @@ App.Router = Backbone.Router.extend({ $('.content').html(App.puzzleView.$el); App.router.currentView = App.puzzleView; + App.puzzleNumber = puzNum; $('.content').fadeIn(); @@ -277,7 +288,7 @@ App.PuzzleView = Backbone.View.extend({ events = { 'click .shuffle' : 'doShuffle', 'click .sort' : 'doSort', - 'click .hint' : 'doHint', + 'click .hint' : 'doWin', 'click .square' : 'doSquare', 'click .reset': 'doReset', 'click .restart': 'doRestart', @@ -475,6 +486,13 @@ App.PuzzleView = Backbone.View.extend({ $(this).css({'text-decoration':'line-through','font-style':'italic'}); $(this).fadeIn(); }); + + var definition = $clue.find('.def').text(); + var guess = $.param({ username: App.username , definition: definition }); + alert(guess); + $.post(App.rijeci_serivce_url + "guesses.json", guess , function (data) { + + } ); $('.square').each(function(index){ $(this).data('guessed',''); @@ -505,7 +523,13 @@ App.PuzzleView = Backbone.View.extend({ App.addWin(App.puzzleView.puzNum); App.play('sweep'); - + + var solution = $.param({ username: App.username , number: App.puzzleNumber, time: $('.timer').text() }); + + $.post(App.rijeci_serivce_url + "solutions.json", solution , function (data) { + alert(data); + } ); + setTimeout(function() { $('.squares table').fadeOut(); diff --git a/index.html b/index.html index 5ff1421..129168a 100644 --- a/index.html +++ b/index.html @@ -24,26 +24,30 @@
+