欧美性猛交XXXX免费看蜜桃,成人网18免费韩国,亚洲国产成人精品区综合,欧美日韩一区二区三区高清不卡,亚洲综合一区二区精品久久

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費電子書(shū)等14項超值服

開(kāi)通VIP
Cloud Storage  |  Blockly  |  Google Developers

Cloud Storage

If your application is hosted on App Engine, a cloud storage service isavailable that allows users to save, load, share, and publish their programs.

Setting up App Engine

The first objective is to get your own copy of Blockly running on App Engine.

  1. Download and install the Python SDK.
  2. Log into Google App Engine and create an application.
  3. Edit appengine/app.yaml and change the application ID from blockly-demo to the application name you created in the previous step.
  4. Copy (or soft-link) the following files and directories into appengine/static/:
    • demos/
    • msg/
    • media/
    • *_compressed.js
  5. Optional: If you'd like to use blockly_uncompressed.js on the server, also copy that file into appengine/static/, copy core into appengine/static/, and copy closure-library/ into the parent directory, appengine/.
  6. Optional: If you'd like to run the Blockly Playground, you'll have to copy the blocks, generators, and tests directories, as well as the files in step 5.
  7. Run the Google App Engine Launcher from the GUI, add your appengine directory as an existing application, and press the "Deploy" button. If you prefer to use the command line, run: appcfg.py --oauth2 update appengine/.

Once Blockly is uploaded you can point a browser to the URL you created in step 2. You should see a list of demos, including the cloud storage demo.

Talking to the Cloud

Examine the source of the storage demoat demos/storage/index.htmland note the following features.First, there is a script include that loads the cloud storage API:

<script src="/storage.js"></script>

Note that this script assumes there is only one Blockly workspace on the page.There are also these message definitions, which you should modify as desired:

BlocklyStorage.HTTPREQUEST_ERROR = 'There was a problem with the request.\n';
BlocklyStorage.LINK_ALERT = 'Share your blocks with this link:\n\n%1';
BlocklyStorage.HASH_ERROR = 'Sorry, "%1" doesn\'t correspond with any saved Blockly file.';
BlocklyStorage.XML_ERROR = 'Could not load your saved file.\n' +
    'Perhaps it was created with a different version of Blockly?';

Translations of these messages into other languages can be found in Blockly Games inthe json directory.

Saving the current blocks is a single call to BlocklyStorage.link():

<button onclick="BlocklyStorage.link()">Save Blocks</button>

To restore saved blocks on page load, just call BlocklyStorage.retrieveXml with the URL's hash after Blockly has been injected:

if ('BlocklyStorage' in window && window.location.hash.length > 1) {
  BlocklyStorage.retrieveXml(window.location.hash.substring(1));
}

Local Storage

The storage.js API also offers the ability to save a single set of blocks inthe browser's local storage. This may be implemented instead of cloud storage,or in addition with cloud storage (though in the latter case one has to becareful of both types of storage attempting to restore at once).

To restore blocks from local storage, call BlocklyStorage.restoreBlocks in atimeout right after Blockly has been injected.

window.setTimeout(BlocklyStorage.restoreBlocks, 0);

To automatically backup the blocks into local storage when the user leaves thepage, call BlocklyStorage.backupOnUnload and it will register an eventlistener on the page's unload event.

BlocklyStorage.backupOnUnload();

Example

Here isa live demoof cloud storage.

本站僅提供存儲服務(wù),所有內容均由用戶(hù)發(fā)布,如發(fā)現有害或侵權內容,請點(diǎn)擊舉報。
打開(kāi)APP,閱讀全文并永久保存 查看更多類(lèi)似文章
猜你喜歡
類(lèi)似文章
【震驚】Scratch竟然還有這樣一本書(shū)
ITeye Java編程 Spring框架 Ajax技術(shù) agile敏捷軟件開(kāi)發(fā) ruby on r...
Google發(fā)布可視化編程工具Blockly 1.0
八大著(zhù)名IT企業(yè)云計算策略
Best Cloud Storage 2017: Cloud Storage Reviews
Readings in Databases by Reynold Xin
更多類(lèi)似文章 >>
生活服務(wù)
分享 收藏 導長(cháng)圖 關(guān)注 下載文章
綁定賬號成功
后續可登錄賬號暢享VIP特權!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服

欧美性猛交XXXX免费看蜜桃,成人网18免费韩国,亚洲国产成人精品区综合,欧美日韩一区二区三区高清不卡,亚洲综合一区二区精品久久