Web Interface For Lite Argus Control modules
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.

83 lines
2.5 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  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.slider.Tip"></div>/**
  16. * @class Ext.slider.Tip
  17. * @extends Ext.Tip
  18. * Simple plugin for using an Ext.Tip with a slider to show the slider value. Example usage:
  19. <pre>
  20. new Ext.Slider({
  21. width: 214,
  22. minValue: 0,
  23. maxValue: 100,
  24. plugins: new Ext.slider.Tip()
  25. });
  26. </pre>
  27. * Optionally provide your own tip text by overriding getText:
  28. <pre>
  29. new Ext.Slider({
  30. width: 214,
  31. minValue: 0,
  32. maxValue: 100,
  33. plugins: new Ext.slider.Tip({
  34. getText: function(thumb){
  35. return String.format('<b>{0}% complete</b>', thumb.value);
  36. }
  37. })
  38. });
  39. </pre>
  40. */
  41. Ext.slider.Tip = Ext.extend(Ext.Tip, {
  42. minWidth: 10,
  43. offsets : [0, -10],
  44. init: function(slider) {
  45. slider.on({
  46. scope : this,
  47. dragstart: this.onSlide,
  48. drag : this.onSlide,
  49. dragend : this.hide,
  50. destroy : this.destroy
  51. });
  52. },
  53. /**
  54. * @private
  55. * Called whenever a dragstart or drag event is received on the associated Thumb.
  56. * Aligns the Tip with the Thumb's new position.
  57. * @param {Ext.slider.MultiSlider} slider The slider
  58. * @param {Ext.EventObject} e The Event object
  59. * @param {Ext.slider.Thumb} thumb The thumb that the Tip is attached to
  60. */
  61. onSlide : function(slider, e, thumb) {
  62. this.show();
  63. this.body.update(this.getText(thumb));
  64. this.doAutoWidth();
  65. this.el.alignTo(thumb.el, 'b-t?', this.offsets);
  66. },
  67. <div id="method-Ext.slider.Tip-getText"></div>/**
  68. * Used to create the text that appears in the Tip's body. By default this just returns
  69. * the value of the Slider Thumb that the Tip is attached to. Override to customize.
  70. * @param {Ext.slider.Thumb} thumb The Thumb that the Tip is attached to
  71. * @return {String} The text to display in the tip
  72. */
  73. getText : function(thumb) {
  74. return String(thumb.value);
  75. }
  76. });
  77. //backwards compatibility - SliderTip used to be a ux before 3.2
  78. Ext.ux.SliderTip = Ext.slider.Tip;</pre>
  79. </body>
  80. </html>