canvas3 wip - testing simple api, children
[fnpeditor.git] / modules / documentCanvas / canvas / canvas.js
1 define([
2 'libs/jquery-1.9.1.min',
3 'modules/documentCanvas/canvas/documentElement'
4 ], function($, documentElement) {
5     
6 'use strict';
7
8 var Canvas = function(xml) {
9     xml = $.parseXML(xml);
10     this.d = xml !== null ? $(xml.childNodes[0]) : null;
11 }
12
13 $.extend(Canvas.prototype, {
14
15     doc: function() {
16         if(this.d === null)
17             return null;
18         return documentElement.wrap(this.d.get(0)); //{wlxmlTag: this.d.prop('tagName')};
19     }
20
21 });
22
23 return {
24     fromXML: function(xml) {
25         return new Canvas(xml);
26     }
27 };
28
29 });