This repository has been archived by the owner on Mar 19, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
247 additions
and
0 deletions.
There are no files selected for viewing
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
(function() { | ||
var url = getUrl(), | ||
thisDir = getDir(url), | ||
params = getMergedQueryParams(url), | ||
theme = getTheme(params), | ||
css = getCss(theme), | ||
js = getJs(theme); | ||
|
||
document.write(Ext.String.format('<link rel="stylesheet" type="text/css" href="{0}/../../resources/css/ext-{1}.css" />', thisDir, css)); | ||
|
||
if (js) { | ||
document.write(Ext.String.format('<script type="text/javascript" src="{0}/../../ext-{1}.js"></script>', thisDir, js)); | ||
} | ||
|
||
if (params.themes_combo != null) { | ||
Ext.require('Ext.panel.Panel'); | ||
Ext.require('Ext.data.ArrayStore'); | ||
Ext.require('Ext.form.field.ComboBox'); | ||
|
||
Ext.onReady(function() { | ||
Ext.create('Ext.panel.Panel', { | ||
autoShow: true, | ||
frame: true, | ||
renderTo: Ext.getBody(), | ||
items: { | ||
editable: false, | ||
fieldLabel: 'Theme', | ||
labelWidth: 50, | ||
value: theme, | ||
width: 180, | ||
xtype: 'combo', | ||
listeners: { | ||
change: function(combo, value) { | ||
params.theme = value; | ||
|
||
location.search = Ext.Object.toQueryString(params); | ||
} | ||
}, | ||
store: [ | ||
['classic', 'Classic'], | ||
['gray', 'Gray'], | ||
['access', 'Accessibility'], | ||
['neptune', 'Neptune'] | ||
], | ||
style: { | ||
margin: '2px' | ||
} | ||
}, | ||
style: { | ||
position: 'absolute', | ||
right: '10px', | ||
top: '10px' | ||
} | ||
}); | ||
}); | ||
} | ||
|
||
// Extract the URL used to load this script file | ||
function getUrl() { | ||
var scripts = document.getElementsByTagName('script'), | ||
thisScript = scripts[scripts.length - 1]; | ||
|
||
return thisScript.src; | ||
} | ||
|
||
// The directory of this script file | ||
function getDir(url) { | ||
return url.slice(0, url.lastIndexOf('/')); | ||
} | ||
|
||
// Combines the query parameters from the page URL and the script URL | ||
function getMergedQueryParams(url) { | ||
var searchIndex = url.indexOf('?'), | ||
parse = Ext.Object.fromQueryString; | ||
|
||
return Ext.apply(searchIndex === -1 ? {} : parse(url.slice(searchIndex)), parse(location.search)); | ||
} | ||
|
||
// Get the canonical theme name from the query parameters | ||
function getTheme(params) { | ||
return { | ||
access: 'access', | ||
accessibility: 'access', | ||
gray: 'gray', | ||
grey: 'gray', | ||
neptune: 'neptune' | ||
}[params.theme || params.css] || 'classic'; | ||
} | ||
|
||
// Get the CSS file name from the theme name | ||
function getCss(theme) { | ||
return { | ||
access: 'all-access', | ||
classic: 'all', | ||
gray: 'all-gray', | ||
neptune: 'neptune' | ||
}[theme]; | ||
} | ||
|
||
// Get the JS file name from the theme name | ||
function getJs(theme) { | ||
return { | ||
neptune: 'neptune' | ||
}[theme]; | ||
} | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// some data used in the examples | ||
Ext.namespace('Ext.example'); | ||
|
||
Ext.example.states = [ | ||
['AL', 'Alabama', 'The Heart of Dixie'], | ||
['AK', 'Alaska', 'The Land of the Midnight Sun'], | ||
['AZ', 'Arizona', 'The Grand Canyon State'], | ||
['AR', 'Arkansas', 'The Natural State'], | ||
['CA', 'California', 'The Golden State'], | ||
['CO', 'Colorado', 'The Mountain State'], | ||
['CT', 'Connecticut', 'The Constitution State'], | ||
['DE', 'Delaware', 'The First State'], | ||
['DC', 'District of Columbia', "The Nation's Capital"], | ||
['FL', 'Florida', 'The Sunshine State'], | ||
['GA', 'Georgia', 'The Peach State'], | ||
['HI', 'Hawaii', 'The Aloha State'], | ||
['ID', 'Idaho', 'Famous Potatoes'], | ||
['IL', 'Illinois', 'The Prairie State'], | ||
['IN', 'Indiana', 'The Hospitality State'], | ||
['IA', 'Iowa', 'The Corn State'], | ||
['KS', 'Kansas', 'The Sunflower State'], | ||
['KY', 'Kentucky', 'The Bluegrass State'], | ||
['LA', 'Louisiana', 'The Bayou State'], | ||
['ME', 'Maine', 'The Pine Tree State'], | ||
['MD', 'Maryland', 'Chesapeake State'], | ||
['MA', 'Massachusetts', 'The Spirit of America'], | ||
['MI', 'Michigan', 'Great Lakes State'], | ||
['MN', 'Minnesota', 'North Star State'], | ||
['MS', 'Mississippi', 'Magnolia State'], | ||
['MO', 'Missouri', 'Show Me State'], | ||
['MT', 'Montana', 'Big Sky Country'], | ||
['NE', 'Nebraska', 'Beef State'], | ||
['NV', 'Nevada', 'Silver State'], | ||
['NH', 'New Hampshire', 'Granite State'], | ||
['NJ', 'New Jersey', 'Garden State'], | ||
['NM', 'New Mexico', 'Land of Enchantment'], | ||
['NY', 'New York', 'Empire State'], | ||
['NC', 'North Carolina', 'First in Freedom'], | ||
['ND', 'North Dakota', 'Peace Garden State'], | ||
['OH', 'Ohio', 'The Heart of it All'], | ||
['OK', 'Oklahoma', 'Oklahoma is OK'], | ||
['OR', 'Oregon', 'Pacific Wonderland'], | ||
['PA', 'Pennsylvania', 'Keystone State'], | ||
['RI', 'Rhode Island', 'Ocean State'], | ||
['SC', 'South Carolina', 'Nothing Could be Finer'], | ||
['SD', 'South Dakota', 'Great Faces, Great Places'], | ||
['TN', 'Tennessee', 'Volunteer State'], | ||
['TX', 'Texas', 'Lone Star State'], | ||
['UT', 'Utah', 'Salt Lake State'], | ||
['VT', 'Vermont', 'Green Mountain State'], | ||
['VA', 'Virginia', 'Mother of States'], | ||
['WA', 'Washington', 'Green Tree State'], | ||
['WV', 'West Virginia', 'Mountain State'], | ||
['WI', 'Wisconsin', "America's Dairyland"], | ||
['WY', 'Wyoming', 'Like No Place on Earth'] | ||
]; |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<!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>Toolbar with Menus</title> | ||
<script type="text/javascript" src="../../extjs/ext-all.js"></script> | ||
<script type="text/javascript" src="../../extjs/examples/shared/include-theme.js"></script> | ||
|
||
<link rel="stylesheet" type="text/css" href="../../extjs/examples/shared/example.css" /> | ||
<script type="text/javascript" src="../../extjs/examples/shared/examples.js"></script> | ||
<script type="text/javascript" src="../../extjs/examples/shared/states.js"></script> | ||
|
||
<script type="text/javascript" src="app-all.js"></script> | ||
<link rel="stylesheet" type="text/css" href="menus.css" /> | ||
|
||
<!-- GC --> | ||
|
||
<script type="text/javascript"> | ||
|
||
var _gaq = _gaq || []; | ||
_gaq.push(['_setAccount', 'UA-35706805-1']); | ||
_gaq.push(['_trackPageview']); | ||
|
||
(function() { | ||
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; | ||
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; | ||
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); | ||
})(); | ||
|
||
</script> | ||
</head> | ||
<body> | ||
<h1>Toolbar with Menus</h1> | ||
<p>The js is not minified so it is readable. See <a href="https://github.com/astrada/ocaml-extjs/blob/master/examples/toolbars/menu/menus.ml">menus.ml</a>.</p> | ||
|
||
<div id="container"> | ||
<div id="toolbar"></div> | ||
</div> | ||
|
||
<br /><br /><br /><br /><br /> | ||
</body> | ||
</html> |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#container { | ||
width:750px; | ||
height:300px; | ||
border:3px solid #c3daf9; | ||
} | ||
|
||
.calendar { | ||
background-image:url(../../extjs/resources/themes/images/default/shared/calendar.gif) !important; | ||
} | ||
|
||
.blist { | ||
background-image: url(list-items.gif) !important; | ||
} | ||
|
||
.bmenu { | ||
background-image: url(menu-show.gif) !important; | ||
} | ||
|
||
.menu-title{ | ||
background: #D6E3F2; | ||
border-style: solid; | ||
border-color:#DAE6F4 #99bbe8 #99bbe8 #DAE6F4; | ||
border-width: 1px; | ||
margin:-2px -2px 0; | ||
color:#15428b; | ||
font:bold 10px tahoma,arial,verdana,sans-serif; | ||
display:block; | ||
padding:3px; | ||
} | ||
|
||
.user { | ||
background-image:url(../../extjs/examples/shared/icons/fam/user.gif) !important | ||
} | ||
.edit { | ||
background-image:url(../../extjs/examples/toolbar/images/im32x32.gif) !important; | ||
} | ||
.add { | ||
background-image:url(../../extjs/examples/button/images/add.gif) !important; | ||
} |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.