Skip to content

Instantly share code, notes, and snippets.

@markhealey
Last active August 29, 2015 13:57
Show Gist options
  • Save markhealey/9673632 to your computer and use it in GitHub Desktop.
Save markhealey/9673632 to your computer and use it in GitHub Desktop.
F2 iOS goodies
<section class="f2-app" style="position: static;">
<header class="clearfix">
<h2 class="pull-left f2-app-title">
{{APP NAME from appConfig.name}}
</h2>
</header>
<div class="f2-app-view f2-app-container {{APP ID from appConfig.appId}}">
{{ APP HTML }}
</div>
</section>

App Manifest

App manifestUrl: http://www.openf2.org/Examples/Apps

AppConfigs

Quote

[{
    "appId": "com_openf2_examples_javascript_quote",
    "manifestUrl": "http://www.openf2.org/Examples/Apps",
    "minGridSize": 3,
    "name": "Snap Quote"
}]

Chart

[{
    "appId": "com_openf2_examples_csharp_chart",
    "manifestUrl": "http://www.openf2.org/Examples/Apps",
    "minGridSize": 6,
    "name": "One Year Price Movement"
}]

Market News

[{
    "appId": "com_openf2_examples_csharp_marketnews",
    "manifestUrl": "http://www.openf2.org/Examples/Apps",
    "minGridSize": 6,
    "name": "Market News"
}]

Watchlist

[{
    "appId": "com_f2_examples_javascript_watchlist",
    "manifestUrl": "http://www.openf2.org/Examples/Apps",
    "minGridSize": 3,
    "name": "Watchlist"
}]

Stock News

[{
    "appId": "com_openf2_examples_csharp_stocknews",
    "manifestUrl": "http://www.openf2.org/Examples/Apps",
    "minGridSize": 4,
    "name": "Stock News"
}]

Events

These are the events supported by these apps, both publish and subscribe.

Symbol change

Event name: F2.Constants.Events.CONTAINER_SYMBOL_CHANGE Event data: { symbol: 'MSFT', name: 'Microsoft Corp' }

This event gets fired by some apps and the Container then picks it up and fires the CONTAINER_SYMBOL_CHANGE event in response. See this code to understand what I mean.

Event name: F2.Constants.Events.APP_SYMBOL_CHANGE Event data: { symbol: 'MSFT', name: 'Microsoft Corp' }

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Title</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Le styles -->
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="row">
<div class="span12">
<!--apps should get inserted in here using app_template.html format below-->
</div>
</div>
</div>
<!-- Le javascript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="//code.jquery.com/jquery-2.1.0.min.js"></script>
<script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/F2/1.3.2/f2.min.js"></script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment