Really fix notices sometimes not being an array

The previous fix didn't really work, because the notices are expected to
be an array elsewhere too. Better to just convert it to an array on the
spot. getObjectValues works with any kind of object (including an array)
so it's safe to use with either data type.

Change-Id: I03237b8624a0b980e5f70d54d55c662ffa460373
This commit is contained in:
Trevor Parscal 2013-06-05 16:37:49 -07:00 committed by Catrope
parent 86cd5c6f57
commit c0cd258045

View file

@ -160,7 +160,7 @@ ve.init.mw.Target.onLoad = function ( response ) {
this.originalHtml = data.content;
this.doc = ve.createDocumentFromHtml( this.originalHtml );
this.remoteNotices = data.notices;
this.remoteNotices = ve.getObjectValues( data.notices );
this.baseTimeStamp = data.basetimestamp;
this.startTimeStamp = data.starttimestamp;
@ -195,7 +195,7 @@ ve.init.mw.Target.onNoticesReady = function () {
document.body.appendChild( tmp );
// Merge locally and remotely generated notices
noticeHtmls = Array.prototype.slice.call( this.remoteNotices );
noticeHtmls = this.remoteNotices.slice();
for ( i = 0, len = this.localNoticeMessages.length; i < len; i++ ) {
noticeHtmls.push(
'<p>' + ve.init.platform.getParsedMessage( this.localNoticeMessages[i] ) + '</p>'