Skip to content

Commit

Permalink
adding configuration section for comment javascript
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Raddon authored and Aaron Raddon committed May 18, 2008
1 parent 5b03eb8 commit 70eb9a7
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 12 deletions.
1 change: 1 addition & 0 deletions blog.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ def post(self):
blog.area2 = self.request.get('area2')
blog.area3 = self.request.get('area3')
blog.analyticsjs = self.request.get('analyticsjs')
blog.commentjs = self.request.get('commentjs')
blog.save()
self.redirect('/admin/entry/list/post')

Expand Down
1 change: 1 addition & 0 deletions model.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class Blog(db.Model):
archivehtml = db.TextProperty(default='')
tags = db.TextProperty(default='{}')
analyticsjs = db.StringProperty(multiline=True,default='')
commentjs = db.StringProperty(multiline=True,default='')

def save(self):
self.put()
Expand Down
41 changes: 29 additions & 12 deletions views/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,20 +78,37 @@ <h2><a href="/entry/{{ entry.slug }}" rel="bookmark" title="{{ entry.title }}">{
{% endfor %}
{% if current_userisadmin %}

<script type="text/javascript">
//var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
//document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
//var pageTracker = _gat._getTracker("UA-xxxxxx-x");
//pageTracker._initData();
//pageTracker._trackPageview();
</script>
<div id="demisauce-comments"></div>


<script src="http://localhost:4950/comment/js/8ab80ecd0944981fe61694481a1bea014b053a0a" type="text/javascript" ></script>

{{ blog.commentjs }}
<script type="text/javascript" src="http://localhost:4950/comment/js?site_key="></script>
<script type="text/javascript">
$(document).ready(function(){
//src="http://localhost:4950/comment/js?site_key="
/*
var ds_original_link = window.location.href;
var ds_script = document.createElement('script');
ds_script.type = 'text/javascript';
// allow js var from users page to be passed in to override element id of where to plop this stuff
if(typeof(demisauce_commentid) == 'undefined') {
demisauce_commentid = 'demisauce-comments';
}
qs = 'url=' + encodeURIComponent(ds_original_link)
qs += '&site_key=8ab80ecd0944981fe61694481a1bea014b053a0a'
ds_script.src = 'http://localhost:4950/comment/js?' + qs
var demisauce_script_div = document.createElement('div');
// now load the scripts
document.getElementById('demisauce-comments').parentNode.appendChild(demisauce_script_div);
//alert(ds_script.src)
demisauce_script_div.appendChild(ds_script);
*/
});


</script>
{% endif %}
</div>
<!-- Content Ends -->
Expand Down
4 changes: 4 additions & 0 deletions views/setup.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@
<label for="analyticsjs">Analytics Javascript:</label>
<textarea name="analyticsjs" rows="4" cols="60" class="wide">{{ blogedit.analyticsjs }}</textarea>
</div>
<div class="optional">
<label for="analyticsjs">Comment Javascript:</label>
<textarea name="commentjs" rows="4" cols="60" class="wide">{{ blogedit.commentjs }}</textarea>
</div>
</fieldset>
<div class="actions">
<input type="submit" class="primaryAction" id="submit" value="Save &#187;">
Expand Down

0 comments on commit 70eb9a7

Please sign in to comment.