Web UI for ARGUS server
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

73 lines
3.1 KiB

6 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  4. <title>The source code</title>
  5. <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
  6. <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
  7. </head>
  8. <body onload="prettyPrint();">
  9. <pre class="prettyprint lang-js">/*!
  10. * Ext JS Library 3.3.1
  11. * Copyright(c) 2006-2010 Sencha Inc.
  12. * licensing@sencha.com
  13. * http://www.sencha.com/license
  14. */
  15. <div id="cls-Ext.form.Label"></div>/**
  16. * @class Ext.form.Label
  17. * @extends Ext.BoxComponent
  18. * Basic Label field.
  19. * @constructor
  20. * Creates a new Label
  21. * @param {Ext.Element/String/Object} config The configuration options. If an element is passed, it is set as the internal
  22. * element and its id used as the component id. If a string is passed, it is assumed to be the id of an existing element
  23. * and is used as the component id. Otherwise, it is assumed to be a standard config object and is applied to the component.
  24. * @xtype label
  25. */
  26. Ext.form.Label = Ext.extend(Ext.BoxComponent, {
  27. <div id="cfg-Ext.form.Label-text"></div>/**
  28. * @cfg {String} text The plain text to display within the label (defaults to ''). If you need to include HTML
  29. * tags within the label's innerHTML, use the {@link #html} config instead.
  30. */
  31. <div id="cfg-Ext.form.Label-forId"></div>/**
  32. * @cfg {String} forId The id of the input element to which this label will be bound via the standard HTML 'for'
  33. * attribute. If not specified, the attribute will not be added to the label.
  34. */
  35. <div id="cfg-Ext.form.Label-html"></div>/**
  36. * @cfg {String} html An HTML fragment that will be used as the label's innerHTML (defaults to '').
  37. * Note that if {@link #text} is specified it will take precedence and this value will be ignored.
  38. */
  39. // private
  40. onRender : function(ct, position){
  41. if(!this.el){
  42. this.el = document.createElement('label');
  43. this.el.id = this.getId();
  44. this.el.innerHTML = this.text ? Ext.util.Format.htmlEncode(this.text) : (this.html || '');
  45. if(this.forId){
  46. this.el.setAttribute('for', this.forId);
  47. }
  48. }
  49. Ext.form.Label.superclass.onRender.call(this, ct, position);
  50. },
  51. <div id="method-Ext.form.Label-setText"></div>/**
  52. * Updates the label's innerHTML with the specified string.
  53. * @param {String} text The new label text
  54. * @param {Boolean} encode (optional) False to skip HTML-encoding the text when rendering it
  55. * to the label (defaults to true which encodes the value). This might be useful if you want to include
  56. * tags in the label's innerHTML rather than rendering them as string literals per the default logic.
  57. * @return {Label} this
  58. */
  59. setText : function(t, encode){
  60. var e = encode === false;
  61. this[!e ? 'text' : 'html'] = t;
  62. delete this[e ? 'text' : 'html'];
  63. if(this.rendered){
  64. this.el.dom.innerHTML = encode !== false ? Ext.util.Format.htmlEncode(t) : t;
  65. }
  66. return this;
  67. }
  68. });
  69. Ext.reg('label', Ext.form.Label);</pre>
  70. </body>
  71. </html>