Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding more stuff to the docs #12

Merged
merged 5 commits into from
Feb 26, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 2 additions & 17 deletions kalite/distributed/management/commands/screenshots.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ def __init__(self, *args, **kwargs):
self.loginfo("==> Setting-up browser ...")
super(Screenshot, self).setUp()
self.browser.set_window_size(1024, 768)
self.browser.implicitly_wait(15)

self.loginfo("==> Browser %s successfully setup with live_server_url %s." %
(self.browser.name, self.live_server_url,))
Expand Down Expand Up @@ -233,23 +234,7 @@ def snap(self, slug, focus, note):
for key, value in styles.iteritems():
self.browser.execute_script('$("%s").css("%s", "%s");' % (selector, key, value))
if note:
# Assuming we've loaded jquery
# Positioned at the bottom left, so might cause issues with some elements?
self.browser.execute_script("$('body').append(\"<span id='annotation'></span>\");"
+ "$('#annotation').text(\"%s\")" % note
+ ".css('position','absolute')"
+ ".css('padding','20px')"
+ ".css('border','solid 4px black')"
+ ".css('border-radius','20px 0px 20px 20px')"
+ ".css('background','white')"
+ ".css('color','black')"
+ ".css('z-index','9999');"
+ "var top_position = $('%s').offset().top + $('%s').outerHeight();" % (selector, selector)
+ "var left_position = $('%s').offset().left - $('#annotation').outerWidth();" % selector
+ "if(left_position<0){left_position=0;};"
+ "$('#annotation').css('left',left_position+'px')"
+ ".css('top',top_position+'px');" )

self.browser.execute_script("$('%s').qtip({content:{text:\"%s\"},show:{ready:true,delay:0,effect:false}})" % (selector, note))
self.browser.save_screenshot(filename)

def process_snap(self, shot, browser=None):
Expand Down
3 changes: 3 additions & 0 deletions kalite/distributed/static/css/distributed/jquery.qtip.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions kalite/distributed/static/js/distributed/jquery.qtip.min.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions kalite/distributed/templates/distributed/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<link rel="stylesheet" type="text/css" href="{% static 'css/distributed/khan-lite.css' True %}">
<link href="{% static "fonts/style.css" %}" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="{% static 'css/distributed/search_autocomplete.css' True %}">
<link rel="stylesheet" type="text/css" href="{% static 'css/distributed/jquery.qtip.min.css' True %}">

<!-- CSS for dynamic settings -->
<link rel="stylesheet" type="text/css" href="{% url 'dynamic_css' %}">
Expand Down Expand Up @@ -122,6 +123,7 @@
<script type="text/javascript" src="{% static 'js/khan-lite.js' %}"></script>
<script type="text/javascript" src="{% static 'js/distributed/distributed-server.js' %}"></script>
<script type="text/javascript" src="{% static 'js/distributed/search_autocomplete.js' %}"></script>
<script type="text/javascript" src="{% static 'js/distributed/jquery.qtip.min.js' %}"></script>

<!-- Imports for handlebars, our JS templating engine -->
<script src="{% static "js/handlebars/handlebars-v1.3.0.js" %}"></script>
Expand Down
Loading