forked from jochen-jung/phpcodeedit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.htm
More file actions
executable file
·671 lines (643 loc) · 23.9 KB
/
main.htm
File metadata and controls
executable file
·671 lines (643 loc) · 23.9 KB
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>PHP Code Editor</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="PHP Code Editor - a web based interface to edit your code" />
<meta name="keywords" content="php, html, css, javascript, ajax, code, editor, ide, syntax highlighting, code completition, online ftp" />
{{if $isSSL}}<link rel="shortcut icon" href="/edit.orgapage.de/favicon.ico" />{{/if}}
<link rel="stylesheet" type="text/css" href="http{{if $isSSL}}s{{/if}}://extjs.cachefly.net/ext-3.2.1/resources/css/ext-all.css" />
<script type="text/javascript" src="http{{if $isSSL}}s{{/if}}://extjs.cachefly.net/ext-3.2.1/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="http{{if $isSSL}}s{{/if}}://extjs.cachefly.net/ext-3.2.1/ext-all.js"></script>
<script src="codemirror/lib/codemirror.js"></script>
<script src="codemirror/addon/search/searchcursor.js"></script>
<link rel="stylesheet" href="codemirror/lib/codemirror.css">
<script src="codemirror/mode/javascript/javascript.js"></script>
<script src="codemirror/mode/css/css.js"></script>
<script src="codemirror/mode/clike/clike.js"></script>
<script src="codemirror/mode/php/php.js"></script>
<script type="text/javascript" src="scripts.js"></script>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<div id="welcome" class="x-hide-display">
<img src="phpCodeEditor.png" title="PHP Code Editor IDE" alt="PHP Code Editor" vspace="2" align="right">
<h1>Welcome to PHP Code Editor!</h1>
<p>PHP Code Editor is a web based interface to edit your code.<br>
This way you can work on your project now matter where in the world you are, or on wich computer you are sitting at.<br>
PHP Code Editor works in almost any web browser, that supports Javascript.
</p>
<p>
You can either access your files directly on your FTP server, where your webpage is located at.<br>
Or you can upload your files to your personal directory, if you don't feel comfortable about entering your FTP credentials.<br>
</p>
<div><h2>Features:</h2>
<ul class="featurelist">
<li>FTP Access</li>
<li>Syntax highlighting</li>
<li>Code completition</li>
<li>Code validation</li>
</ul>
</div>
<p>Click the "+" button above to <a id="new_tab_link" href="#" title="Open PHP Code Editor to start editing a new file">create a new file</a>.</p>
{{if !$userid}}
<p><a id="open_sign_up_link" href="#" title="Sign up for PHP Code Editor">Sign up</a> to be able to save your files online and access / edit them from any desktop you're sitting at.<br>After signing up, you will also be able to access your FTP servers.</p>
{{/if}}
{{if !$isSSL}}<p>PHP Code Editor is also available via <a href="https://sslsites.de/edit.orgapage.de" title="https://sslsites.de/edit.orgapage.de">Secure connection</a></p>{{/if}}
<p>Any questions? Feel free to <a id="contact_us_link" href="#" title="Contact PHP Code Editor Team">contact us</a>.</p>
</div>
<div id="signup" class="x-hidden"></div>
<div id="west" class="x-hide-display"></div>
<div id="props-panel" class="x-hide-display" style="width:200px;height:200px;overflow:hidden;"></div>
<!--
<div id="south" class="x-hide-display">
<p>...still to come</p>
</div>
-->
<div id="center" class="x-hide-display">
<div id="suggestBox">
<input type="text" id="suggestInput" size="20"/>
<div id="suggestList"></div>
</div>
</div>
<div id="uploadBox" class="x-hidden"></div>
<div id="searchBox" class="x-hidden"></div>
<div id="ftpwinBox" class="x-hidden"></div>
<div id="liwinBox" class="x-hidden"></div>
<div id="fi-basic" class="x-hidden"></div>
<div id="fi-basic-btn" class="x-hidden"></div>
<script type="text/javascript">
function saveClick(btn){
{{if !$userid}}
Ext.MessageBox.alert('Not logged in', 'Saving files is available to logged in users only.<br>Please choose "Download" instead, or login');
{{else}}
var actTab = parseInt(tabs.getActiveTab().id.substr(3, 3), 10);
if (isNaN(actTab) || actTab <= 1) {
Ext.MessageBox.alert('No Tab selected', 'There is no current code tab selected.');
} else {
var fileName = tabFiles[actTab];
var denyoverwrite = 0;
if (fileName == '') {
fileName = prompt("Enter file name:", 'new_file.txt');
denyoverwrite = 1;
}
if (fileName) {
Ext.Ajax.request({
url : 'ajax.php' ,
params : { a: 'saveFile', path: fileName, code: codeEditor[actTab].getValue(), denyoverwrite: denyoverwrite },
method: 'POST',
success: function (result, request) {
var r = Ext.util.JSON.decode(result.responseText);
if (r.success) {
Ext.MessageBox.alert('File saved', r.msg);
tree.getRootNode().reload();
actTab = parseInt(tabs.getActiveTab().id.substr(3, 3), 10);
tabFiles[actTab] = fileName;
if (fileName.lastIndexOf('/') !== false) fileName2 = fileName.subst(fileName.lastIndexOf('/') + 1, fileName.length);
else fileName2 = fileName;
tabs.getActiveTab().setTitle(fileName2);
return fileName;
} else Ext.MessageBox.alert('Failed saving file', r.msg);
},
failure: function (result, request) {
var r = Ext.util.JSON.decode(result.responseText);
Ext.MessageBox.alert('Failed saving file', r.msg);
}
});
}
}
{{/if}}
}
Ext.onReady(function(){
Ext.BLANK_IMAGE_URL = 'http{{if $isSSL}}s{{/if}}://extjs.cachefly.net/ext-3.2.1/resources/images/default/s.gif';
//Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
Ext.QuickTips.init();
{{$alertMsg}}
// New tab button
Ext.ux.AddTabButton = (function() {
function onTabPanelRender() {
this.addTab = this.itemTpl.insertBefore(this.edge, {
id: this.id + 'addTabButton',
cls: 'add-tab',
text: this.addTabText || ' ',
iconCls: ''
}, true);
this.addTab.child('em.x-tab-left').setStyle('padding-right', '6px');
this.addTab.child('a.x-tab-right').setStyle('padding-left', '6px');
tmpvar = new Ext.ToolTip({
target: this.addTab,
bodyCfg: {
html: 'Add new tab'
}
});
this.addTab.on({
mousedown: stopEvent,
click: addTab,
scope: this
});
}
function stopEvent(e) {
e.stopEvent();
}
return {
init: function(tp) {
if (tp instanceof Ext.TabPanel) {
tp.onRender = tp.onRender.createSequence(onTabPanelRender);
}
}
};
})();
viewport = new Ext.Viewport({
layout: 'border',
items: [
new Ext.BoxComponent({
region: 'north', height: 28,
autoEl: {
tag: 'div', id: 'north',
children: [{
tag: 'div', id: 'northLogo', html: '<img src="phpCodeEditorIcon.png" title="PHP Code Editor" width="16" height="16"> PHP Code Editor'
}]
}
}), {
/* region: 'south', title: 'Information', contentEl: 'south', split: true,
height: 100, minSize: 100, maxSize: 200, collapsible: true, collapsed: true, margins: '0 0 0 0'
}, { */
region: 'west', id: 'west-panel',
{{if !$userid}}
title: 'Login', iconCls: 'door_in',
{{else}}
title: 'Navigation', iconCls: 'folder2',
{{/if}}
split: true, width: 200, minSize: 175, maxSize: 400, collapsible: true, autoScroll: true, margins: '0 0 0 5',
layout: { type: 'anchor', animate: true },
items: [
{{if !$userid}}
{
title: '', border: false, padding: 8,
items: fp = new Ext.FormPanel({
frame: false, autoHeight: true, labelWidth: 30, border: false, buttonAlign: 'left',
listeners:{
"render":function() {
var map = new Ext.KeyMap(this.id, {
key: Ext.EventObject.ENTER,
fn: function() {
if (this.getForm().isValid()) {
post('index.php', { email: this.getForm().findField('email').getValue(), password: this.getForm().findField('password').getValue()}, false, '');
}
},
scope: this
});
}
},
defaults: {
anchor: '85%', allowBlank: false, msgTarget: 'qtip', xtype: 'textfield', autoWidth: true
},
defaultType: 'textfield',
items: [
{ name: 'email', fieldLabel: 'Email', emptyText: 'mail@host.com' },
{ name: 'password', inputType: 'password', fieldLabel: 'Pass' }
],
buttons: [{
text: 'Login', iconCls: 'door_in',
handler: function(){
if (fp.getForm().isValid()) {
post('index.php', { email: fp.getForm().findField('email').getValue(), password: fp.getForm().findField('password').getValue()}, false, '');
}
}
}, {
text: 'Sign up', iconCls: 'user_add',
handler: function() { showSignupWindow(); }
}]
})
},
{{/if}}
{{if $userid}}
// Navi menu bar
tb_nav = new Ext.Toolbar({
items: [
{ text: 'Add FTP', iconCls: 'server_add', handler: addFTPClick, tooltip: { title:'Add FTP', text:'Link a new FTP connection to your account' } }
]
}),
tree_ftp = new Ext.tree.TreePanel({
contentEl: 'west', title: '', border: false, useArrows: true, autoScroll: false, animate: true, enableDD: true, containerScroll: true,
dataUrl: 'ftp-get.php',
root: { nodeType: 'async', text: 'FTP files', draggable: false, id: '/' },
listeners: {
click: function(n) {
if (n.attributes.leaf) {
var fo = addTabDo(n.attributes.text);
openFTPCodeFile(fo, n.attributes.id);
}
}
}
}),
{{/if}}
tree = new Ext.tree.TreePanel({
contentEl: 'west', border: false, iconCls: 'folder2', useArrows: true, autoScroll: false, animate: true, enableDD: true, containerScroll: true,
{{if $userid}} title: '', {{else}} title: 'Files (Log in to see yours)', {{/if}}
dataUrl: 'get-files.php',
root: {
nodeType: 'async',
{{if $userid}} text: 'My files', {{else}} text: 'Demo files', {{/if}}
draggable: false, id: '/'
},
listeners: {
click: function(n) {
if (n.attributes.leaf) {
var fo = addTabDo(n.attributes.text);
openCodeFile(fo, n.attributes.id);
}
}
}
})
]
},
tabs = new Ext.TabPanel({
region: 'center', contentEl: 'center', deferredRender: false, activeTab: 0,
plugins: [ Ext.ux.AddTabButton ],
items: [
{ contentEl: 'welcome', title: 'Welcome', padding: 16, closable: true, autoScroll: true }
]
})]
});
function fileDrop(node) {
if (node.target.id == '/') return false;
var target = '';
if (node.target.leaf) target = node.target.id.substr(0, node.target.id.lastIndexOf('/')) +'/';
else target = node.target.id +'/';
// Add filename to new dir
var startpos = 0;
if (node.dropNode.id.lastIndexOf('/') > -1) startpos = node.dropNode.id.lastIndexOf('/') + 1;
var old_filename = node.dropNode.id.substr(startpos, node.dropNode.id.length);
if (target.substr(target.length - 1, 1) != '/') target += '/';
target += old_filename;
RenameRequest(node.dropNode.id, target);
return true;
}
tree.on('beforenodedrop', fileDrop);
tree.on('contextmenu', function(node){
if (node.id != '/') {
path = node.id;
// File
if (node.leaf == true) {
var contextMenu2F = new Ext.menu.Menu({
style: {
overflow: 'visible'
},
items: [{
text: 'Open file',
iconCls: 'script_go',
handler: openFileClick.createDelegate(this, node.id, true)
}, {
text: 'Rename file',
iconCls: 'script_edit',
handler: renameFileClick.createDelegate(this, node.id, true)
}, {
text: 'Delete file',
iconCls: 'script_delete',
handler: deleteFileClick.createDelegate(this, node.id, true)
}]
});
contextMenu2F.show(node.ui.getAnchor());
// Directory
} else {
var contextMenu2D = new Ext.menu.Menu({
style: {
overflow: 'visible'
},
items: [{
text: 'Rename directory',
iconCls: 'script_edit',
handler: renameFileClick.createDelegate(this, node.id, true)
}/*, {
text: 'Delete directory',
iconCls: 'script_delete',
handler: todoClick
}*/]
});
contextMenu2D.show(node.ui.getAnchor());
}
}
});
{{if $userid}}
tree_ftp.on('beforenodedrop', fileDrop);
tree_ftp.on('contextmenu', function(node){
if (node.id != '/') {
// FTP Server
var ftpID = node.id.substr(0, node.id.indexOf(':'));
var path = node.id.substr(node.id.indexOf(':') + 1, node.id.length);
if (path == '' || path == '/') {
var contextMenuS = new Ext.menu.Menu({
style: {
overflow: 'visible'
},
items: [{
text: 'Edit',
iconCls: 'server_edit',
handler: addFTPClick.createDelegate(this, ftpID, true)
}, {
text: 'Remove',
iconCls: 'server_delete',
handler: deleteFTPClick.createDelegate(this, ftpID, true)
}]
});
contextMenuS.show(node.ui.getAnchor());
} else {
// FTP File
if (node.leaf == true) {
var contextMenuF = new Ext.menu.Menu({
style: {
overflow: 'visible'
},
items: [{
text: 'Open file',
iconCls: 'script_go',
handler: openFileClick.createDelegate(this, node.id, true)
}, {
text: 'Rename file',
iconCls: 'script_edit',
handler: renameFileClick.createDelegate(this, node.id, true)
}, {
text: 'Delete file',
iconCls: 'script_delete',
handler: deleteFTPFileClick.createDelegate(this, node.id, true)
}]
});
contextMenuF.show(node.ui.getAnchor());
// FTP Directory
} else {
var contextMenuD = new Ext.menu.Menu({
style: {
overflow: 'visible'
},
items: [{
text: 'Rename directory',
iconCls: 'script_edit',
handler: renameFileClick.createDelegate(this, node.id, true)
}/*, {
text: 'Delete directory',
iconCls: 'script_delete',
handler: todoClick
}*/]
});
contextMenuD.show(node.ui.getAnchor());
}
}
}
});
{{/if}}
function hashCheckerClick(btn){
if (!searchwin) {
searchwin = new Ext.Window({
applyTo:'searchBox', layout:'fit', width:550, autoHeight: true, title: 'Generate hash codes', closeAction:'hide', plain: true,
items: fp = new Ext.FormPanel({
width: 400, frame: false, autoHeight: true, bodyStyle: 'padding: 10px 10px 0 10px;', labelWidth: 100, defaultType: 'textfield',
defaults: { anchor: '95%', allowBlank: false, msgTarget: 'side' },
items: [{
fieldLabel: 'Plain', name: 'plain', xtype: 'textfield', allowBlank: false,
listeners: {
'change': function() {
getHashCode(fp);
}
}
}, {
xtype: 'combo', mode: 'local', value: 'md5', triggerAction: 'all', forceSelection: true, editable: false, fieldLabel: 'Hash type',
name: 'type', hiddenName: 'type', displayField: 'value', valueField: 'name',
store: new Ext.data.JsonStore({
fields: ['name', 'value'],
data: [{{foreach key=key item=val from=$hash_algos}}{name : '{{$val}}', value: '{{$val}}'}{{if !$last}}, {{/if}}{{/foreach}}]
}),
listeners: {
'select': function() {
getHashCode(fp);
}
}
}, {
fieldLabel: 'Hash', name: 'hash', xtype: 'textfield', readOnly: true, allowBlank: true
}]
})
});
}
searchwin.show(this);
}
// Menu bar
tb = new Ext.Toolbar().render('north');
tb.add(new Ext.Toolbar.SplitButton({
{{if $userid}} text: 'Save', iconCls: 'script_save', id: 'save', handler: saveClick, disabled: true,
{{else}} text: 'Download', iconCls: 'disk', id: 'save', handler: downloadClick, disabled: true,
{{/if}}
tooltip: {text:'Click to save current file', title:'Save'},
menu: {
id: 'saveMenu',
style: { overflow: 'visible' },
items: [
{ text: 'Save online <span class="accessKey">(Ctrl+S)</span>', iconCls: 'script_save', handler: saveClick },
{ text: 'Download', iconCls: 'disk', handler: downloadClick }
]
}
}), {
text: 'Open', iconCls: 'script_add', handler: openClick
}, '-', {
text: 'Search', id: 'search', iconCls: 'find', disabled: true,
menu: {
items: [
{ text: 'Search / Replace <span class="accessKey">(Ctrl+F)</span>', iconCls: 'page_white_find', handler: searchClick },
{ text: 'Find next <span class="accessKey">(F3)</span>', iconCls: 'page_white_find', handler: findClick }
]
}
}, {
text: 'Insert',
id: 'insert',
iconCls: 'table_row_insert',
disabled: true,
menu: {
items: [{
text: 'Color code', iconCls: 'color_swatch',
menu: {
items: [
new Ext.ColorPalette({
listeners: {
select: function(cp, color){
insertCode('#'+ color);
}
}
})/*, '-', {
text: 'More Colors...', iconCls: 'color_wheel', handler: todoClick
}*/
]
}
}, {
text: 'Lorem ipsum', iconCls: 'script', handler: LoremIpsumClick
}]
}
}, {
text: 'Tools',
iconCls: 'wrench_orange',
menu: {
items: [{
text: 'Validate code', iconCls: 'script_code_red',
menu: {
items: [
{ text: 'Validate HTML', iconCls: 'html_valid', handler: validateHTMLClick },
{ text: 'Validate CSS', iconCls: 'css_valid', handler: validateCSSClick },
{ text: 'Check JavaScript syntax', iconCls: 'script_error', handler: validateJSClick }
]
}
}, {
text: 'Minimize code', iconCls: 'script_lightning',
menu: {
items: [
{ text: 'Minimize JavaScript', iconCls: 'script_lightning', handler: minimizeJSClick }
]
}
}, {
text: 'Hashcode checker', iconCls: 'textfield_key', handler: hashCheckerClick
}]
}
}, {
text: 'Settings',
iconCls: 'wrench',
menu: {
items: [
/* { text: 'Use spaces as tabs', checked: true, checkHandler: spacesAsTabsClick },
{ text: 'Perform spellcheck', checked: false, checkHandler: enableSpellcheckClick },
{ text: 'Auto match parenses', checked: true, checkHandler: autoMatchParensesClick }, */
{ text: 'Show line numbers', checked: true, checkHandler: showLineNumbersClick }
]
}
}, '-', {
{{if $userid}}
text: '{{$firstname}} {{$lastname}}', iconCls: 'user',
menu: {
items: [
{ text: 'Edit', iconCls: 'user_edit', handler: showSignupWindow },
/* { text: 'Change Password', iconCls: 'key', handler: todoClick }, */
{ text: 'Logout', iconCls: 'door_out', handler: logoutClick }
]
}
}, '-', {
{{/if}}
text: 'Help', iconCls: 'information',
menu: {
items: [
{ text: 'About', iconCls: 'information', handler: aboutClick },
{ text: 'Wiki Documentation', iconCls: 'layout', handler: wikiClick },
{ text: 'Report Bug / Feature', iconCls: 'bug', handler: bugreportClick },
{ text: 'Contact us', iconCls: 'telephone_go', handler: contactUsClick }
]
}
});
tb.doLayout();
{{if $userid}} tree_ftp.getRootNode().expand(); {{/if}}
tree.getRootNode().expand();
function showSignupWindow() {
if(!win){
win = new Ext.Window({
applyTo: 'signup', layout: 'fit', width: 400, autoHeight: true, closeAction: 'hide', plain: true,
{{if !$userid}}
title: 'Sign up',
{{else}}
title: 'Change my data',
{{/if}}
items: fp_su = new Ext.FormPanel({
labelWidth: 75, frame: false, bodyStyle: 'padding:5px 5px 0', width: 350, autoHeight: true, defaultType: 'textfield',
defaults: {
msgTarget: 'side',
width: 230
},
items: [{
{{if $userid}}
xtype: 'hidden', fieldLabel: 'ID', name: 'userid', value: '{{$userid}}', allowBlank: false
}, {
{{/if}}
fieldLabel: 'First Name', name: 'first',
{{if $userid}}
value: '{{$firstname}}',
{{/if}}
allowBlank: false
},{
fieldLabel: 'Last Name',
name: 'last',
{{if $userid}}
value: '{{$lastname}}',
{{/if}}
allowBlank: false
},{
fieldLabel: 'Email',
name: 'email',
vtype: 'email',
{{if $userid}}
value: '{{$email}}',
{{/if}}
allowBlank: false
{{if !$userid}}
}, {
inputType: 'password', fieldLabel: 'Password', name: 'password', allowBlank: false
}, {
inputType: 'password', fieldLabel: 'Password (verification)', name: 'password2', allowBlank: false
{{/if}}
}
],
buttons: [{
text: 'Save',
handler: function(){
if(fp_su.getForm().isValid()){
fp_su.getForm().submit({
url: 'user-signup.php',
waitMsg: 'Signing up...',
success: function(fp_su, o){
{{if $userid}}
Ext.MessageBox.alert('Success', 'User has been edited.<br>Changes will take effekt after next login');
{{else}}
Ext.MessageBox.alert('Success', 'User has been created');
{{/if}}
win.hide();
},
failure: function (fp_su, o) {
Ext.MessageBox.alert('Signup failed', 'Error: '+ o.failureType);
}
});
}
}
},{
text: 'Cancel',
handler: function(){
win.hide();
}
}]
})
});
}
win.show(this);
}
{{if !$userid}}
Ext.get("open_sign_up_link").on('click', function() {
showSignupWindow();
});
{{/if}}
Ext.get("new_tab_link").on('click', function() {
addTab();
});
Ext.get("contact_us_link").on('click', function() {
contactUsClick();
});
var addThisCode = document.createElement('div');
addThisCode.setAttribute('class', 'addthis_toolbox addthis_default_style');
addThisCode.innerHTML = '<a href="http{{if $isSSL}}s{{/if}}://www.addthis.com/bookmark.php?v=250&username=xa-4bfe42d77f137dd4" class="addthis_button_compact">Share link</a>'
Ext.getDom("welcome").appendChild(addThisCode);
include('http{{if $isSSL}}s{{/if}}://s7.addthis.com/js/250/addthis_widget.js#username=xa-4bfe42d77f137dd4', 'AddThisField');
viewport.on('AddThisFieldIncluded', function() {
});
});
/* Analytics */
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-2837602-6']);
_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>
</body>
</html>