summaryrefslogtreecommitdiffstats
path: root/debian/missing-sources/epoch/src/adapters/jQuery.coffee
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 15:26:01 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 15:26:01 +0000
commitef03469fec14f1f0358b690934fc173d744f4e7d (patch)
tree8be439d7b2f1d7c8283b745919b9e66481a950e7 /debian/missing-sources/epoch/src/adapters/jQuery.coffee
parentAdding upstream version 5.6.0. (diff)
downloadknot-resolver-debian/5.6.0-1.tar.xz
knot-resolver-debian/5.6.0-1.zip
Adding debian version 5.6.0-1.debian/5.6.0-1debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/missing-sources/epoch/src/adapters/jQuery.coffee')
-rw-r--r--debian/missing-sources/epoch/src/adapters/jQuery.coffee18
1 files changed, 18 insertions, 0 deletions
diff --git a/debian/missing-sources/epoch/src/adapters/jQuery.coffee b/debian/missing-sources/epoch/src/adapters/jQuery.coffee
new file mode 100644
index 0000000..e115bad
--- /dev/null
+++ b/debian/missing-sources/epoch/src/adapters/jQuery.coffee
@@ -0,0 +1,18 @@
+jQueryModule = ($) ->
+ # Data key to use for storing a reference to the chart instance on an element.
+ DATA_NAME = 'epoch-chart'
+
+ # Adds an Epoch chart of the given type to the referenced element.
+ # @param [Object] options Options for the chart.
+ # @option options [String] type The type of chart to append to the referenced element.
+ # @return [Object] The chart instance that was associated with the containing element.
+ $.fn.epoch = (options) ->
+ options.el = @get(0)
+ unless (chart = @data(DATA_NAME))?
+ klass = Epoch._typeMap[options.type]
+ unless klass?
+ Epoch.exception "Unknown chart type '#{options.type}'"
+ @data DATA_NAME, (chart = new klass options)
+ return chart
+
+jQueryModule(jQuery) if window.jQuery?