<!DOCTYPE html>
<html lang="en" itemscope itemtype="http://schema.org/Organization">
<head>
    <meta charset="utf-8"> 
    <title>Flip.io</title>
    <meta name="description" content="IslamBosna rijeci word puzzles">
    <meta name="author" content="Ahmed Islamovic">
    <meta property="og:type" content="website" />
    <meta property="og:title" content="islambosna.ba" />
    <meta name="apple-mobile-web-app-capable" content="yes">  
    <link rel="apple-touch-icon" href="./apple-touch-icon.png">
    <link rel="stylesheet" href="./lib/normalize.css">
    <link rel="stylesheet" href="./main.css"> 
</head> 
 
<body>

<div class="main">
  <div class="topnav">

    <h1 class="title"></h1>
    <h1 class="titlenum"></h1>
  </div>
  <div class="content">
      <iframe id="hiddeniframe" style="visibility: hidden" src="http://www.islambosna.ba/forum/rijeci_get_user.php"></iframe>
  </div>
  <div class="footer">
  <a href="http://www.islambosna.ba"><img src="http://www.islambosna.ba/wp-content/uploads/2013/06/logotip_noba_520t.png" /></a>
  Developed by <a href="http://www.russellbeattie.com">Russell Beattie</a>, modified by Ahmed Islamovic.
  </div>
</div>

<script type="text/template" class="homeTemplate">

    <h3>
    Dobrodošao <%=App.username%> u 999 islamskih zagonetki.
    </h3>

    <div class="puzhome">
      <form class="puz-form">
        Enter a Number: <br>
        <input pattern="[0-9]*" name="puznum" class="puznum" value="<%=App.puzzleView.puzNum ? App.puzzleView.puzNum : ''%>">
        <button class="go-btn btn">Idi</button> <button class="random-btn btn">Slučajni izbor</button>
      </form>

        
    </div>
<%
      var wins = App.getWins();

      if(wins.length > 0){
%>
    <div class="wins">
    Wins: 
<%
      for(var i = 0; i < wins.length; i++){
        var win = wins[i];
%>
      <a href="#<%=win%>">#<%=win%></a> 
<%
      }
%>
  </div>
<%
}
%>

</script>

<script type="text/template" class="puzzleTemplate">
<%
  var puzzle = obj;
%>

    <div class="answer">
      <span class="answertext"></span>
      <span class="reset">X</span>
    </div>

    <div class="clues">
      <ul>
<%
    var clues = puzzle['clues'];

    for(var i = 0; i < clues.length; i++){
        var clue = clues[i]
%>
      <li data-answer="<%=clue['word']%>" title="<%=rot13(clue['word'])%>">
      <span class="word"><%=clue['word'].length%> slova</span>:
      <span class="def"><%=clue['def']%></span>
      </li>
<%
  }
%>
      </ul>
    </div>

    <div class="nav">
      <span class="gohome">Početna</span>
      <span class="restart">Ponovi</span>
      <span class="hint">Pomoć</span>
      <span class="sort">Sortiraj</span>
      <span class="shuffle">Izmješaj</span>
        <span class="pogoci">Pogoci</span>
        <span class="pobjede">Pobjede</span>
    </div>

    <div class="squares">
      <table>
      <tr>
<%
      var squares = puzzle['squares'];

      for(var i = 0; i < squares.length; i++){
          var sq = squares[i]

          if(i % 6 == 0){
%>
      <tr>
<%
          }
%>      
      <td>
          <div class="square letters"><%=sq%></div>
        </td>
<%
      }
%>
      </table>
    </div>

    <div class="timer">00:00<div>

</script>

<script type="text/template" class="winTemplate">
  
  <h1>Great Job!</h1>
  <h3>Your time: <%=formatTime(App.puzzleView.secs)%></h3>
  <div class="nav">
    <span class="next">Next Puzzle!</span>
    <div class="share">
<%
    var params = {
      url: document.location.href,
      text: 'Riješio sam ovu IslamBosna.ba zagonetku za ' + formatTime(App.puzzleView.secs) + ' minuta! ' + document.location.href
    }

    paramString = $.param(params);

%> 
    <span><a class="share" target="_blank" href="https://twitter.com/share?url=<%=paramString%>"><i></i> Podijeli na twitteru</a></span>

    </div>
  </div>

</script>
<script src="./lib/jquery.min.js"></script>
<script src="./lib/lodash.min.js"></script> 
<script src="./lib/backbone.min.js"></script> 
<script src="./puzzles.js"></script>
<script src="./app.js"></script>
<script>
$(function () {
  App.init();
});
</script>
<a class="forkme" href="https://github.com/senaduka/flip"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub"></a>
</body>
</html>
