Browse Source

Starting jquery work

Nathaniel van Diepen 11 years ago
parent
commit
6072059e39
8 changed files with 28 additions and 3 deletions
  1. 1 0
      .htaccess
  2. 3 0
      data/index.template.html
  3. 4 1
      index.php
  4. 0 1
      install/index.js
  5. 4 1
      install/index.php
  6. 16 0
      js/index.js
  7. 0 0
      js/install.js
  8. 0 0
      js/jquery.history.js

+ 1 - 0
.htaccess

@@ -11,6 +11,7 @@
 	RewriteRule ^\!([^/]*)$ /index.php?type=issue&id=$1 [QSA,L]
 	RewriteRule ^scrum/([^/]*)$ /index.php?type=scrum&id=$2 [QSA,L]
 	RewriteRule ^admin/([^/]*)$ /index.php?type=admin&id=$2 [QSA,L]
+	RewriteRule ^page/([^/]*)$ /index.php?type=template&id=$2 [QSA,L]
 </IfModule>
 # File security
 <FilesMatch ".(bak|config|sql|fla|psd|ini|log|sh|inc|~|swp)$">

+ 3 - 0
data/index.template.html

@@ -0,0 +1,3 @@
+<p>
+	Hello!
+</p>

+ 4 - 1
index.php

@@ -1,8 +1,11 @@
+<!doctype html>
 <html>
 	<head>
+		<meta charset=utf-8> 
 		<title>Bugs</title>
 		<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
-		<script src="index.js"></script>
+		<script src="js/jquery.history.js"></script>
+		<script src="js/index.js"></script>
 	</head>
 	<body>
 		<!-- TODO add containers for content -->

+ 0 - 1
install/index.js

@@ -1 +0,0 @@
-// TODO - Add initial page loading and handlers

+ 4 - 1
install/index.php

@@ -1,8 +1,11 @@
+<!doctype html>
 <html>
 	<head>
+		<meta charset=utf-8> 
 		<title>Install</title>
 		<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
-		<script src="index.js"></script>
+		<script src="../js/jquery.history.js"></script>
+		<script src="../js/install.js"></script>
 	</head>
 	<body>
 		<!-- TODO add containers for content -->

+ 16 - 0
js/index.js

@@ -0,0 +1,16 @@
+// TODO - Add initial page loading and handlers
+(function($,History){
+	var State = History.getState();
+	$(document).ready(function(){
+		if($.isEmptyObject(State.data)){
+			History.pushState({
+				type: 'template',
+				id: 'index'
+			},'Bugs','page/index');
+		}
+		$(window).on('statechange',function(){
+			State = History.getState();
+			console.log(State);
+		}).trigger('statechange');
+	});
+})(jQuery,History);

+ 0 - 0
index.js → js/install.js


File diff suppressed because it is too large
+ 0 - 0
js/jquery.history.js


Some files were not shown because too many files changed in this diff