Last active
February 17, 2016 20:51
-
-
Save andersevenrud/3ce81c9be9d8a6b8aa08 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(Application, GUI, Dialogs, Utils, API, VFS) { | |
'use strict'; | |
///////////////////////////////////////////////////////////////////////////// | |
// APPLICATION | |
///////////////////////////////////////////////////////////////////////////// | |
function ApplicationFooBar(args, metadata) { | |
Application.apply(this, ['ApplicationFooBar', args, metadata, { | |
src: 'data/index.html', | |
title: metadata.name, | |
icon: metadata.icon, | |
width: 640, | |
height: 480, | |
allow_resize: false, | |
allow_restore: false, | |
allow_maximize: false | |
}]); | |
} | |
ApplicationFooBar.prototype = Object.create(Application.prototype); | |
// When you get message back from IFRAME | |
ApplicationFooBar.prototype.onPostMessage = function(message, ev) { | |
alert('Value of "foo" is: ' + message.foo); | |
}; | |
// Call this to send message to iframe (example) | |
ApplicationFooBar.prototype.myMethodSomething = function() { | |
this.postMessage({bar: 'baz'}); | |
}; | |
///////////////////////////////////////////////////////////////////////////// | |
// EXPORTS | |
///////////////////////////////////////////////////////////////////////////// | |
OSjs.Applications = OSjs.Applications || {}; | |
OSjs.Applications.ApplicationFooBar = OSjs.Applications.ApplicationFooBar || {}; | |
OSjs.Applications.ApplicationFooBar.Class = ApplicationFooBar; | |
})(OSjs.Helpers.IFrameApplication, OSjs.GUI, OSjs.Dialogs, OSjs.Utils, OSjs.API, OSjs.VFS); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment