Permalink
Browse files

Adding OpenPhoto in footer.

  • Loading branch information...
1 parent 73965d5 commit c6ae2f0e9baf534932740aad62b1d14e68d978a4 @jmathai committed Dec 30, 2011
Showing with 16 additions and 29 deletions.
  1. +11 −20 html/js/javascript.js
  2. +1 −1 lib/scripts/auto_prepend.php
  3. +4 −8 lib/views/footer.php
View
@@ -8,7 +8,6 @@ var jm = (function() {
tpls[$(a).attr("href")] = $(a).attr("tpl");
});
var tpls = {"/":"home","/resume.html":"resume","/portfolio.html":"portfolio","/code.html":"code","/articles.html":"articles","/contact.html":"contact"};
- //var _ptg = new PTG("656ff15dffa1a18c53c94b242da917f9");
return {
typer: function()
{
@@ -92,27 +91,19 @@ var jm = (function() {
var regt = /\>/g;
start();
},
- ptg: {
- load: function(){
- var limit = 45;
- $.getJSON('http://photos.jaisenmathai.com/api/json?action=image.search&privacy=1&tags=favorites&limit='+limit+'&offset=0&order=dateTaken&callback=?&authenticationKey=656ff15dffa1a18c53c94b242da917f9', function(data) {
- var photoGroup = $("#footer-outer p.thumbs");
- $.each(data, function(i, photo) {
- if(photo.name == null){ photo.name = 'This photo has no title.'; }
- var lsrc = ptg.html.customImageLockSrc(photo.thumbnailPath, photo.key, photo.width, photo.height, 800, 600);
- var tsrc = ptg.html.customImageSrc(photo.thumbnailPath, photo.key, 40, 40)
- $(photoGroup).append('<a href="'+lsrc+'" title="'+photo.name+'" target="_blank"><img src="'+tsrc+'" width="40" height="40"></a>');
- if(i == (limit-1))
- setupZoom();
- });
- });
- },
+ op: {
render: function(response){
- var p, i;
- for(i in response) {
- p = response[i];
- console.log(p.thumbnailPath);
+ var photos = response.result,
+ photo,
+ photoGroup = $("#footer-outer p.thumbs");
+ for(i in photos) {
+ if(photos.hasOwnProperty(i)) {
+ photo = photos[i];
+ if(photo.title == null){ photo.title = 'This photo has no title.'; }
+ photoGroup.append('<a href="'+photo["path800x600"]+'" title="'+photo.title+'" target="_blank"><img src="'+photo["path40x40xCR"]+'" width="40" height="40"></a>');
+ }
}
+ setupZoom();
}
},
click: function(ident, loc) {
@@ -57,7 +57,7 @@ function validCacheInclude($parent, $child, $ext)
return substr($child, $extLen) == $ext;
}
- define('CACHE_JS', '/js/compress-aai.js|jquery-1.4.2.min.js|javascript.js|mustache.js|FancyZoom.js|FancyZoomHTML.js|shCore.js|shBrushCss.js|shBrushJScript.js|shBrushPhp.js|shBrushBash.js');
+ define('CACHE_JS', '/js/compress-aaj.js|jquery-1.4.2.min.js|javascript.js|mustache.js|FancyZoom.js|FancyZoomHTML.js|shCore.js|shBrushCss.js|shBrushJScript.js|shBrushPhp.js|shBrushBash.js');
function getJs()
{
$url = CACHE_JS;
View
@@ -46,7 +46,7 @@
<!-- footer starts here -->
<div id="footer-outer" class="clear"><div id="footer-wrap">
<div class="col-a">
- <h3>Photos</h3>
+ <h3>Photos (via OpenPhoto)</h3>
<p class="thumbs"></p>
</div>
@@ -74,7 +74,7 @@
<div id="footer-bottom">
<div class="bottom-left">
<p>
- &copy; 2010 <strong>Your Copyright Info Here</strong>&nbsp; &nbsp; &nbsp;
+ &copy; <?php echo date('Y');?> <strong>Jaisen Mathai</strong>&nbsp; &nbsp; &nbsp;
<a href="http://www.bluewebtemplates.com/" title="Website Templates">website templates</a> by <a href="http://www.styleshout.com/">styleshout</a>
</p>
</div>
@@ -93,7 +93,7 @@
</div><!-- id="wrap" -->
<?php echo getJs(); ?>
<script src="/mustaches.js" type="text/javascript"></script>
-<script src="http://photos.jaisenmathai.com/js/api.js" id="__PTG"></script>
+<script src="/js/OpenPhoto.js" data-site="http://photos.jaisenmathai.com"></script>
<script>
var ptg;
<?php if(PROD) { ?>
@@ -117,11 +117,7 @@
dp.SyntaxHighlighter.ClipboardSwf = '/swf/clipboard.swf';
dp.SyntaxHighlighter.HighlightAll('code');
- if(typeof PTG == 'function')
- {
- ptg = new PTG("656ff15dffa1a18c53c94b242da917f9");
- jm.ptg.load();
- }
+ OpenPhoto.Api.load('/photos/tags-favorites/list.json?pageSize=45&returnSizes=40x40xCR,800x600', jm.op.render);
jm.isProd(<?php echo json_encode(PROD); ?>);
if(jm.isProd()) {
_gaq.push(function() { var pageTracker = _gat._createTracker('UA-88708-4', 'jm'); });

0 comments on commit c6ae2f0

Please sign in to comment.