UNPKG

toloframework

Version:

Javascript/HTML/CSS compiler for Firefox OS or nodewebkit apps using modules in the nodejs style.

1 lines 6.52 kB
{"intl":"","src":"require( 'tp4.wysiwyg-editor', function(exports, module) { \"use strict\";\r\nvar Widget = require(\"wdg\");\r\n\r\n/**\r\n * @example\r\n * var WysiwygEditor = require(\"tp4.wysiwyg-editor\");\r\n * var instance = new WysiwygEditor( options );\r\n * @class WysiwygEditor\r\n */\r\nvar WysiwygEditor = function( options ) {\r\n var that = this;\r\n\r\n Widget.call(this);\r\n this.addClass(\"tp4-wysiwyg-editor\");\r\n\r\n var header = Widget.div( 'header' );\r\n var iframe = Widget.tag( 'iframe' ); \r\n iframe.attr( 'src', 'squire/squire.html' );\r\n iframe.addEvent( 'load', function() {\r\n // Storing a reference to the wysiwyg editor.\r\n that._squire = iframe.contentWindow.editor;\r\n if( that._postponedHTML ) {\r\n that._squire.setHTML( that._postponedHTML );\r\n delete that._postponedHTML;\r\n initHeader.call( that, header );\r\n }\r\n });\r\n\r\n this.append( header, iframe );\r\n};\r\n\r\n// Extension of Widget.\r\nWysiwygEditor.prototype = Object.create(Widget.prototype);\r\nWysiwygEditor.prototype.constructor = WysiwygEditor;\r\n\r\n\r\n/**\r\n * Get/Set the HTML content of the editor.\r\n */\r\nObject.defineProperty( WysiwygEditor.prototype, 'content', {\r\n get: function() {\r\n if( typeof this._squire === 'undefined' ) {\r\n // IFrame is not ready.\r\n return this._postponedHTML || \"\";\r\n }\r\n return this._squire.getHTML();\r\n },\r\n set: function( html ) {\r\n if( typeof this._squire === 'undefined' ) {\r\n // IFrame is not ready. We store the `html` and it\r\n // will be inserted as soon as the iframe will be\r\n // loaded.\r\n this._postponedHTML = html;\r\n return;\r\n }\r\n this._squire.setHTML( html );\r\n },\r\n configurable: false,\r\n enumarable: true\r\n});\r\n\r\n\r\nfunction initHeader( header ) {\r\n \r\n}\r\n\r\n\r\nWysiwygEditor.create = function( options ) {\r\n return new WysiwygEditor( options );\r\n};\r\nmodule.exports = WysiwygEditor;\r\n });\r\n","zip":"require(\"tp4.wysiwyg-editor\",function(t,e){\"use strict\";function i(t){}var r=require(\"wdg\"),o=function(t){var e=this;r.call(this),this.addClass(\"tp4-wysiwyg-editor\");var o=r.div(\"header\"),n=r.tag(\"iframe\");n.attr(\"src\",\"squire/squire.html\"),n.addEvent(\"load\",function(){e._squire=n.contentWindow.editor,e._postponedHTML&&(e._squire.setHTML(e._postponedHTML),delete e._postponedHTML,i.call(e,o))}),this.append(o,n)};o.prototype=Object.create(r.prototype),o.prototype.constructor=o,Object.defineProperty(o.prototype,\"content\",{get:function(){return\"undefined\"==typeof this._squire?this._postponedHTML||\"\":this._squire.getHTML()},set:function(t){return\"undefined\"==typeof this._squire?void(this._postponedHTML=t):void this._squire.setHTML(t)},configurable:!1,enumarable:!0}),o.create=function(t){return new o(t)},e.exports=o});\n//# sourceMappingURL=tp4.wysiwyg-editor.js.map","map":{"version":3,"file":"tp4.wysiwyg-editor.js.map","sources":["tp4.wysiwyg-editor.js"],"sourcesContent":["require( 'tp4.wysiwyg-editor', function(exports, module) { \"use strict\";\r\nvar Widget = require(\"wdg\");\r\n\r\n/**\r\n * @example\r\n * var WysiwygEditor = require(\"tp4.wysiwyg-editor\");\r\n * var instance = new WysiwygEditor( options );\r\n * @class WysiwygEditor\r\n */\r\nvar WysiwygEditor = function( options ) {\r\n var that = this;\r\n\r\n Widget.call(this);\r\n this.addClass(\"tp4-wysiwyg-editor\");\r\n\r\n var header = Widget.div( 'header' );\r\n var iframe = Widget.tag( 'iframe' ); \r\n iframe.attr( 'src', 'squire/squire.html' );\r\n iframe.addEvent( 'load', function() {\r\n // Storing a reference to the wysiwyg editor.\r\n that._squire = iframe.contentWindow.editor;\r\n if( that._postponedHTML ) {\r\n that._squire.setHTML( that._postponedHTML );\r\n delete that._postponedHTML;\r\n initHeader.call( that, header );\r\n }\r\n });\r\n\r\n this.append( header, iframe );\r\n};\r\n\r\n// Extension of Widget.\r\nWysiwygEditor.prototype = Object.create(Widget.prototype);\r\nWysiwygEditor.prototype.constructor = WysiwygEditor;\r\n\r\n\r\n/**\r\n * Get/Set the HTML content of the editor.\r\n */\r\nObject.defineProperty( WysiwygEditor.prototype, 'content', {\r\n get: function() {\r\n if( typeof this._squire === 'undefined' ) {\r\n // IFrame is not ready.\r\n return this._postponedHTML || \"\";\r\n }\r\n return this._squire.getHTML();\r\n },\r\n set: function( html ) {\r\n if( typeof this._squire === 'undefined' ) {\r\n // IFrame is not ready. We store the `html` and it\r\n // will be inserted as soon as the iframe will be\r\n // loaded.\r\n this._postponedHTML = html;\r\n return;\r\n }\r\n this._squire.setHTML( html );\r\n },\r\n configurable: false,\r\n enumarable: true\r\n});\r\n\r\n\r\nfunction initHeader( header ) {\r\n \r\n}\r\n\r\n\r\nWysiwygEditor.create = function( options ) {\r\n return new WysiwygEditor( options );\r\n};\r\nmodule.exports = WysiwygEditor;\r\n });\r\n"],"names":["require","exports","module","initHeader","header","Widget","WysiwygEditor","options","that","this","call","addClass","div","iframe","tag","attr","addEvent","_squire","contentWindow","editor","_postponedHTML","setHTML","append","prototype","Object","create","constructor","defineProperty","get","getHTML","set","html","configurable","enumarable"],"mappings":"AAAAA,QAAS,qBAAsB,SAASC,EAASC,GAAW,YA8D5D,SAASC,GAAYC,IA7DrB,GAAIC,GAASL,QAAQ,OAQjBM,EAAgB,SAAUC,GAC1B,GAAIC,GAAOC,IAEXJ,GAAOK,KAAKD,MACZA,KAAKE,SAAS,qBAEd,IAAIP,GAASC,EAAOO,IAAK,UACrBC,EAASR,EAAOS,IAAK,SACzBD,GAAOE,KAAM,MAAO,sBACpBF,EAAOG,SAAU,OAAQ,WAErBR,EAAKS,QAAUJ,EAAOK,cAAcC,OAChCX,EAAKY,iBACLZ,EAAKS,QAAQI,QAASb,EAAKY,sBACpBZ,GAAKY,eACZjB,EAAWO,KAAMF,EAAMJ,MAI/BK,KAAKa,OAAQlB,EAAQS,GAIzBP,GAAciB,UAAYC,OAAOC,OAAOpB,EAAOkB,WAC/CjB,EAAciB,UAAUG,YAAcpB,EAMtCkB,OAAOG,eAAgBrB,EAAciB,UAAW,WAC5CK,IAAK,WACD,MAA4B,mBAAjBnB,MAAKQ,QAELR,KAAKW,gBAAkB,GAE3BX,KAAKQ,QAAQY,WAExBC,IAAK,SAAUC,GACX,MAA4B,mBAAjBtB,MAAKQ,aAIZR,KAAKW,eAAiBW,OAG1BtB,MAAKQ,QAAQI,QAASU,IAE1BC,cAAc,EACdC,YAAY,IAShB3B,EAAcmB,OAAS,SAAUlB,GAC7B,MAAO,IAAID,GAAeC,IAE9BL,EAAOD,QAAUK"},"dependencies":["mod/tp4.wysiwyg-editor","mod/wdg"]}