/* * Copyright (c) 2015 * * This file is licensed under the Affero General Public License version 3 * or later. * * See the COPYING-README file. * */ (function() { if (!OC.Share) { OC.Share = {}; } var PASSWORD_PLACEHOLDER = '**********'; var PASSWORD_PLACEHOLDER_MESSAGE = t('core', 'Choose a password for the public link'); var TEMPLATE = '{{#if shareAllowed}}' + '' + '' + '' + '
' + '' + '' + ' {{#if showPasswordCheckBox}}' + '' + '' + ' {{/if}}' + '
' + ' ' + ' ' + ' ' + '
' + ' {{#if publicUpload}}' + '
' + ' ' + ' ' + '' + '
' + ' {{/if}}' + ' {{#if mailPublicNotificationEnabled}}' + '' + ' {{/if}}' + '{{else}}' + // FIXME: this doesn't belong in this view '' + '{{/if}}' ; /** * @class OCA.Share.ShareDialogLinkShareView * @member {OC.Share.ShareItemModel} model * @member {jQuery} $el * @memberof OCA.Sharing * @classdesc * * Represents the GUI of the share dialogue * */ var ShareDialogLinkShareView = OC.Backbone.View.extend({ /** @type {string} **/ id: 'shareDialogLinkShare', /** @type {OC.Share.ShareConfigModel} **/ configModel: undefined, /** @type {Function} **/ _template: undefined, /** @type {boolean} **/ showLink: true, events: { 'submit .emailPrivateLinkForm': '_onEmailPrivateLink', 'focusout input.linkPassText': 'onPasswordEntered', 'keyup input.linkPassText': 'onPasswordKeyUp', 'click .linkCheckbox': 'onLinkCheckBoxChange', 'click .linkText': 'onLinkTextClick', 'change .publicUploadCheckbox': 'onAllowPublicUploadChange', 'click .showPasswordCheckbox': 'onShowPasswordClick' }, initialize: function(options) { var view = this; this.model.on('change:permissions', function() { view.render(); }); this.model.on('change:itemType', function() { view.render(); }); this.model.on('change:allowPublicUploadStatus', function() { view.render(); }); this.model.on('change:linkShare', function() { view.render(); }); if(!_.isUndefined(options.configModel)) { this.configModel = options.configModel; } else { throw 'missing OC.Share.ShareConfigModel'; } _.bindAll( this, '_onEmailPrivateLink', 'onLinkCheckBoxChange', 'onPasswordEntered', 'onPasswordKeyUp', 'onLinkTextClick', 'onShowPasswordClick', 'onAllowPublicUploadChange' ); }, onLinkCheckBoxChange: function() { var $checkBox = this.$el.find('.linkCheckbox'); var $loading = $checkBox.siblings('.icon-loading-small'); if(!$loading.hasClass('hidden')) { return false; } if($checkBox.is(':checked')) { if(this.configModel.get('enforcePasswordForPublicLink') === false) { $loading.removeClass('hidden'); // this will create it this.model.saveLinkShare(); } else { this.$el.find('.linkPass').slideToggle(OC.menuSpeed); this.$el.find('.linkPassText').focus(); } } else { $loading.removeClass('hidden'); if (this.model.get('linkShare').isLinkShare) { this.model.removeLinkShare(); } else { this.$el.find('.linkPass').slideToggle(OC.menuSpeed); } } }, onLinkTextClick: function() { var $el = this.$el.find('.linkText'); $el.focus(); $el.select(); }, onShowPasswordClick: function() { this.$el.find('.linkPass').slideToggle(OC.menuSpeed); if(!this.$el.find('.showPasswordCheckbox').is(':checked')) { this.model.setPassword(''); this.model.saveLinkShare(); } else { this.$el.find('.linkPassText').focus(); } }, onPasswordKeyUp: function(event) { if(event.keyCode == 13) { this.onPasswordEntered(); } }, onPasswordEntered: function() { var self = this; var $loading = this.$el.find('.linkPass .icon-loading-small'); if (!$loading.hasClass('hidden')) { // still in process return; } var $input = this.$el.find('.linkPassText'); $input.removeClass('error'); var password = $input.val(); // in IE9 the password might be the placeholder due to bugs in the placeholders polyfill if(password === '' || password === PASSWORD_PLACEHOLDER || password === PASSWORD_PLACEHOLDER_MESSAGE) { return; } $loading .removeClass('hidden') .addClass('inlineblock'); this.model.setPassword(password); this.model.saveLinkShare({}, { error: function(model, msg) { $loading.removeClass('inlineblock').addClass('hidden'); $input.addClass('error'); $input.attr('title', msg); $input.tooltip({placement: 'bottom', trigger: 'manual'}); $input.tooltip('show'); } }); }, onAllowPublicUploadChange: function() { var $checkbox = this.$('.publicUploadCheckbox'); $checkbox.siblings('.icon-loading-small').removeClass('hidden').addClass('inlineblock'); this.model.setPublicUpload($checkbox.is(':checked')); this.model.saveLinkShare(); }, _onEmailPrivateLink: function(event) { event.preventDefault(); var $emailField = this.$el.find('.emailField'); var $emailButton = this.$el.find('.emailButton'); var email = $emailField.val(); if (email !== '') { $emailField.prop('disabled', true); $emailButton.prop('disabled', true); $emailField.val(t('core', 'Sending ...')); this.model.sendEmailPrivateLink(email).done(function() { $emailField.css('font-weight', 'bold').val(t('core','Email sent')); setTimeout(function() { $emailField.val(''); $emailField.css('font-weight', 'normal'); $emailField.prop('disabled', false); $emailButton.prop('disabled', false); }, 2000); }).fail(function() { $emailField.val(email); $emailField.css('font-weight', 'normal'); $emailField.prop('disabled', false); $emailButton.prop('disabled', false); }); } return false; }, render: function() { var linkShareTemplate = this.template(); if( !this.model.sharePermissionPossible() || !this.showLink || !this.configModel.isShareWithLinkAllowed()) { this.$el.html(linkShareTemplate({ shareAllowed: false, noSharingPlaceholder: t('core', 'Resharing is not allowed') })); return this; } var publicUpload = this.model.isFolder() && this.model.createPermissionPossible() && this.configModel.isPublicUploadEnabled(); var publicUploadChecked = ''; if(this.model.isPublicUploadAllowed()) { publicUploadChecked = 'checked="checked"'; } var isLinkShare = this.model.get('linkShare').isLinkShare; var isPasswordSet = !!this.model.get('linkShare').password; var showPasswordCheckBox = isLinkShare && ( !this.configModel.get('enforcePasswordForPublicLink') || !this.model.get('linkShare').password); this.$el.html(linkShareTemplate({ cid: this.cid, shareAllowed: true, isLinkShare: isLinkShare, shareLinkURL: this.model.get('linkShare').link, linkShareLabel: t('core', 'Share link'), urlLabel: t('core', 'Link'), enablePasswordLabel: t('core', 'Password protect'), passwordLabel: t('core', 'Password'), passwordPlaceholder: isPasswordSet ? PASSWORD_PLACEHOLDER : PASSWORD_PLACEHOLDER_MESSAGE, isPasswordSet: isPasswordSet, showPasswordCheckBox: showPasswordCheckBox, publicUpload: publicUpload && isLinkShare, publicUploadChecked: publicUploadChecked, publicUploadLabel: t('core', 'Allow editing'), mailPublicNotificationEnabled: isLinkShare && this.configModel.isMailPublicNotificationEnabled(), mailPrivatePlaceholder: t('core', 'Email link to person'), mailButtonText: t('core', 'Send') })); var $emailField = this.$el.find('.emailField'); if (isLinkShare && $emailField.length !== 0) { $emailField.autocomplete({ minLength: 1, source: function (search, response) { $.get( OC.generateUrl('core/ajax/share.php'), { fetch: 'getShareWithEmail', search: search.term }, function(result) { if (result.status == 'success' && result.data.length > 0) { response(result.data); } }); }, select: function( event, item ) { $emailField.val(item.item.email); return false; } }) .data("ui-autocomplete")._renderItem = function( ul, item ) { return $('
  • ') .append('' + escapeHTML(item.displayname) + "
    " + escapeHTML(item.email) + '
    ' ) .appendTo( ul ); }; } // TODO drop with IE8 drop if($('html').hasClass('ie8')) { this.$el.find('#linkPassText').removeAttr('placeholder'); this.$el.find('#linkPassText').val(''); } this.delegateEvents(); return this; }, /** * @returns {Function} from Handlebars * @private */ template: function () { if (!this._template) { this._template = Handlebars.compile(TEMPLATE); } return this._template; } }); OC.Share.ShareDialogLinkShareView = ShareDialogLinkShareView; })(); fbox-pdfbox-3.0.4 Mirror of Apache POI: https://github.com/apache/poiwww-data
    aboutsummaryrefslogtreecommitdiffstats
    path: root/src/testcases/org/apache/poi/util/TestLocaleUtil.java
    blob: 3335b85368b70aae950fe58f1740794a6dbc3b45 (plain)
    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