api-console-assets
Version:
This repo only exists to publish api console components to npm
73 lines (66 loc) • 2.09 kB
HTML
<!--
@license
Copyright 2016 The Advanced REST client authors
Licensed under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the License. You may obtain a copy of
the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations under
the License.
-->
<link rel="import" href="../polymer/polymer.html">
<script>
(function() {
window.ArcBehaviors = window.ArcBehaviors || {};
/**
* Contains properties and function required for OAuth authorization.
*
* @polymerBehavior ArcBehaviors.OAuthBehabior
*/
window.ArcBehaviors.OAuthBehabior = {
/**
* Fired when the auth method has been enabled.
*
* @event authorization-enabled
* @param {Object} settings Current settings at the moment of enabling the auth method.
* Don't rely on this values to construct auth data since it may change later during runetime.
*/
/**
* Fired when the auth method has been disabled.
*
* @event authorization-disabled
* @param {Object} settings Current settings at the moment of disabling the auth method.
*/
properties: {
/**
* True if this auth method is enabled.
*/
enabled: {
type: Boolean,
value: false,
notify: true
},
/**
* If set, it displays a description of usage in the panel. It should inherited from
* RAML spec.
*/
description: String
},
observers: [
'_enabledChanged(enabled)'
],
_enabledChanged: function(enabled) {
var name = 'authorization-' + (enabled ? 'enabled' : 'disabled');
this.fire(name, {
settings: this.settings
});
},
_computeEnabledLabel: function(enabled) {
return enabled ? 'ON' : 'OFF';
}
};
})();
</script>