PageSourceSearch

https://www.idepa.es/o/staging-bar-web/js/staging_version.js?brows…&languageId=es_ES&b=7004&t=1504142746000

js idepa.es collected 2026-10-02 02:54:52 UTC 5,111 bytes, 202 lines download raw bytes

1AUI.add(
2	'liferay-staging-version',
3	function(A) {
4		var StagingBar = Liferay.StagingBar;
5
6		var MAP_CMD_REVISION = {
7			redo: 'redo_layout_revision',
8			undo: 'undo_layout_revision'
9		};
10
11		var MAP_TEXT_REVISION = {
12			redo: '\xbfEstá\x20seguro\x20de\x20que\x20quiere\x20rehacer\x20sus\x20últimos\x20cambios\x3f',
13			undo: '\xbfEstá\x20seguro\x20de\x20que\x20desea\x20deshacer\x20sus\x20últimos\x20cambios\x3f'
14		};
15
16		A.mix(
17			StagingBar,
18			{
19				destructor: function() {
20					var instance = this;
21
22					instance._cleanup();
23				},
24
25				_cleanup: function() {
26					var instance = this;
27
28					if (instance._eventHandles) {
29						A.Array.invoke(instance._eventHandles, 'detach');
30					}
31				},
32
33				_getNotification: function() {
34					var instance = this;
35
36					var notification = instance._notification;
37
38					if (!notification) {
39						notification = new Liferay.Notice(
40							{
41								closeText: false,
42								content: 'Se\x20ha\x20producido\x20un\x20error\x20inesperado\x2e\x20Por\x20favor\x2c\x20refresque\x20la\x20página\x20actual\x2e',
43								noticeClass: 'hide',
44								timeout: 10000,
45								toggleText: false,
46								type: 'warning',
47								useAnimation: true
48							}
49						);
50
51						instance._notification = notification;
52					}
53
54					return notification;
55				},
56
57				_onInit: function(event) {
58					var instance = this;
59
60					instance._cleanup();
61
62					var namespace = instance._namespace;
63
64					var eventHandles = [
65						Liferay.on(namespace + 'redo', instance._onRevisionChange, instance, 'redo'),
66						Liferay.on(namespace + 'submit', instance._onSubmit, instance),
67						Liferay.on(namespace + 'undo', instance._onRevisionChange, instance, 'undo'),
68						Liferay.on(namespace + 'viewHistory', instance._onViewHistory, instance)
69					];
70
71					var layoutRevisionDetails = A.byIdNS(namespace, 'layoutRevisionDetails');
72
73					if (layoutRevisionDetails) {
74						eventHandles.push(
75							Liferay.onceAfter(
76								'updatedLayout',
77								function(event) {
78									A.io.request(
79										instance.markAsReadyForPublicationURL,
80										{
81											on: {
82												failure: function(event, id, obj) {
83													layoutRevisionDetails.setContent('Se\x20ha\x20producido\x20un\x20error\x20inesperado\x2e\x20Por\x20favor\x2c\x20refresque\x20la\x20página\x20actual\x2e');
84												},
85												success: function(event, id, obj) {
86													var response = this.get('responseData');
87
88													layoutRevisionDetails.plug(A.Plugin.ParseContent);
89
90													layoutRevisionDetails.setContent(response);
91												}
92											}
93										}
94									);
95								}
96							)
97						);
98					}
99
100					instance._eventHandles = eventHandles;
101				},
102
103				_onRevisionChange: function(event, type) {
104					var instance = this;
105
106					var cmd = MAP_CMD_REVISION[type];
107					var confirmText = MAP_TEXT_REVISION[type];
108
109					if (confirm(confirmText)) {
110						instance._updateRevision(cmd, event.layoutRevisionId, event.layoutSetBranchId);
111					}
112				},
113
114				_onSubmit: function(event) {
115					var instance = this;
116
117					var namespace = instance._namespace;
118
119					var layoutRevisionDetails = A.byIdNS(namespace, 'layoutRevisionDetails');
120
121					var layoutRevisionInfo = layoutRevisionDetails.one('.layout-revision-info');
122
123					if (layoutRevisionInfo) {
124						layoutRevisionInfo.addClass('loading');
125					}
126
127					var submitLink = A.byIdNS(namespace, 'submitLink');
128
129					if (submitLink) {
130						submitLink.html('Cargando' + '...');
131					}
132
133					A.io.request(
134						event.publishURL,
135						{
136							after: {
137								failure: function() {
138									layoutRevisionDetails.addClass('alert alert-danger');
139
140									layoutRevisionDetails.setContent('Se\x20ha\x20producido\x20un\x20error\x20inesperado\x2e\x20Por\x20favor\x2c\x20refresque\x20la\x20página\x20actual\x2e');
141								},
142								success: function() {
143									if (event.incomplete) {
144										location.href = event.currentURL;
145									}
146									else {
147										Liferay.fire('updatedLayout');
148									}
149								}
150							}
151						}
152					);
153				},
154
155				_onViewHistory: function(event) {
156					Liferay.Util.openWindow(
157						{
158							dialog: {
159								destroyOnHide: true
160							},
161							title: 'Historia',
162							uri: StagingBar.viewHistoryURL
163						}
164					);
165				},
166
167				_updateRevision: function(cmd, layoutRevisionId, layoutSetBranchId) {
168					var instance = this;
169
170					A.io.request(
171						themeDisplay.getPathMain() + '/portal/update_layout',
172						{
173							data: {
174								cmd: cmd,
175								doAsUserId: themeDisplay.getDoAsUserIdEncoded(),
176								layoutRevisionId: layoutRevisionId,
177								layoutSetBranchId: layoutSetBranchId,
178								p_auth: Liferay.authToken,
179								p_l_id: themeDisplay.getPlid(),
180								p_v_l_s_g_id: themeDisplay.getSiteGroupId()
181							},
182							on: {
183								failure: function() {
184									instance._getNotification().show();
185								},
186								success: function(event, id, obj) {
187									window.location.reload();
188								}
189							}
190						}
191					);
192				}
193			}
194		);
195
196		Liferay.on('initStagingBar', StagingBar._onInit, StagingBar);
197	},
198	'',
199	{
200		requires: ['aui-button', 'liferay-staging']
201	}
202);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.