Adding email button files

This commit is contained in:
Pedro Beschorner Marin 2014-11-13 15:50:48 -02:00
parent e8456c7ce5
commit 2aa08a5d33
4 changed files with 96 additions and 0 deletions

View File

@ -0,0 +1,7 @@
package org.bigbluebutton.clientcheck.view.mainview
{
public interface IMailButton
{
function dispose(): void;
}
}

View File

@ -0,0 +1,17 @@
package org.bigbluebutton.clientcheck.view.mainview
{
import spark.components.Button;
public class MailButton extends Button implements IMailButton
{
public function MailButton()
{
super();
}
public function dispose():void
{
}
}
}

View File

@ -0,0 +1,25 @@
package org.bigbluebutton.clientcheck.view.mainview
{
import robotlegs.bender.extensions.mediatorMap.api.IMediatorMap;
import robotlegs.bender.framework.api.IConfig;
import robotlegs.bender.framework.api.IInjector;
public class MailButtonConfig implements IConfig
{
[Inject]
public var injector:IInjector;
[Inject]
public var mediatorMap:IMediatorMap;
public function configure():void
{
configureMediators();
}
private function configureMediators():void
{
mediatorMap.map(IMailButton).toMediator(MailButtonMediator);
}
}
}

View File

@ -0,0 +1,47 @@
package org.bigbluebutton.clientcheck.view.mainview
{
import flash.events.MouseEvent;
import flash.net.URLRequest;
import flash.net.URLVariables;
import flash.net.URLRequestMethod;
import flash.net.navigateToURL;
import org.bigbluebutton.clientcheck.model.IXMLConfig;
import org.bigbluebutton.clientcheck.model.IDataProvider;
import robotlegs.bender.bundles.mvcs.Mediator;
public class MailButtonMediator extends Mediator
{
[Inject]
public var view: IMailButton;
[Inject]
public var config: IXMLConfig;
[Inject]
public var dp: IDataProvider;
/**
* Initialize listener
*/
override public function initialize():void
{
(view as MailButton).addEventListener(MouseEvent.CLICK, mouseClickHandler);
}
/**
* Handle events to compose email
*/
private function mouseClickHandler(e:MouseEvent):void
{
var mailMsg:URLRequest = new URLRequest('mailto:' + config.getAdmMail());
var variables:URLVariables = new URLVariables();
variables.subject = "BigBlueButton Client Check";
variables.body = dp.getAllDataAsString();
mailMsg.data = variables;
mailMsg.method = URLRequestMethod.GET;
navigateToURL(mailMsg, "_self");
}
}
}