项目作者: STRd6

项目描述 :
It edits pixels
高级语言: CoffeeScript
项目地址: git://github.com/STRd6/pixel-editor.git
创建时间: 2013-09-28T23:51:14Z
项目社区:https://github.com/STRd6/pixel-editor

开源协议:MIT License

下载


Pixel Editor

It edits pixels

Live Demo

Embedding Instructions

The editor will send a postMessage to its parent window when “Save” is clicked.

One thing to note is that this is pointing to the latest version of
https://danielx.net/pixel-editor/ so it might break out from under you. You’d
probably want to host a stable version of the editor on your own service after
you get it working if you care about that kind of thing.

  1. <html>
  2. <body>
  3. </body>
  4. <iframe src="https://danielx.net/pixel-editor/" width="100%" height="100%"></iframe>
  5. <script>
  6. window.addEventListener("message", receiveMessage, false);
  7. function receiveMessage(event) {
  8. var origin = event.origin;
  9. if (origin !== "https://danielx.net") {
  10. return;
  11. }
  12. var data = event.data;
  13. if (data.method === "save") {
  14. var image = data.image; // HTML5 Blob object
  15. var width = data.width;
  16. var height = data.height;
  17. // Post to your server, etc
  18. console.log(data);
  19. }
  20. }
  21. <\/script>
  22. </html>

Developer Instructions

Fork on Github https://github.com/STRd6/pixel-editor/fork

Go to http://danielx.net/editor

Load your fork by clicking “Load Repo” and typing in “/pixel-editor”

When it loads click “Run” to make sure it works

Click “New Feature” to start working on a feature branch

Modify the code and click “Run” to see your changes.

Click “Save” to push the code to your feature branch

Review your branch on Github to make a pull request.

Hopefully that works, but if not open an issue at https://github.com/STRd6/editor/issues/
and let me know what’s not working.