Permalink
Browse files

Template rewrite propogation. Performance benefits from removing scri…

…pts from head
  • Loading branch information...
1 parent cd8044e commit da3c876d7caccada5fcff419ed3355f0a6b9cafe @jaseemabid jaseemabid committed Oct 16, 2011
Showing with 107 additions and 147 deletions.
  1. +27 −58 contribute.php
  2. +6 −7 faq.php
  3. +8 −5 index.php
  4. +16 −18 profile.php
  5. +23 −23 search.php
  6. +9 −7 template.php
  7. +18 −29 video.php
View
85 contribute.php
@@ -2,82 +2,51 @@
<html>
<head>
<title>Paathshaala Contribute</title>
-
<?php
-
include 'source.php';
include 'functions/ui.php';
echo $header;
?>
-<script src='js/like.js' type='text/javascript'></script>
-<script src='js/video.js' type='text/javascript'></script>
-<script src='js/parsevideo.js' type='text/javascript'></script>
<link rel='stylesheet' href='css/video-js.css'>
<link rel='stylesheet' href='css/video.css'>
-
-<script type='text/javascript'>
-$(document).ready(function() {
- getVideoHtml();
-});
-
-function getActiveUser() {
- <?php echo "return \"" .$_SESSION['uid']. "\"" ; ?> ;
-}
-
-</script>
</head>
<body>
<div id='topbar'></div>
<img src="pics/load.gif" id='loading'/ style='display:none;'>
-
<div id='container'>
- <?php echo $topNotLoggedIn;
+ <?php echo $topBar;
echo $feedback; ?>
-
-<span style='font-size:24px; color:#3A75AF'> Contribute to paathshaala</span> <span id="helpTrigger" style='font-size:14px'> [help] </span>
-
-<div id='helpMessage' class='message' style='border:0px; display:none'>
- We have a lot of unpublished videos with us which is not yet searchable. Your contribution will make this video public and useful for others.<i>One small step for a student, one giant leap for student kind.</i><br />
- Please dont mess up !
-</div>
-
-
+ <span style='font-size:24px; color:#3A75AF'> Contribute to paathshaala</span> <span id="helpTrigger" style='font-size:14px'> [help] </span>
+ <div id='helpMessage' class='message' style='border:0px; display:none'>
+ We have a lot of unpublished videos with us which is not yet searchable. Your contribution will make this video public and useful for others.<i>One small step for a student, one giant leap for student kind.</i><br />Please dont mess up !
+ </div>
<div class='mainLeft'>
<div class='videodiv'></div>
</div> <!--/ main left -->
-
-<div class='mainRight'>
-
-
-
-<div class='message' id='helpLog' >
- Describe video details along
-</div>
-
-
-<form class='newVideoSubmit'>
-
-<input type="text" id="title" placeholder="Enter a title for your new video"/>
-<input type="text" id="tags" placeholder="Now few comma seperated tags"/>
-<textarea id='desc' placeholder="Now add a good description to make this video searchable and useful for others"></textarea>
-
-<div class='newVideoSubmitButton'>Submit video to paathshaala :)</div>
-
-</form>
-
-
-
+ <div class='mainRight'>
+ <div class='message' id='helpLog' >
+ Describe video details along
+ </div>
+ <form class='newVideoSubmit'>
+ <input type="text" id="title" placeholder="Enter a title for your new video"/>
+ <input type="text" id="tags" placeholder="Now few comma seperated tags"/>
+ <textarea id='desc' placeholder="Now add a good description to make this video searchable and useful for others"></textarea>
+ <div class='newVideoSubmitButton'>Submit video to paathshaala :)</div>
+ </form>
</div> <!-- /main right -->
-
-
-
</div><!-- /container -->
+<?php
+ echo $bottomBar;
+ echo $scripts;
+ echo $piwik;
+?>
+<script src='js/video.js' type='text/javascript'></script>
+<script src='js/comment.js' type='text/javascript'></script>
+<script type='text/javascript'>
+$(document).ready(function() {
+ getVideoHtml();
+});
+</script>
-
-
-<?php echo $bottomBar; ?>
-<div id="bottombar"></div>
-<script src='js/ui.js' type='text/javascript' ></script>
-<?php echo $piwik; ?>
</body>
</html>
View
13 faq.php
@@ -4,7 +4,6 @@
<title>Paathshaala FAQ</title>
<?php
-
include 'source.php';
echo $header;
?>
@@ -21,7 +20,7 @@
<div id='container'>
- <?php echo $topNotLoggedIn;
+ <?php echo $topBar;
echo $feedback; ?>
<div class='mainLeft'>
@@ -109,11 +108,11 @@
</div>
</div><!-- /container -->
-
-<?php echo $bottomBar; ?>
-<div id="bottombar"></div>
-<script src='js/ui.js' type='text/javascript' ></script>
-<?php echo $piwik; ?>
+<?php
+ echo $bottomBar;
+ echo $scripts;
+ echo $piwik;
+?>
</body>
</html>
View
13 index.php
@@ -10,23 +10,26 @@
<body>
<div id='topbar'></div>
<div id='container'>
- <?php echo $topNotLoggedIn;
+ <?php echo $topBar;
echo $feedback; ?>
<div id="indexMesssage">
We pay our tribute to our <a href="video.php?video=261"><em>inspiration</em></a>. RIP Steve Jobs (February 24, 1955 – October 5, 2011).<span id="cross" class="news">X</span>
</div>
</div><!-- /container -->
-<?php echo $bottomBar; ?>
-<div id="bottombar"></div>
+
+<?php
+ echo $bottomBar;
+ echo $scripts;
+ echo $piwik;
+?>
<script type="text/javascript">
$(document).ready(function() {
updateStoryBox('Featured')
updateStoryBox('Popular')
updateStoryBox('TopRated')
});
</script>
-<script src='js/ui.js' type='text/javascript'></script>
-<?php echo $piwik; ?>
+
</body>
</html>
View
34 profile.php
@@ -2,7 +2,6 @@
<html>
<head>
<title>Paathshaala Profile</title>
-
<?php
include_once 'source.php';
include_once 'functions/functions.php';
@@ -14,23 +13,15 @@
}
echo $header;
?>
-
<link rel='stylesheet' href='css/profile.css'>
-<script type="text/javascript">
-$(document).ready(function() {
- updateStoryBox('Uploads');
- updateStoryBox('Liked');
- updateStoryBox('Disliked');
-});
-</script>
</head>
<body>
<div id='topbar'></div>
<img src="pics/load.gif" id='loading' style='display:none;'>
<div id='container'>
- <?php echo $topNotLoggedIn;
- echo $feedback; ?>
-
+<?php echo $topBar;
+ echo $feedback;
+?>
<div id='editProfile'></div>
<div id='profileBox'>
@@ -43,15 +34,22 @@
I am : <span id=''><?php echo $u->getFullname(); ?></span><br />
email : <?php echo $u->getEmail(); ?> <br />
here I am called : <span id='profileUsername'><?php echo $u->getUsername(); ?></span><br />
- Insti Roll : <?php echo $u->getRoll(); ?> (Helps us to give you better suggestions )<br />
+ Insti Roll : <?php echo $u->getRoll(); ?> (Helps us to give you better suggestions)<br />
</div>
</div>
</div><!-- /container -->
-
-<?php echo $bottomBar; ?>
-<div id="bottombar"></div>
-<script src='js/ui.js' type='text/javascript' ></script>
-<?php echo $piwik; ?>
+<?php
+ echo $bottomBar;
+ echo $scripts;
+ echo $piwik;
+?>
+<script type="text/javascript">
+$(document).ready(function() {
+ updateStoryBox('Uploads');
+ updateStoryBox('Liked');
+ updateStoryBox('Disliked');
+});
+</script>
</body>
</html>
View
46 search.php
@@ -1,30 +1,22 @@
<!DOCTYPE HTML>
<html>
<head>
-<title>Paathshaala Search</title>
-
-<?php
- include 'source.php';
- echo $header;
-?>
-
-<script type='text/javascript'>
-$(document).ready(function() {
- var q = getUrlVars()['q'];
- var tag = getUrlVars()['tag'];
- update( q , tag ,++activePage);
-});
-</script>
-
-<link rel="stylesheet" href="css/video.css" />
-<link rel="stylesheet" href="css/search.css" />
+ <title>Paathshaala Search</title>
+ <?php
+ include 'source.php';
+ echo $header;
+ ?>
+ <link rel="stylesheet" href="css/video.css" />
+ <link rel="stylesheet" href="css/search.css" />
</head>
<body>
<div id='topbar'></div>
<img src="pics/load.gif" id='loading' style='display:none;'>
<div id='container'>
- <?php echo $topNotLoggedIn;
- echo $feedback; ?>
+<?php
+ echo $topBar;
+ echo $feedback;
+?>
<div class='mainLeft'>
<span class='smallSubtitle'>Search Results</span>
<div id=findStuff></div>
@@ -34,11 +26,19 @@
<div class='mainRight'>
</div>
</div><!-- /container -->
-<?php echo $bottomBar; ?>
-<div id="bottombar"></div>
-<script src='js/ui.js' type='text/javascript' ></script>
+<?php
+ echo $bottomBar;
+ echo $scripts;
+ echo $piwik;
+?>
<script src='js/search.js' type='text/javascript' ></script>
-<?php echo $piwik; ?>
+<script type='text/javascript'>
+$(document).ready(function() {
+ var q = getUrlVars()['q'];
+ var tag = getUrlVars()['tag'];
+ update( q , tag ,++activePage);
+});
+</script>
</body>
</html>
View
16 template.php
@@ -13,14 +13,16 @@
<div id='topbar'></div>
<img src="pics/load.gif" id='loading' style='display:none;'>
<div id='container'>
- <?php echo $topNotLoggedIn;
- echo $feedback; ?>
+<?php
+ echo $topBar;
+ echo $feedback;
+?>
</div><!-- /container -->
-
-<?php echo $bottomBar; ?>
-<div id="bottombar"></div>
-<script src='js/ui.js' type='text/javascript' ></script>
-<?php echo $piwik; ?>
+<?php
+ echo $bottomBar;
+ echo $scripts;
+ echo $piwik;
+?>
</body>
</html>
View
47 video.php
@@ -2,40 +2,19 @@
<html>
<head>
<title>Paathshaala Video</title>
-
<?php
include 'source.php';
include 'functions/ui.php';
echo $header;
?>
-
<link rel='stylesheet' href='css/video-js.css'>
<link rel='stylesheet' href='css/video.css'>
-
-<script type='text/javascript'>
-$(document).ready(function() {
- getVideoHtml( <?php echo $_GET['video'] ?> );
- /* Function calls to update the comments */
- updateComment("/couch/comments/_design/comments/_view/commentbycid?key=\"<?php echo $_GET['video']; ?>\"");
- getNewComment(function(changes){
- //alert(changes.results[0].id);
- updateComment("/couch/comments/_design/comments/_view/commentbyid?key=\""+changes.results[0].id+"\"");
- });
-});
-
-function getActiveUser() {
- <?php echo "return \"" .$_SESSION['uid']. "\"" ; ?> ;
-}
-
-
-</script>
</head>
<body>
<div id='topbar'></div>
<img src="pics/load.gif" id='loading'/ style='display:none;'>
-
<div id='container'>
- <?php echo $topNotLoggedIn;
+ <?php echo $topBar;
echo $feedback; ?>
<div class='mainLeft'>
<div class='videodiv'></div>
@@ -44,21 +23,31 @@ function getActiveUser() {
echo "<span class='smallSubtitle'>Comments</span>";
echo "<div class='commentWarp'></div>";
echo $commentSubmit;
- }
- else{
+ } else {
echo "Content not found :-(";
}
?>
</div> <!--/ main left -->
<div class='mainRight'><!-- main right --></div>
</div><!-- /container -->
-
-<?php echo $bottomBar; ?>
-<div id="bottombar"></div>
+<?php
+ echo $bottomBar;
+ echo $scripts;
+ echo $piwik;
+?>
<script src='js/video.js' type='text/javascript'></script>
<script src='js/comment.js' type='text/javascript'></script>
-<script src='js/ui.js' type='text/javascript'></script>
-<?php echo $piwik; ?>
+<script type='text/javascript'>
+$(document).ready(function() {
+ getVideoHtml( <?php echo $_GET['video'] ?> );
+ /* Function calls to update the comments */
+ updateComment("/couch/comments/_design/comments/_view/commentbycid?key=\"<?php echo $_GET['video']; ?>\"");
+ getNewComment(function(changes){
+ //alert(changes.results[0].id);
+ updateComment("/couch/comments/_design/comments/_view/commentbyid?key=\""+changes.results[0].id+"\"");
+ });
+});
+</script>
</body>
</html>

0 comments on commit da3c876

Please sign in to comment.