Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 496024
Collapse All | Expand All

(-)a/bundles/org.eclipse.orion.client.ui/web/orion/settings/nls/root/messages.js (-2 / +2 lines)
Lines 282-287 define({//Default message bundle Link Here
282
    "editorTheme tag attribute": "Tag attribute",
282
    "editorTheme tag attribute": "Tag attribute",
283
    "editorTheme selection background": "Selection background",
283
    "editorTheme selection background": "Selection background",
284
    'customizeTheme': 'Custom Style...',
284
    'customizeTheme': 'Custom Style...',
285
    'moreEditorSettings': 'Editor Settings...'
285
    'moreEditorSettings': 'Editor Settings...',
286
    
286
    'JavascriptSettingWarning' : '${0} Project settings are available: ${1}'
287
});
287
});
(-)a/bundles/org.eclipse.orion.client.ui/web/plugins/pageLinksPlugin.js (-4 / +8 lines)
Lines 70-85 define([ Link Here
70
			order: 1000, // low priority
70
			order: 1000, // low priority
71
			uriTemplate: "{+OrionHome}/edit/edit.html"
71
			uriTemplate: "{+OrionHome}/edit/edit.html"
72
		});
72
		});
73
	
73
74
		provider.registerService("orion.page.link", null, {
74
		provider.registerService("orion.page.link.related", null, {
75
			name: widgetMessages["Settings"],
75
			name: widgetMessages["Settings"],
76
			id: "orion.settings",
76
			id: "orion.settings",
77
			nls: "orion/widgets/nls/messages",
77
			nls: "orion/widgets/nls/messages",
78
			category: "settings",
78
			category: "settings",
79
			order: 1000, // low priority
79
			order: 1000, // low priority
80
			uriTemplate: "{+OrionHome}/settings/settings.html"
80
			validationProperties: [{
81
				source: "Parents[-1]:Location|Location",
82
				variableName: "SettingsLocation"
83
			}],
84
			uriTemplate: "{+OrionHome}/settings/settings.html#{,SettingsLocation}"
81
		});
85
		});
82
	
86
83
		// Links to an Editor view of current folder. This is only useful from non-Editor pages (eg Shell)
87
		// Links to an Editor view of current folder. This is only useful from non-Editor pages (eg Shell)
84
		provider.registerService("orion.page.link.related", null, {
88
		provider.registerService("orion.page.link.related", null, {
85
			id: "orion.editFromMetadata",
89
			id: "orion.editFromMetadata",
(-)a/bundles/org.eclipse.orion.client.ui/web/settings/settings.css (+4 lines)
Lines 243-248 html[dir="rtl"] .setting-row { /* ACGC */ Link Here
243
	padding: 10px;
243
	padding: 10px;
244
}
244
}
245
245
246
.setting-info .core-sprite-warning {
247
	color: #F0AD4E;
248
}
249
246
.setting-local-indicator {
250
.setting-local-indicator {
247
	cursor: pointer;
251
	cursor: pointer;
248
	display: inline-block;
252
	display: inline-block;
(-)a/bundles/org.eclipse.orion.client.ui/web/settings/settings.js (-1 / +2 lines)
Lines 67-73 define(['i18n!orion/settings/nls/messages', 'orion/bootstrap', 'orion/status', ' Link Here
67
									settingsCore: core,
67
									settingsCore: core,
68
									pageActions: "pageActions", //$NON-NLS-0$
68
									pageActions: "pageActions", //$NON-NLS-0$
69
									userClient: usersClient,
69
									userClient: usersClient,
70
									settingsRegistry: settingsRegistry
70
									settingsRegistry: settingsRegistry,
71
									fileClient: fileClient
71
									};
72
									};
72
									
73
									
73
		lib.node("categoriesTitle").textContent = messages["Categories"]; //$NON-NLS-1$ //$NON-NLS-0$
74
		lib.node("categoriesTitle").textContent = messages["Categories"]; //$NON-NLS-1$ //$NON-NLS-0$
(-)a/bundles/org.eclipse.orion.client.ui/web/orion/widgets/settings/SettingsContainer.js (-2 / +5 lines)
Lines 422-428 define([ Link Here
422
				serviceRegistry: this.registry,
422
				serviceRegistry: this.registry,
423
				commandRegistry: this.commandService,
423
				commandRegistry: this.commandService,
424
				settings: settingsInCategory,
424
				settings: settingsInCategory,
425
				title: title
425
				title: title,
426
				fileClient: this.fileClient
426
			});
427
			});
427
		},
428
		},
428
429
Lines 459-466 define([ Link Here
459
			var params = PageUtil.matchResourceParameters();
460
			var params = PageUtil.matchResourceParameters();
460
			if (params.category !== id) {
461
			if (params.category !== id) {
461
				params.category = id;
462
				params.category = id;
463
				var resource = params.resource;
462
				delete params.resource;
464
				delete params.resource;
463
				window.location = new URITemplate("#,{params*}").expand({ //$NON-NLS-0$
465
				window.location = new URITemplate("#{,resource,params*}").expand({ //$NON-NLS-0$
466
					resource: resource,
464
					params: params
467
					params: params
465
				});
468
				});
466
			}
469
			}
(-)a/bundles/org.eclipse.orion.client.ui/web/orion/settings/ui/PluginSettings.js (-2 / +45 lines)
Lines 20-28 define([ Link Here
20
	'orion/widgets/input/SettingsSelect',
20
	'orion/widgets/input/SettingsSelect',
21
	'i18n!orion/settings/nls/messages',
21
	'i18n!orion/settings/nls/messages',
22
	'orion/i18nUtil',
22
	'orion/i18nUtil',
23
	'orion/commands'
23
	'orion/commands',
24
	'orion/PageUtil',
25
	'orion/webui/littlelib',
26
	'orion/URITemplate'
24
], function(mExplorer, mSection, Deferred, objects, mConfirmDialog, SettingsCheckbox, SettingsTextfield, 
27
], function(mExplorer, mSection, Deferred, objects, mConfirmDialog, SettingsCheckbox, SettingsTextfield, 
25
		SettingsSelect, messages, i18nUtil, Commands) {
28
		SettingsSelect, messages, i18nUtil, Commands, PageUtil, lib, URITemplate) {
26
	var Explorer = mExplorer.Explorer,
29
	var Explorer = mExplorer.Explorer,
27
	    SelectionRenderer = mExplorer.SelectionRenderer,
30
	    SelectionRenderer = mExplorer.SelectionRenderer,
28
	    Section = mSection.Section,
31
	    Section = mSection.Section,
Lines 30-35 define([ Link Here
30
	    ConfirmDialog = mConfirmDialog.ConfirmDialog;
33
	    ConfirmDialog = mConfirmDialog.ConfirmDialog;
31
34
32
	var SECTION_HIDE = '/settings/sectionExpand'; //$NON-NLS-1$
35
	var SECTION_HIDE = '/settings/sectionExpand'; //$NON-NLS-1$
36
	var editTemplate = new URITemplate("/edit/edit.html#{,resource,params*}"); //$NON-NLS-0$
33
37
34
	/**
38
	/**
35
	 * @name orion.settings.ui.PropertyWidget
39
	 * @name orion.settings.ui.PropertyWidget
Lines 380-385 define([ Link Here
380
		var commandRegistry = this.commandRegistry = options.commandRegistry;
384
		var commandRegistry = this.commandRegistry = options.commandRegistry;
381
		this.settings = options.settings;
385
		this.settings = options.settings;
382
		this.title = options.title;
386
		this.title = options.title;
387
		this.fileClient = options.fileClient;
383
		if (!options.parent || !options.serviceRegistry || !options.settings || !options.title) {
388
		if (!options.parent || !options.serviceRegistry || !options.settings || !options.title) {
384
			throw new Error('Missing required option'); //$NON-NLS-0$
389
			throw new Error('Missing required option'); //$NON-NLS-0$
385
		}
390
		}
Lines 427-432 define([ Link Here
427
		},
432
		},
428
		destroy: function() {
433
		destroy: function() {
429
			this.explorer.destroy();
434
			this.explorer.destroy();
435
			this.destroyed = true;
430
		},
436
		},
431
		restore: function(pid) {
437
		restore: function(pid) {
432
			var deferreds = [];
438
			var deferreds = [];
Lines 453-458 define([ Link Here
453
			}
459
			}
454
		},
460
		},
455
		render: function(parent, serviceRegistry, settings, categoryTitle) {
461
		render: function(parent, serviceRegistry, settings, categoryTitle) {
462
			if (settings && settings.length > 2 && "javascript" === settings[0].category) {
463
				var pageParams = PageUtil.matchResourceParameters();
464
				this.fileClient.fetchChildren(pageParams.resource + "?depth=1").then(function(children) {
465
					console.log("Render :" + this.destroyed);
466
					if (!this.destroyed) {
467
						children.some(function (child) {
468
							if (child.Name === ".eslintrc") {
469
								console.log("Creation: " + this.destroyed);
470
								var infoText = document.createElement("div"); //$NON-NLS-0$
471
								infoText.classList.add("setting-info"); //$NON-NLS-0$
472
								infoText.textContent = messages.JavascriptSettingWarning;
473
								var icon = document.createElement("span"); //$NON-NLS-0$
474
								icon.classList.add("core-sprite-warning"); //$NON-NLS-0$
475
								icon.classList.add("icon-inline"); //$NON-NLS-0$
476
								icon.classList.add("imageSprite"); //$NON-NLS-0$
477
								var link = document.createElement("a"); //$NON-NLS-0$
478
								link.href = editTemplate.expand({resource: child.Location});
479
								link.appendChild(document.createTextNode(child.Name));
480
								lib.processDOMNodes(infoText, [icon, link]);
481
								try {
482
									if (parent.firstChild) {
483
										console.log("insert: " + this.destroyed);
484
										parent.insertBefore(infoText, parent.firstChild);
485
									} else {
486
										console.log("append: " + this.destroyed);
487
										parent.appendChild(infoText);
488
									}
489
								} catch(e) {
490
									console.log(e);
491
								}
492
								return true;
493
							}
494
						}.bind(this));
495
					}
496
				}.bind(this));
497
498
			}
456
			for (var i=0; i<settings.length; i++) {
499
			for (var i=0; i<settings.length; i++) {
457
				var setting = settings[i];
500
				var setting = settings[i];
458
				var sectionId = 'settings.section.'; //$NON-NLS-1$
501
				var sectionId = 'settings.section.'; //$NON-NLS-1$

Return to bug 496024