Permalink
Browse files

Initial ExtJS loader test program

  • Loading branch information...
1 parent e3f13b7 commit 6b1744e2361b96629fcc08d26dab51cbb78afc52 @cadorn cadorn committed Dec 1, 2011
@@ -0,0 +1,12 @@
+
+
+Usage
+=====
+
+ commonjs --script serve ./ -v ./
+
+
+Links
+=====
+
+ * http://www.sencha.com/learn/sencha-class-system
@@ -0,0 +1,29 @@
+{
+ "uid": "http://github.com/pinf/loader-js/programs/extjs-loader-test/",
+ "main": "server.js",
+ "directories": {
+ "lib": ""
+ },
+ "scripts": {
+ "serve": {
+ "id": "github.com/pinf/server-js/"
+ }
+ },
+ "mappings": {
+ "pinf": {
+ "id": "pinf.org/loader/"
+ },
+ "nodejs": {
+ "id": "nodejs.org/"
+ },
+ "modules": {
+ "id": "github.com/pinf/modules-js/"
+ },
+ "server": {
+ "id": "github.com/pinf/server-js/"
+ },
+ "extjs4": {
+ "id": "sencha.com/products/extjs4/"
+ }
+ }
+}
@@ -0,0 +1,28 @@
+{
+ "extends": [
+ {
+ "location": "https://raw.github.com/pinf/server-js/v0.1.19/program.packages.json"
+ },
+ {
+ "location": "./program.packages.json"
+ }
+ ],
+ "boot": "github.com/pinf/loader-js/programs/extjs-loader-test/",
+ "implements": {
+ "github.com/pinf/server-js/-meta/strawman/vhost/0.1": {
+ }
+ },
+ "packages": {
+ "github.com/pinf/loader-js/programs/extjs-loader-test/": {
+ "locator": {
+ "location": "./"
+ }
+ },
+ "github.com/pinf/server-js/": {
+ "locator": {
+ "location": false,
+ "archive": "https://github.com/pinf/server-js/zipball/v0.1.19"
+ }
+ }
+ }
+}
@@ -0,0 +1,10 @@
+{
+ "packages": {
+ "sencha.com/products/extjs4/": {
+ "locator": {
+ "archive": "http://extjs.cachefly.net/ext-4.0.2-commercial.zip",
+ "resource": true
+ }
+ }
+ }
+}
@@ -0,0 +1,36 @@
+
+var JSGI = require("server/vendor/connect/middleware/jsgi"),
+ JSGI_RELOAD = require("server/jsgi/reload"),
+ PROGRAM_SERVER = require("pinf/program-server"),
+ FILE = require("modules/file");
+
+exports.main = function(options)
+{
+ var CONNECT = options.stacks.connect.instance;
+
+ console.log("ExtJS source root path: " + require.pkg("extjs4").id());
+
+ options.stacks.connect.start(
+
+ CONNECT()
+
+ .use('/extjs4', CONNECT.static(require.pkg("extjs4").id(), {
+ maxAge: 0
+ }))
+ .use('/ui', JSGI.jsgi(
+ new PROGRAM_SERVER.JSGI({
+ map: {
+ "/ui.js": {
+ programPath: FILE.dirname(module.id) + "/ui/program.json"
+ }
+ },
+ trackRoutes: true
+ }).responder(null)
+ ))
+ .use('/', CONNECT.static(FILE.dirname(module.id) + "/www", {
+ maxAge: 0
+ }))
+ );
+
+ module.print("Program server started! You can now browse to: http://localhost:" + options.port + "/\n");
+}
@@ -0,0 +1,60 @@
+
+exports.main = function(env)
+{
+
+
+ Ext.require('Ext.tab.*');
+
+ Ext.onReady(function(){
+ // basic tabs 1, built from existing content
+ var tabs = Ext.createWidget('tabpanel', {
+ renderTo: 'tabs1',
+ width: 450,
+ activeTab: 0,
+ defaults :{
+ bodyPadding: 10
+ },
+ items: [{
+ contentEl:'script',
+ title: 'Short Text',
+ closable: true
+ },{
+ contentEl:'markup',
+ title: 'Long Text'
+ }]
+ });
+
+ // second tabs built from JS
+ var tabs2 = Ext.createWidget('tabpanel', {
+ renderTo: document.body,
+ activeTab: 0,
+ width: 600,
+ height: 250,
+ plain: true,
+ defaults :{
+ autoScroll: true,
+ bodyPadding: 10
+ },
+ items: [{
+ title: 'Normal Tab',
+ html: "My content was added during construction."
+ },{
+ title: 'Event Tab',
+ listeners: {
+ activate: function(tab){
+ alert(tab.title + ' was activated.');
+ }
+ },
+ html: "I am tab 4's content. I also have an event listener attached."
+ },{
+ title: 'Disabled Tab',
+ disabled: true,
+ html: "Can't see me cause I'm disabled"
+ }
+ ]
+ });
+ });
+
+
+}
+
@@ -0,0 +1,9 @@
+{
+ "uid": "http://github.com/pinf/loader-js/programs/extjs-loader-test/ui/",
+ "main": "main.js",
+ "mappings": {
+ "extjs4": {
+ "id": "sencha.com/products/extjs4/"
+ }
+ }
+}
@@ -0,0 +1,18 @@
+{
+ "extends": {
+ "location": "../program.packages.json"
+ },
+ "boot": "github.com/pinf/loader-js/programs/extjs-loader-test/ui/",
+ "contexts": {
+ "top": {
+ "github.com/pinf/loader-js/programs/extjs-loader-test/ui/": {}
+ }
+ },
+ "packages": {
+ "github.com/pinf/loader-js/programs/extjs-loader-test/ui/": {
+ "locator": {
+ "location": "./"
+ }
+ }
+ }
+}
@@ -0,0 +1,47 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <title>ExtJS PINF Loader Test</title>
+ <link rel="stylesheet" type="text/css" href="/extjs4/resources/css/ext-all.css" />
+ <script type="text/javascript" src="/extjs4/ext-all.js"></script>
+ <script type="text/javascript" src="/ui.js"></script>
+ <style>
+ .list {
+ padding-left: 16px;
+ padding-bottom: 10px;
+ }
+ .list li{
+ list-style: square;
+ padding: 2px;
+ }
+
+ pre {
+ font-size: 11px;
+ }
+ </style>
+</head>
+<body>
+
+ <div id="tabs1">
+ <div id="script" class="x-hide-display">
+ <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed metus nibh, sodales a, porta at, vulputate
+ eget, dui. Pellentesque ut nisl. Maecenas tortor turpis, interdum non, sodales non, iaculis ac, lacus.
+ <br/><br/>
+ Vestibulum auctor, tortor quis iaculis malesuada, libero lectus bibendum purus, sit amet tincidunt quam turpis
+ vel lacus. In pellentesque nisl non sem. Suspendisse nunc sem, pretium eget, cursus a, fringilla vel, urna.</p>
+ </div>
+ <div id="markup" class="x-hide-display">
+ <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed metus nibh, sodales a, porta at, vulputate
+ eget, dui. Pellentesque ut nisl. Maecenas tortor turpis, interdum non, sodales non, iaculis ac, lacus.
+ Vestibulum auctor, tortor quis iaculis malesuada, libero lectus bibendum purus, sit amet tincidunt quam turpis
+ vel lacus. In pellentesque nisl non sem. Suspendisse nunc sem, pretium eget, cursus a, fringilla vel, urna.
+ <br/><br/>
+ Aliquam commodo ullamcorper erat. Nullam vel justo in neque porttitor laoreet. Aenean lacus dui, consequat eu,
+ adipiscing eget, nonummy non, nisi. Morbi nunc est, dignissim non, ornare sed, luctus eu, massa. Vivamus eget
+ quam. Vivamus tincidunt diam nec urna. Curabitur velit.</p>
+ </div>
+ </div>
+
+</body>
+</html>

0 comments on commit 6b1744e

Please sign in to comment.