summaryrefslogtreecommitdiff
path: root/docroot/classes/sme.namespace.js
blob: 05ad12525ebd59183ce64e26aa0769e5626178a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
/*
 * Material Experience - Santoprene Material Experience Namespace
 * 
 * EYEMG - Interactive Media Group
 * Created by Mike Crute (mcrute@eyemg.com)
 * Updated by Mike Crute (mcrute@eyemg.com) on 9/26/07
 * 
 * The Santoprene Materials Experience Namespace holds all non-generic data 
 * and methods governing the working of this application.
 * 
 * There may be a lot of things set here that are used at runtime but I 
 * explicitly define them in the SME namespace so other developers can see 
 * exactly what is contained here. There are also some dynamically defined 
 * variables based on the current querystring.
 */

var SME = 
{
	/*
	 * Release version of the site. This has nothing to do with the SVN 
	 * version of the site. This is not used right now but should be 
	 * incremented with each production release of the site.
	 */
	releaseVersion: '1.2.2',
	
	/*
	 * The color table exists to provide aliases to the colors used in the 
	 * interface. This will make it much easier to change at a later date 
	 * should that ever be required. The color table should be used only 
	 * for default values.
	 */
	colors: 
	{
		blue   : 'rgb(100, 129, 145)',
		brown  : 'rgb(100, 065, 040)',
		green  : 'rgb(100, 150, 040)',
		grey   : 'rgb(100, 100, 100)',
		orange : 'rgb(225, 125, 010)',
		red    : 'rgb(150, 035, 020)'
	},

	/*
	 * The sizes table governs the size of the user interface elements. 
	 * This exists for much the same reason as the color table, to provide 
	 * an easy way to change sizes later. Note that the rest of the styles 
	 * in the interface should be set relatively so changing these 
	 * parameters should not destroy the interface.
	 */
	sizes: 
	{
		card      : { height: 520, width: 925  }, // Card Size
		innerCard : { height: 481, width: 914  }, // Inside Size of Card
		chipMax   : { height: 180, width: 143  }, // Maximum Chip Size
		windMin   : { height: 589, width: 1020 }  // Minimum Window Size
	},
	
	// URLs Used by the Application
	url: 
	{
		tableList    : 'data/card_tables.js',
		perisitChips : 'data/persist_chip.js', 
		loginScreen  : 'http://' + window.location.hostname + '/cgi-bin/login.pl',
		sketchBook   : 'http://' + window.location.hostname + '/cgi-bin/sketchbook.pl',
		sketchBookIN : 'http://' + window.location.hostname + '/cgi-bin/sketchbook.pl?interactive=false',
		manageAccount: 'http://www.santoprene.com/cgi-bin/protected/register/account.pl?template=designer_',
		introCards   : 'http://' + window.location.hostname + '/cgi-bin/sop_proxy.pl?site=http://www.santoprene.com/cms/designer_json/224fa06db73ece8a/index.html',
		cards        : new Template('http://' + window.location.hostname + '/cgi-bin/sop_proxy.pl?site=http://www.santoprene.com/cms/designer_card/#{card}/index.html'),
		sendToFriend : new Template('http://www.santoprene.com/cgi-bin/send_page/send.pl?tmpl=designer&title=#{title}&durl=#{durl}'),
		cardTables   : new Template('http://' + window.location.hostname + '/cgi-bin/card_table.pl?table=#{table}&h=#{h}&w=#{w}'),
		chipResolver : new Template('http://' + window.location.hostname + '/cgi-bin/sketchbook_resolver.pl?card=#{card}'),
		cardPreview  : new Template('http://' + window.location.hostname + '/cgi-bin/sop_preview_proxy.pl?site=http://admin.santoprene.com/cgi-bin/content/display_content.pl?form_id=48&content_id=#{card}&site_id=1'),
		
		// Debugging and Development URLS (removed by build system)
/*;;;*/		chipResolver : new Template('http://' + window.location.hostname + '/cgi-bin/sop_proxy.pl?site=http://materialexperience.santoprene.com/cgi-bin/sketchbook_resolver.pl?card=#{card}'),
/*;;;*/		cardTables   : new Template('http://' + window.location.hostname + '/cgi-bin/sop_proxy.pl?site=http://materialexperience.santoprene.com/cgi-bin/card_table.pl?table=#{table}&h=#{h}&w=#{w}'),
		// END Debugging and Development URLS

		// Dummy item terminates the list since the items above are 
		// removed by the build system and the trailing comma would
		// break in IE. Don't Remove this!
		dontRemove: null 
	},
	
	/* 
	 * Compose layout name to layout engine mapping. Allows us to add more 
	 * layout engines later a lot simpler than the previous method allowed.
	 */
	engineMapping : 
	{
		'narrow-left'  : Card.Layout.Primary,
		'narrow-right' : Card.Layout.Primary,
		'special'      : Card.Layout.Special,
		'intro'        : Card.Layout.Primary,
		'custom-menu'  : Card.Layout.Custom
	},
	
	/*
	 * When the page is called with a query string of debug then you will 
	 * be able to open a firebug console and view debugging messages. Also
	 * checks to make sure console.log() is actually defined to avoid 
	 * throwing errors on browsers w/out firebug.
	 */
	debug: /debug=.*(true)/.test(window.location.search) && !!(console.log),
	
	/*
	 * Skip the intro card because it wastes time during development.
	 */
	skipIntro: /.*intro=false.*/.test(window.location.search),
	
	/*
	 *
	 *		RUNTIME VARIABLES SECTION
	 *
	 * These are variables set at runtime but declared explicitly here
	 * so other developers can have a clear picture of what is in this
	 * namespace. 
	 *
	 * If you set a variable in this namespace at runtime please declare
	 * it explicitly here.
	 *
	 */
	
	// Array of all loaded tables.
	tables: [],
	
	// AJAX information bezel.
	AJAXBezel: null,

	// Currently active card table.
	currentTable: null,
	
	// Sketchbook.
	sketchbook: null,

	// History manager.
	history: null,

	// Card currently being displayed.
	currentCard: null
};