Skip to content

Instantly share code, notes, and snippets.

@andersevenrud
Last active February 17, 2016 20:51
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andersevenrud/3ce81c9be9d8a6b8aa08 to your computer and use it in GitHub Desktop.
Save andersevenrud/3ce81c9be9d8a6b8aa08 to your computer and use it in GitHub Desktop.
(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