Advertisement
Guest User

Untitled

a guest
May 1st, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.64 KB | None | 0 0
  1. <html xmlns="http://www.w3.org/1999/xhtml"
  2.      xmlns:h="http://xmlns.jcp.org/jsf/html"
  3.      xmlns:f="http://java.sun.com/jsf/core"
  4.      xmlns:g="http://www.tuke.sk/games"
  5.      xmlns:p="http://primefaces.org/ui">
  6.  
  7.     <h:head>
  8.         <!--<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />-->
  9.         <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
  10.         <h:outputStylesheet library="css" name="stylesheet.css"/>
  11.         <title>Gamestudio</title>
  12.  
  13.  
  14.  
  15.         <link rel="stylesheet" type="text/css" href="http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/css/jquery.dataTables.css"></link>
  16.         <script src="https://cdn.datatables.net/1.10.11/js/jquery.dataTables.min.js"></script>
  17.  
  18.         <script type="text/javascript">
  19.             //<![CDATA[
  20.            $(document).ready(function() {
  21.                $.ajax({
  22.                    url: "webapi/comment/puzzle",
  23.                }).done(function(json) {
  24.                    for(var i = 0; i < json.length; i++) {
  25.                        var comment = json[i];
  26.                        $("#commentList").append($("<li>" + comment.player + " " + comment.text + " " + comment.playedOd + "</li>"));
  27.                    }
  28.                });
  29.            });
  30.  
  31.            $(document).ready(function() {
  32.                $('#example').DataTable({
  33.                    columns: [
  34.                        { data: "player" },
  35.                        { data: "text" },
  36.                        { data: "playedOn" }
  37.                    ],
  38.                    ajax: {url : "webapi/comment/puzzle", dataSrc : ''}
  39.                });
  40.            } );
  41.  
  42.            //]]>
  43.         </script>
  44.  
  45.  
  46.  
  47.  
  48.  
  49.     </h:head>
  50.  
  51.     <h:body>
  52.  
  53.         <h1>Picture Sliding Puzzle by Juraj</h1>
  54.  
  55.         <h:form id="form">
  56.             <g:puzzle value="#{puzzlefield}"/>
  57.             <h:commandButton value="Previous" action="#{puzzlefield.previousImg}" update="form" />
  58.             <h:commandButton value="Randomize" action="#{puzzlefield.generate}" update="form" />
  59.             <h:commandButton value="Next" action="#{puzzlefield.nextImg}" update="form" />
  60.             <h:commandButton value="Win Game" action="#{puzzlefield.win}" update="form"/>
  61.             <!--<p:selectBooleanButton onLabel="Mark" offLabel="Open" value="#{minefield.marking}">-->
  62.                 <!--<p:ajax event="change" update="form" />-->
  63.             <!--</p:selectBooleanButton>-->
  64.             <!--Time: <h:outputLabel value="#{puzzlefield.timeRemaining}"/>-->
  65.         </h:form>
  66.  
  67.  
  68.  
  69.         <h2>Comments</h2>
  70.         <ol id="commentList"/>
  71.         <table id="example"/>
  72.  
  73.     </h:body>
  74.  
  75. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement