Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'readable_service' into develop

  • Loading branch information...
commit b68cff6e72e26b1eb135b75a9d7c7675182b9372 2 parents cbd4c4e + 484502f
@mitechie authored
Showing with 33 additions and 3 deletions.
  1. +2 −2 bookie/static/js/bookie/api.js
  2. +31 −1 bookie/templates/bmark/edit.mako
View
4 bookie/static/js/bookie/api.js
@@ -95,7 +95,7 @@ YUI.add('bookie-api', function (Y) {
}
cfg.arguments = args;
- request = Y.io(url, cfg);
+ Y.io(url, cfg);
};
/**
@@ -1113,5 +1113,5 @@ YUI.add('bookie-api', function (Y) {
}, '0.1.0', {
- requires: ['base', 'io', 'querystring-stringify-simple', 'json', 'substitute']
+ requires: ['base', 'io', 'io-xdr', 'querystring-stringify-simple', 'json', 'substitute']
});
View
32 bookie/templates/bmark/edit.mako
@@ -79,6 +79,7 @@
</li>
</ul>
</form>
+ <div id="readable_content" style="display: none;"></div>
</div>
</div>
@@ -86,7 +87,7 @@
<%def name="add_js()">
<script type="text/javascript">
// Create a new YUI instance and populate it with the required modules.
- YUI().use('node', 'console', 'bookie-view', function (Y) {
+ YUI().use('node', 'console', 'bookie-view', 'bookie-readable', 'bookie-indicator', function (Y) {
${api_setup(request.user)}
var tagcontrol = new Y.bookie.TagControl({
api_cfg: api_cfg,
@@ -105,6 +106,35 @@
});
target.remove();
});
+
+ % if new and bmark.hashed.url:
+ // Start out testing to see if we can load the readable content
+ // for the url via our bookie-readable js module
+ var readable_target = Y.one('#readable_content');
+ readable_target.show();
+ var readable = new Y.bookie.readable.Api({
+ url: '${bmark.hashed.url}'
+ });
+
+ var indicator = new Y.bookie.Indicator({
+ target: readable_target
+ });
+ indicator.render();
+ indicator.show();
+
+ readable.call({
+ success: function (data, response, args) {
+ readable_target.setContent(data.content)
+ indicator.hide();
+ },
+
+ error: function (data, status_str, response, args) {
+ console.log(data);
+ console.log(status_str);
+ console.log(response);
+ }
+ });
+ % endif
});
</script>
</%def>
Please sign in to comment.
Something went wrong with that request. Please try again.