mirror of https://github.com/perkeep/perkeep.git
Merge branch 'master' of ssh://camlistore.org:29418/camlistore
This commit is contained in:
commit
f2d3cb893a
|
@ -12,6 +12,7 @@ goog.require('goog.events.EventType');
|
|||
goog.require('goog.ui.Container');
|
||||
goog.require('camlistore.BlobItem');
|
||||
goog.require('camlistore.CreateItem');
|
||||
goog.require('camlistore.ServerConnection');
|
||||
|
||||
|
||||
/**
|
||||
|
@ -166,7 +167,12 @@ camlistore.BlobItemContainer.prototype.resetChildren_ = function() {
|
|||
this.eh_.listen(
|
||||
createItem.getElement(), goog.events.EventType.CLICK,
|
||||
function() {
|
||||
console.log('Clicked');
|
||||
this.connection_.createPermanode(function(p) {
|
||||
window.location = "../?p=" + p;
|
||||
});
|
||||
},
|
||||
function(failMsg) {
|
||||
console.log("Failed to create permanode: " + failMsg);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
|
@ -4,6 +4,17 @@
|
|||
<script src="closure/goog/base.js"></script>
|
||||
<script src="./deps.js"></script>
|
||||
<script src="?camli.mode=config&var=CAMLISTORE_CONFIG"></script>
|
||||
|
||||
<!-- Begin non-Closure cheating; but depended on by server_connection.js -->
|
||||
<script type="text/javascript" src="../base64.js"></script>
|
||||
<script type="text/javascript" src="../Crypto.js"></script>
|
||||
<script type="text/javascript" src="../SHA1.js"></script>
|
||||
<script src="../camli.js"></script>
|
||||
<script>
|
||||
onConfiguration(CAMLISTORE_CONFIG);
|
||||
</script>
|
||||
<!-- End non-Closure cheating -->
|
||||
|
||||
<script>
|
||||
goog.require('camlistore.IndexPage');
|
||||
</script>
|
||||
|
|
|
@ -73,3 +73,15 @@ camlistore.ServerConnection.prototype.getRecentlyUpdatedPermanodesDone_ =
|
|||
}
|
||||
success(result);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {function(string)} success Success callback, called with permanode blobref.
|
||||
* @param {Function=} opt_fail Optional fail callback.
|
||||
*/
|
||||
camlistore.ServerConnection.prototype.createPermanode = function(success, opt_fail) {
|
||||
// TODO: stop depending on camli.js. For now, cheating:
|
||||
camliCreateNewPermanode({
|
||||
success: success,
|
||||
fail: opt_fail
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue