in icon dialog, allow for passing an element (not just text), and rename the option to 'content'

This commit is contained in:
rolux 2013-08-08 13:04:51 +00:00
parent 6934162893
commit 00739a024c
13 changed files with 33 additions and 27 deletions

View file

@ -35,7 +35,7 @@ pandora.ui.annotationDialog = function(layer) {
})
]
),
text: Ox._('To add or edit {0}, ' + (
content: Ox._('To add or edit {0}, ' + (
isEditor
? 'please sign up or sign in.'
: 'just switch to the editor.'

View file

@ -121,8 +121,8 @@ pandora.ui.contactForm = function() {
}
})
],
content: Ox._('Thanks for your message!<br/><br/>We will get back to you as soon as possible.'),
keys: {enter: 'close', escape: 'close'},
text: Ox._('Thanks for your message!<br/><br/>We will get back to you as soon as possible.'),
title: Ox._('Message Sent')
})
.open();

View file

@ -25,8 +25,8 @@ pandora.ui.deleteDocumentDialog = function(file, callback) {
}
})
],
content: Ox._('Are you sure you want to delete the document "{0}"?', [file]),
keys: {enter: 'delete', escape: 'keep'},
text: Ox._('Are you sure you want to delete the document "{0}"?', [file]),
title: Ox._('Delete Document')
});

View file

@ -28,10 +28,10 @@ pandora.ui.deleteItemDialog = function(item) {
}
})
],
keys: {enter: 'delete', escape: 'keep'},
text: Ox._('Are you sure you want to delete the {0} "{1}"?'
content: Ox._('Are you sure you want to delete the {0} "{1}"?'
+ '<br><br>All data will be removed.',
[Ox._(pandora.site.itemName.singular), item.title]),
keys: {enter: 'delete', escape: 'keep'},
title: Ox._('Delete {0}', [Ox._(pandora.site.itemName.singular)])
});

View file

@ -50,9 +50,9 @@ pandora.ui.deleteListDialog = function(list) {
}
})
],
keys: {enter: 'delete', escape: 'keep'},
text: Ox._('Are you sure you want to delete the {0} "{1}"?',
content: Ox._('Are you sure you want to delete the {0} "{1}"?',
[folderItem.toLowerCase(), listData.name]),
keys: {enter: 'delete', escape: 'keep'},
title: Ox._('Delete {0}', [folderItem])
});

View file

@ -24,8 +24,8 @@ pandora.ui.errorDialog = function(data) {
}
})
],
content: Ox._('Sorry, you have made an unauthorized request.'),
keys: {enter: 'close', escape: 'close'},
text: Ox._('Sorry, you have made an unauthorized request.'),
title: Ox.toTitleCase(data.status.text)
})
.addClass('OxErrorDialog')
@ -62,12 +62,12 @@ pandora.ui.errorDialog = function(data) {
}
})
]),
keys: {enter: 'close', escape: 'close'},
text: Ox._('Sorry, a server {0}'
content: Ox._('Sorry, a server {0}'
+ ' occured while handling your request.'
+ ' To help us find out what went wrong,'
+ ' you may want to report this error to an administrator.'
+ ' Otherwise, please try again later.', [error]),
keys: {enter: 'close', escape: 'close'},
title: Ox._('Server {0}', [Ox.toTitleCase(error)])
})
.addClass('OxErrorDialog')

View file

@ -371,7 +371,7 @@ pandora.ui.folders = function(section) {
}
})
],
text: text,
content: text,
title: title
}).open();
}

View file

@ -4,9 +4,9 @@ pandora.ui.iconDialog = function(options) {
var options = Ox.extend({
closeButton: false,
content: '',
height: 128,
keys: null,
text: '',
title: '',
width: 368,
}, options),
@ -21,10 +21,13 @@ pandora.ui.iconDialog = function(options) {
.css({position: 'absolute', left: '16px', top: '16px', width: '64px', height: '64px'})
)
.append(
$('<div>')
Ox.isObject(options.content)
? options.content
.css({position: 'absolute', left: '96px', top: '16px', width: options.width - 112 + 'px'})
: $('<div>')
.addClass('OxTextPage')
.css({position: 'absolute', left: '96px', top: '16px', width: options.width - 112 + 'px'})
.html(options.text)
.html(options.content)
),
fixedSize: true,
height: options.height,

View file

@ -23,9 +23,9 @@ pandora.ui.makeListPrivateDialog = function(name, subscribers, callback) {
}
})
],
keys: {enter: 'make', escape: 'keep'},
text: Ox._('Are you sure you want to make the list "{0}" private and lose its {1}?',
content: Ox._('Are you sure you want to make the list "{0}" private and lose its {1}?',
[name, subscribers == 1 ? Ox._('subscriber') : Ox._('{0} subscribers', [subscribers])]),
keys: {enter: 'make', escape: 'keep'},
title: Ox._('Make List Private')
});

View file

@ -50,9 +50,11 @@ pandora.ui.metadataDialog = function(data) {
}
})
],
content: Ox._(
'To update the metadata for this {0}, please enter its IMDb ID.',
[pandora.site.itemName.singular.toLowerCase()]
),
keyboard: {enter: 'update', escape: 'close'},
text: Ox._('To update the metadata for this {0}, please enter its IMDb ID.',
[pandora.site.itemName.singular.toLowerCase()]),
title: Ox._('Update Metadata')
});
}
@ -130,9 +132,7 @@ pandora.ui.metadataDialog = function(data) {
}
})
],
height: 192,
keyboard: {enter: 'update', escape: 'cancel'},
text: Ox._('Are you sure you want to update the value'
content: Ox._('Are you sure you want to update the value'
+ (updateKeys.length == 1 ? '' : 's')
+ ' for {0}?', [updateKeys.map(function(key, index) {
return (
@ -140,7 +140,10 @@ pandora.ui.metadataDialog = function(data) {
: index < updateKeys.length - 1 ? ', '
: ' ' + Ox._('and') + ' '
) + getTitle(key)
}).join('')]),
}).join('')]
),
height: 192,
keyboard: {enter: 'update', escape: 'cancel'},
title: Ox._('Update Metadata')
});
}

View file

@ -26,8 +26,8 @@ pandora.ui.resetUIDialog = function(data) {
}
})
],
content: Ox._('Are you sure you want to reset all UI settings?'),
keys: {enter: 'reset', escape: 'cancel'},
text: Ox._('Are you sure you want to reset all UI settings?'),
title: Ox._('Reset UI Settings')
});

View file

@ -124,8 +124,8 @@ pandora.ui.uploadDocumentDialog = function(file, callback) {
}
})
],
title: Ox._('Upload File'),
text: text
content: text,
title: Ox._('Upload File')
});
}

View file

@ -897,10 +897,10 @@ pandora.ui.usersDialog = function() {
}
})
],
keys: {enter: 'close', escape: 'close'},
text: result.status.code == 200
content: result.status.code == 200
? Ox._('Your message has been sent.')
: Ox._('Your message could not be sent. Please try again.'),
keys: {enter: 'close', escape: 'close'},
title: result.status.code == 200
? Ox._('Message Sent')
: Ox._('Application Error')