weaver 0.6.5 → 0.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/weaver/version.rb +1 -1
- data/lib/weaver.rb +41 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d79df70298b5914b1caacc2e32881021fda13edd
|
4
|
+
data.tar.gz: a9bb0ec34a54de9eb63bcd8d9417503b2f1304b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6eb9e11f33e3754af976c41562c08eb0ccd2b946690c29666b5eabcd4236965dfb1c56f608c0f8200b279add1722f73718fd1e869e199cfb1c8ee8e33f95bf8
|
7
|
+
data.tar.gz: 191d819c7ad47d2931c91e5b38098318f7c3a0491b41b5209be95bc1b6143ee2557667575f17f3b57c7b2e181ca6a5ea2df20332107613e958b021a46797dbd4
|
data/lib/weaver/version.rb
CHANGED
data/lib/weaver.rb
CHANGED
@@ -1647,7 +1647,7 @@ function get_#{@formName}_object()
|
|
1647
1647
|
@paneltype = type
|
1648
1648
|
end
|
1649
1649
|
|
1650
|
-
def tab(title, &block)
|
1650
|
+
def tab(title, options={}, &block)
|
1651
1651
|
|
1652
1652
|
if !@anchors["tabs"]
|
1653
1653
|
@anchors["tabs"] = []
|
@@ -1667,6 +1667,14 @@ function get_#{@formName}_object()
|
|
1667
1667
|
elem: elem
|
1668
1668
|
}
|
1669
1669
|
|
1670
|
+
if options[:mixpanel_event_name]
|
1671
|
+
@tabs[tabname][:mixpanel_event_name] = options[:mixpanel_event_name]
|
1672
|
+
end
|
1673
|
+
|
1674
|
+
if options[:mixpanel_event_props]
|
1675
|
+
@tabs[tabname][:mixpanel_event_props] = options[:mixpanel_event_props]
|
1676
|
+
end
|
1677
|
+
|
1670
1678
|
end
|
1671
1679
|
|
1672
1680
|
def generate
|
@@ -1690,7 +1698,21 @@ function get_#{@formName}_object()
|
|
1690
1698
|
body false
|
1691
1699
|
title do
|
1692
1700
|
div :class => "panel-title" do
|
1693
|
-
|
1701
|
+
options = {
|
1702
|
+
:"data-toggle" => "collapse",
|
1703
|
+
:"data-parent" => "##{accordion_name}",
|
1704
|
+
href: "##{anchor}"
|
1705
|
+
}
|
1706
|
+
|
1707
|
+
if value[:mixpanel_event_name]
|
1708
|
+
props = {}
|
1709
|
+
if value[:mixpanel_event_props].is_a? Hash
|
1710
|
+
props = value[:mixpanel_event_props]
|
1711
|
+
end
|
1712
|
+
options[:onclick] = "mixpanel.track('#{value[:mixpanel_event_name]}', #{props.to_json.gsub('"',"'")})"
|
1713
|
+
end
|
1714
|
+
|
1715
|
+
a options do
|
1694
1716
|
if value[:title].is_a? Symbol
|
1695
1717
|
icon value[:title]
|
1696
1718
|
else
|
@@ -1930,6 +1952,16 @@ function get_#{@formName}_object()
|
|
1930
1952
|
SCRIPT_DECL
|
1931
1953
|
}.join "\n"
|
1932
1954
|
|
1955
|
+
extra_stuff = ""
|
1956
|
+
|
1957
|
+
if @global_settings[:mixpanel_token]
|
1958
|
+
extra_stuff += '<!-- start Mixpanel --><script type="text/javascript">(function(e,a){if(!a.__SV){var b=window;try{var c,l,i,j=b.location,g=j.hash;c=function(a,b){return(l=a.match(RegExp(b+"=([^&]*)")))?l[1]:null};g&&c(g,"state")&&(i=JSON.parse(decodeURIComponent(c(g,"state"))),"mpeditor"===i.action&&(b.sessionStorage.setItem("_mpcehash",g),history.replaceState(i.desiredHash||"",e.title,j.pathname+j.search)))}catch(m){}var k,h;window.mixpanel=a;a._i=[];a.init=function(b,c,f){function e(b,a){var c=a.split(".");2==c.length&&(b=b[c[0]],a=c[1]);b[a]=function(){b.push([a].concat(Array.prototype.slice.call(arguments,
|
1959
|
+
0)))}}var d=a;"undefined"!==typeof f?d=a[f]=[]:f="mixpanel";d.people=d.people||[];d.toString=function(b){var a="mixpanel";"mixpanel"!==f&&(a+="."+f);b||(a+=" (stub)");return a};d.people.toString=function(){return d.toString(1)+".people (stub)"};k="disable time_event track track_pageview track_links track_forms register register_once alias unregister identify name_tag set_config reset opt_in_tracking opt_out_tracking has_opted_in_tracking has_opted_out_tracking clear_opt_in_out_tracking people.set people.set_once people.unset people.increment people.append people.union people.track_charge people.clear_charges people.delete_user".split(" ");
|
1960
|
+
for(h=0;h<k.length;h++)e(d,k[h]);a._i.push([b,c,f])};a.__SV=1.2;b=e.createElement("script");b.type="text/javascript";b.async=!0;b.src="undefined"!==typeof MIXPANEL_CUSTOM_LIB_URL?MIXPANEL_CUSTOM_LIB_URL:"file:"===e.location.protocol&&"//cdn4.mxpnl.com/libs/mixpanel-2-latest.min.js".match(/^\/\//)?"https://cdn4.mxpnl.com/libs/mixpanel-2-latest.min.js":"//cdn4.mxpnl.com/libs/mixpanel-2-latest.min.js";c=e.getElementsByTagName("script")[0];c.parentNode.insertBefore(b,c)}})(document,window.mixpanel||[]);
|
1961
|
+
mixpanel.init("'+@global_settings[:mixpanel_token]+'");</script><!-- end Mixpanel -->'
|
1962
|
+
end
|
1963
|
+
|
1964
|
+
|
1933
1965
|
result =<<-SKELETON
|
1934
1966
|
<!DOCTYPE html>
|
1935
1967
|
<html>
|
@@ -1950,7 +1982,9 @@ function get_#{@formName}_object()
|
|
1950
1982
|
<link href="#{mod}css/animate.css" rel="stylesheet">
|
1951
1983
|
|
1952
1984
|
#{extra_css}
|
1953
|
-
|
1985
|
+
|
1986
|
+
#{extra_stuff}
|
1987
|
+
|
1954
1988
|
</head>
|
1955
1989
|
|
1956
1990
|
#{body_tag}
|
@@ -2495,6 +2529,10 @@ $( document ).ready(function() {
|
|
2495
2529
|
instance_eval(File.read(file), file)
|
2496
2530
|
end
|
2497
2531
|
|
2532
|
+
def set_global(key, value)
|
2533
|
+
@global_settings[key] = value
|
2534
|
+
end
|
2535
|
+
|
2498
2536
|
def center_page(path, title=nil, options={}, &block)
|
2499
2537
|
|
2500
2538
|
if title == nil
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: weaver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Siaw
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-07-
|
11
|
+
date: 2018-07-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -31347,7 +31347,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
31347
31347
|
version: '0'
|
31348
31348
|
requirements: []
|
31349
31349
|
rubyforge_project:
|
31350
|
-
rubygems_version: 2.6.
|
31350
|
+
rubygems_version: 2.6.11
|
31351
31351
|
signing_key:
|
31352
31352
|
specification_version: 4
|
31353
31353
|
summary: Website generator
|