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: bettsmatt/CowsEye
base: d00a4a77d1
...
head fork: bettsmatt/CowsEye
compare: e969383251
Checking mergeability… Don't worry, you can still create the pull request.
  • 3 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
View
34 web/assets/cslib/Users.coffee
@@ -6,6 +6,9 @@ usernameInput = $ "#usernameInput"
passwordInput = $ "#passwordInput"
form_login = $ "#form_login"
+
+
+
###
setCookie = (name, value) ->
c_value = escape value
@@ -14,7 +17,7 @@ setCookie = (name, value) ->
console.log("Setting cookie to '#{c_name}=#{value};'")
console.log "Cookies is '#{document.cookie}'"
###
-
+###
getCookie = (name) ->
cookies = document.cookie.split(";")
console.log "cookies found #{cookies}"
@@ -37,7 +40,7 @@ setLogInControl = () ->
console.log("Is a user")
adminMenu.css {display: "none"}
loginMenu.css {display: "block"}
-
+###
### Old Testing controls
logoutButton.click ->
setCookie "status", "User"
@@ -50,10 +53,30 @@ loginButton.click ->
setLogInControl()
###
-# Check for the admin cookie and set the status...
+# Check with the server to see if this session has admin priviliges
$ ->
+ success = (data) ->
+ status = JSON.parse(data).status
+ console.log "Success #{data}"
+ if status == "true"
+ console.log("Is an Admin")
+ adminMenu.css {display: "block"}
+ loginMenu.css {display: "none"}
+ else
+ console.log("Is a user")
+ adminMenu.css {display: "none"}
+ loginMenu.css {display: "block"}
+
+ fail = (data) ->
+ console.log "Fail #{data}"
+
+ window.RWCall success, fail, {}, "status", "", "GET"
+
+ ###
setLogInControl()
+ ###
+ ###
form_login.submit ->
$.ajax {
@@ -70,9 +93,10 @@ form_login.submit ->
loginMenu.removeClass "open"
return false;
-
+###
+###
setInterval setLogInControl, 1000
-
+ ###
View
130 web/assets/js/Users.js
@@ -1,5 +1,5 @@
(function() {
- var adminMenu, form_login, getCookie, isAdmin, loginButton, loginMenu, logoutButton, passwordInput, setLogInControl, usernameInput;
+ var adminMenu, form_login, loginButton, loginMenu, logoutButton, passwordInput, usernameInput;
adminMenu = $("#adminMenu");
@@ -24,42 +24,30 @@
console.log "Cookies is '#{document.cookie}'"
*/
- getCookie = function(name) {
- var c, cookie, cookies, _i, _len;
- cookies = document.cookie.split(";");
- console.log("cookies found " + cookies);
- for (_i = 0, _len = cookies.length; _i < _len; _i++) {
- c = cookies[_i];
- console.log("Cookie is " + c);
- }
- cookie = c.split("=");
- if (name === cookie[0]) return unescape(cookie[1]);
- };
-
- isAdmin = function() {
- return getCookie("status") === "Admin";
- };
-
- setLogInControl = function() {
- console.log("setLogInControl Called");
- if (isAdmin()) {
- console.log("Is an Admin");
- adminMenu.css({
- display: "block"
- });
- return loginMenu.css({
- display: "none"
- });
- } else {
- console.log("Is a user");
- adminMenu.css({
- display: "none"
- });
- return loginMenu.css({
- display: "block"
- });
- }
- };
+ /*
+ getCookie = (name) ->
+ cookies = document.cookie.split(";")
+ console.log "cookies found #{cookies}"
+ for c in cookies
+ console.log("Cookie is #{c}")
+ cookie = c.split "="
+ if name == cookie[0]
+ return unescape cookie[1]
+
+ isAdmin = () ->
+ return getCookie("status") == "Admin"
+
+ setLogInControl = () ->
+ console.log("setLogInControl Called")
+ if isAdmin()
+ console.log("Is an Admin")
+ adminMenu.css {display: "block"}
+ loginMenu.css {display: "none"}
+ else
+ console.log("Is a user")
+ adminMenu.css {display: "none"}
+ loginMenu.css {display: "block"}
+ */
/* Old Testing controls
logoutButton.click ->
@@ -74,25 +62,59 @@
*/
$(function() {
- return setLogInControl();
- });
-
- form_login.submit(function() {
- $.ajax({
- type: "POST",
- data: $(this).serialize(),
- cache: false,
- url: "http://api.riverwatch.co.nz/wainz/login",
- crossDomain: true,
- dataType: "jsonp",
- success: function() {
- return alert("Success");
+ var fail, success;
+ success = function(data) {
+ var status;
+ status = JSON.parse(data).status;
+ console.log("Success " + data);
+ if (status === "true") {
+ console.log("Is an Admin");
+ adminMenu.css({
+ display: "block"
+ });
+ return loginMenu.css({
+ display: "none"
+ });
+ } else {
+ console.log("Is a user");
+ adminMenu.css({
+ display: "none"
+ });
+ return loginMenu.css({
+ display: "block"
+ });
}
- });
- loginMenu.removeClass("open");
- return false;
+ };
+ fail = function(data) {
+ return console.log("Fail " + data);
+ };
+ return window.RWCall(success, fail, {}, "status", "", "GET");
+ /*
+ setLogInControl()
+ */
});
- setInterval(setLogInControl, 1000);
+ /*
+ form_login.submit ->
+
+ $.ajax {
+ type: "POST"
+ data : $(this).serialize()
+ cache: false
+ url: "http://api.riverwatch.co.nz/wainz/login"
+ crossDomain: true
+ dataType: "jsonp"
+ success: () ->
+ alert "Success"
+ }
+
+ loginMenu.removeClass "open"
+
+ return false;
+ */
+
+ /*
+ setInterval setLogInControl, 1000
+ */
}).call(this);
View
78 web/iphonegallery.html
@@ -0,0 +1,78 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <title>River Watch</title>
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="description" content="">
+ <meta name="author" content="">
+
+ <!-- Le styles -->
+ <link href="assets/css/bootstrap.css" rel="stylesheet">
+ <style>
+ body {
+ padding-top: 120px; /* 60px to make the container go all the way to the bottom of the topbar */
+ }
+ </style>
+ <link href="assets/css/bootstrap-responsive.css" rel="stylesheet">
+ <link href="assets/css/custom.css" rel="stylesheet">
+
+ <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
+ <!--[if lt IE 9]>
+ <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
+ <![endif]-->
+
+ <!-- Le fav and touch icons -->
+ <link rel="shortcut icon" href="assets/ico/favicon.ico">
+ <link rel="apple-touch-icon-precomposed" sizes="144x144" href="assets/ico/apple-touch-icon-144-precomposed.png">
+ <link rel="apple-touch-icon-precomposed" sizes="114x114" href="assets/ico/apple-touch-icon-114-precomposed.png">
+ <link rel="apple-touch-icon-precomposed" sizes="72x72" href="assets/ico/apple-touch-icon-72-precomposed.png">
+ <link rel="apple-touch-icon-precomposed" href="assets/ico/apple-touch-icon-57-precomposed.png">
+
+
+ </head>
+
+ <body>
+ </div>
+ <div class="container">
+
+ <ul class="thumbnails" id = "picgrid" style="margin-top:10px;">
+ <!--
+ This is where the thumbnails go
+ -->
+ </ul>
+ </div>
+</div>
+
+
+
+ <!-- /container -->
+
+ <!-- Le javascript
+ ================================================== -->
+ <!-- Placed at the end of the document so the pages load faster
+ <script src="assets/js/jquery.js"></script>
+ <script src="assets/js/bootstrap-transition.js"></script>
+ <script src="assets/js/bootstrap-alert.js"></script>
+
+ <script src="assets/js/bootstrap-dropdown.js"></script>
+ <script src="assets/js/bootstrap-scrollspy.js"></script>
+ <script src="assets/js/bootstrap-tab.js"></script>
+ <script src="assets/js/bootstrap-tooltip.js"></script>
+ <script src="assets/js/bootstrap-popover.js"></script>
+ <script src="assets/js/bootstrap-button.js"></script>
+ <script src="assets/js/bootstrap-collapse.js"></script>
+ <script src="assets/js/bootstrap-carousel.js"></script>
+ <script src="assets/js/bootstrap-typeahead.js"></script>
+-->
+
+ <script src="assets/js/jquery.js"></script>
+ <script src="assets/js/bootstrap.js"></script>
+ <script src="assets/js/bootstrap-transition.js"></script>
+
+ <script src="assets/js/AjaxCommons.js"></script>
+ <script src="assets/js/IncidentThumbnail.js"></script>
+ <script src="assets/js/GridView.js"></script>
+
+ </body>
+</html>

No commit comments for this range

Something went wrong with that request. Please try again.