Skip to content

Instantly share code, notes, and snippets.

{
"parser": "babel-eslint",
"env": {
"browser": true,
"node": true,
"worker": true,
"es6": true
},
"globals": {},
"plugins": [
@edspencer
edspencer / APOD-app-tap-listener.js
Created February 11, 2012 08:32
The app.js file for a simple Sencha Touch 2 APOD app
/**
* The final thing is to add a tap listener that is called whenever the user taps on the screen.
* We do a quick check to make sure they're not tapping on the carousel indicators (tapping on
* those indicators moves you between items so we don't want to override that), then either hide
* or show the info Component.
*/
Ext.Viewport.element.on('tap', function(e) {
if (!e.getTarget('.x-carousel-indicator')) {
if (titleVisible) {
info.element.removeCls('apod-title-visible');
(function() {
var originalRequest = Ext.Ajax.request;
Ext.Ajax.request = function(o) {
if (!(/config\/environment/.test(o.url))) {
o.url = String.format("/myprependString/{0}", o.url.replace(/^\//, ''));
}
return originalRequest.call(this, o);
};
+--------------------------+-----------+-----------+-----------+-----------+
| Name | Lines | LOC | Classes | LOC/C |
+--------------------------+-----------+-----------+-----------+-----------+
| Controllers | 1876 | 1288 | 53 | 24 |
| Models | 1466 | 936 | 49 | 19 |
| Views | 9816 | 7035 | 94 | 74 |
| Libraries | 375 | 257 | 5 | 51 |
| Controller Specs | 174 | 119 | 4 | 29 |
| Model Specs | 171 | 134 | 3 | 44 |
| View Specs | 446 | 315 | 3 | 105 |
/**
* Defines all routes required for this application
*/
ExtMVC.router.Router.defineRoutes = function(map) {
/**
* Sets up REST-like urls for a given model or models:
*
* map.resources('users');
*
* Is equivalent to:
edward-spencers-mac-pro:root ed$ ruby script/build auto all
Built Ext MVC Application
Built the ColumnTree plugin
Built the DrilldownLayout plugin
Built the Exporter plugin
Built the GroupNavPanel plugin
Built the Notification plugin
Built the PazPar2 plugin
Built the Printer plugin
=== Contents of ../config/environment.json ===
{
//define the app. files are loaded in this order
overrides : ['Ext.Ajax', 'Ext.Component'],
plugins : ['Printer', 'Notification', 'GroupTabPanel', 'ColumnTree', 'Exporter', 'PazPar2'],
models : ['Operator', 'Fund'],
controllers: ['Application', ']
/**
* @class Ext.ux.HumanReadableGrid
* @extends Ext.grid.GridPanel
* An extended MVC scaffold grid with support for easily showing human-readable strings for associated models
* instead of the default numerical ID. See loadAssociatedModel documentation for implementation details
*/
Ext.ux.HumanReadableGrid = Ext.extend(Ext.grid.GridPanel, {
closable: true,
var combo = new Ext.form.ComboBox({
xtype: 'combo',
name : 'perpage',
width: 40,
listWidth: 40,
store: new Ext.data.ArrayStore({
fields: ['id'],
data : [
['15'],
['25'],
/**
* Copyright 2020 Ed Spencer
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy,
* modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.