-
Notifications
You must be signed in to change notification settings - Fork 1
/
layout.jade
199 lines (181 loc) · 12.4 KB
/
layout.jade
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
doctype html
html(
lang = "en"
)
head
meta(
charset = "utf-8"
)
meta(
content = "width=device-width, initial-scale=1"
name = "viewport"
)
title(
ng-bind = "pageName.title()"
) Runnable
//- css
link(
href = "/build/css/index.css?v=#{locals.version}"
media = "screen"
rel = "stylesheet"
)
//- favicon
link(
href = "/build/images/favicon.png"
rel = "shortcut icon"
)
//- ios and safari icons
link(
href = "/build/images/icons-ios.png"
rel = "apple-touch-icon"
)
meta(
console = "Runnable"
name = "apple-mobile-web-app-title"
)
//- Stripe JS
script(
type = "text/javascript"
src = "https://js.stripe.com/v2/"
)
if locals.disableAnalytics
<!-- Google Analytics Disabled -->
else
//- segment
if env === 'production'
script.
!function(){var analytics=window.analytics=window.analytics||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","page","once","off","on"];analytics.factory=function(t){return function(){var e=Array.prototype.slice.call(arguments);e.unshift(t);analytics.push(e);return analytics}};for(var t=0;t<analytics.methods.length;t++){var e=analytics.methods[t];analytics[e]=analytics.factory(e)}analytics.load=function(t){var e=document.createElement("script");e.type="text/javascript";e.async=!0;e.src=("https:"===document.location.protocol?"https://":"http://")+"cdn.segment.com/analytics.js/v1/"+t+"/analytics.min.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(e,n)};analytics.SNIPPET_VERSION="3.1.0";
analytics.load("j1Mw1tCd2DMYkaBieGMAKfVLsP0B9iYg");
analytics.page();
}}();
analytics.ready(function () {
ga('require', 'linker');
ga('linker:autoLink', ['runnable.com', 'runnable.io']);
});
if env !== 'development'
script.
window._trackJs = {
token: 'ea5e26c7ec2d486e9c66bcf4fefa0f4b',
version: "#{locals.version}",
application: "production",
network: { error: false },
onError: function (payload, error) {
payload.network = payload.network.filter(function (item) {
return item.url.indexOf('mixpanel') === -1;
});
return true;
},
serialize: function (payload) {
return JSON.stringify(payload);
}
};
script(
src = "https://d2zah9y47r7bi2.cloudfront.net/releases/current/tracker.js"
)
//- SiftScience
script.
(function() {
function ls() {
var e = document.createElement('script');
e.src = 'https://cdn.siftscience.com/s.js';
document.body.appendChild(e);
}
if (window.attachEvent) {
window.attachEvent('onload', ls);
} else {
window.addEventListener('load', ls, false);
}
})();
//- Rollbar
script.
var _rollbarConfig = {
accessToken: "07537af868d741b495dbaaaf1bcb77f5",
captureUncaught: true,
payload: {
environment: "#{locals.rollbarEnv}",
client: {
javascript: {
source_map_enabled: true,
code_version: "#{locals.version}",
guess_uncaught_frames: true
}
}
}
};
!function(r){function t(e){if(o[e])return o[e].exports;var n=o[e]={exports:{},id:e,loaded:!1};return r[e].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var o={};return t.m=r,t.c=o,t.p="",t(0)}([function(r,t,o){"use strict";var e=o(1).Rollbar,n=o(2),a="https://d37gvrvc0wt4s1.cloudfront.net/js/v1.5/rollbar.min.js";_rollbarConfig.rollbarJsUrl=_rollbarConfig.rollbarJsUrl||a;var i=e.init(window,_rollbarConfig),l=n(i,_rollbarConfig);i.loadFull(window,document,!1,_rollbarConfig,l)},function(r,t){"use strict";function o(){var r=window.console;r&&"function"==typeof r.log&&r.log.apply(r,arguments)}function e(r,t){return t=t||o,function(){try{return r.apply(this,arguments)}catch(o){t("Rollbar internal error:",o)}}}function n(r,t,o){window._rollbarWrappedError&&(o[4]||(o[4]=window._rollbarWrappedError),o[5]||(o[5]=window._rollbarWrappedError._rollbarContext),window._rollbarWrappedError=null),r.uncaughtError.apply(r,o),t&&t.apply(window,o)}function a(r){this.shimId=++u,this.notifier=null,this.parentShim=r,this.logger=o,this._rollbarOldOnError=null}function i(r){var t=a;return e(function(){if(this.notifier)return this.notifier[r].apply(this.notifier,arguments);var o=this,e="scope"===r;e&&(o=new t(this));var n=Array.prototype.slice.call(arguments,0),a={shim:o,method:r,args:n,ts:new Date};return window._rollbarShimQueue.push(a),e?o:void 0})}function l(r,t){if(t.hasOwnProperty&&t.hasOwnProperty("addEventListener")){var o=t.addEventListener;t.addEventListener=function(t,e,n){o.call(this,t,r.wrap(e),n)};var e=t.removeEventListener;t.removeEventListener=function(r,t,o){e.call(this,r,t&&t._wrapped?t._wrapped:t,o)}}}var u=0;a.init=function(r,t){var o=t.globalAlias||"Rollbar";if("object"==typeof r[o])return r[o];r._rollbarShimQueue=[],r._rollbarWrappedError=null,t=t||{};var i=new a;return e(function(){if(i.configure(t),t.captureUncaught){i._rollbarOldOnError=r.onerror,r.onerror=function(){var r=Array.prototype.slice.call(arguments,0);n(i,i._rollbarOldOnError,r)};var e,a,u="EventTarget,Window,Node,ApplicationCache,AudioTrackList,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload".split(",");for(e=0;e<u.length;++e)a=u[e],r[a]&&r[a].prototype&&l(i,r[a].prototype)}return r[o]=i,i},i.logger)()},a.prototype.loadFull=function(r,t,o,n,a){var i=function(){var t;if(void 0===r._rollbarPayloadQueue){var o,e,n,i;for(t=new Error("rollbar.js did not load");o=r._rollbarShimQueue.shift();)for(n=o.args,i=0;i<n.length;++i)if(e=n[i],"function"==typeof e){e(t);break}}"function"==typeof a&&a(t)},l=t.createElement("script"),u=t.getElementsByTagName("script")[0];l.src=n.rollbarJsUrl,l.async=!o,l.onload=e(i,this.logger),u.parentNode.insertBefore(l,u)},a.prototype.wrap=function(r,t){try{var o;if(o="function"==typeof t?t:function(){return t||{}},"function"!=typeof r)return r;if(r._isWrap)return r;if(!r._wrapped){r._wrapped=function(){try{return r.apply(this,arguments)}catch(t){throw t._rollbarContext=o()||{},t._rollbarContext._wrappedSource=r.toString(),window._rollbarWrappedError=t,t}},r._wrapped._isWrap=!0;for(var e in r)r.hasOwnProperty(e)&&(r._wrapped[e]=r[e])}return r._wrapped}catch(n){return r}};for(var s="log,debug,info,warn,warning,error,critical,global,configure,scope,uncaughtError".split(","),p=0;p<s.length;++p)a.prototype[s[p]]=i(s[p]);r.exports={Rollbar:a,_rollbarWindowOnError:n}},function(r,t){"use strict";r.exports=function(r,t){return function(o){if(!o&&!window._rollbarInitialized){var e=window.RollbarNotifier,n=t||{},a=n.globalAlias||"Rollbar",i=window.Rollbar.init(n,r);i._processShimQueue(window._rollbarShimQueue||[]),window[a]=i,window._rollbarInitialized=!0,e.processPayloads()}}}}]);
script(
src = "/build/js/bundle.js?v=#{locals.version}"
)
//- mixpanel
if locals.disableMixpanel
<!-- Mixpanel Disabled -->
else
if (env === 'production')
script.
(function(f,b){if(!b.__SV){var a,e,i,g;window.mixpanel=b;b._i=[];b.init=function(a,e,d){function f(b,h){var a=h.split(".");2==a.length&&(b=b[a[0]],h=a[1]);b[h]=function(){b.push([h].concat(Array.prototype.slice.call(arguments,0)))}}var c=b;"undefined"!==typeof d?c=b[d]=[]:d="mixpanel";c.people=c.people||[];c.toString=function(b){var a="mixpanel";"mixpanel"!==d&&(a+="."+d);b||(a+=" (stub)");return a};c.people.toString=function(){return c.toString(1)+".people (stub)"};i="disable track track_pageview track_links track_forms register register_once alias unregister identify name_tag set_config people.set people.set_once people.increment people.append people.union people.track_charge people.clear_charges people.delete_user".split(" ");
for(g=0;g<i.length;g++)f(c,i[g]);b._i.push([a,e,d])};b.__SV=1.2;a=f.createElement("script");a.type="text/javascript";a.async=!0;a.src="undefined"!==typeof MIXPANEL_CUSTOM_LIB_URL?MIXPANEL_CUSTOM_LIB_URL:"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js";e=f.getElementsByTagName("script")[0];e.parentNode.insertBefore(a,e)}})(document,window.mixpanel||[]);
mixpanel.init("57260a5b6fc972e9c69184882efd009e", { api_host: "#{locals.mixpanelProxyUrl}" });
else
script.
(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,
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 people.set people.set_once people.increment people.append people.union people.track_charge people.clear_charges people.delete_user".split(" ");
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&&"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js".match(/^\/\//)?"https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js":"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js";c=e.getElementsByTagName("script")[0];c.parentNode.insertBefore(b,c)}})(document,window.mixpanel||[]);
mixpanel.init("497564c7e1dc7e803edc5d4ca8583653", { api_host: "#{locals.mixpanelProxyUrl}" });
body(
ng-class = "{'modal-open': ModalService.modalLayers.length > 0 || dataApp.data.modalError.data.in || dataApp.data.modalOpen}"
ng-click = "dataApp.documentClickEventHandler($event)"
ng-keydown = "dataApp.documentKeydownEventHandler($event)"
)
//
TIME: #{locals.commitTime}
HASH: #{locals.commitHash}
LINK: http://github.com/codenow/runnable-angular/commits/#{locals.commitHash}
//- svg file
.svg-defs(
ng-include = "'svgDefs'"
)
//- modals
div(
modal-manager
modal-open = "dataApp.data.modalOpen"
)
.spinner-wrapper.spinner-md.spinner-gray.spinner-backdrop.spinner-fixed(
ng-if = "!dataApp"
ng-include = "'spinner'"
)
//- page
.layout-wrapper(
ui-view
)
//- error modal
.modal-backdrop.modal-backdrop-error(
ng-class = "{'in': dataApp.data.modalError.data.in}"
ng-click = "$event.stopPropagation()"
ng-if = "dataApp.data.modalError.data.in"
)
.modal-dialog.modal-md.modal-error
header.modal-header
h1.modal-heading Oops! An error occured.
svg.iconnables.icons-close(
ng-click = "dataApp.data.modalError.actions.close(defaultActions.cancel);"
)
use(
xlink:href = "#icons-close"
)
section.modal-body.clearfix
.modal-description.well.well-code.monospace(
ng-repeat = "error in dataApp.data.modalError.data.errors track by $index"
) {{error.message}}
footer.modal-footer
button.btn.btn-md.white.btn-block(
ng-click = "dataApp.data.modalError.actions.close(defaultActions.cancel);"
) Dismiss
//- Intercom
if env === 'production'
script(
src = "https://widget.intercom.io/widget/wqzm3rju"
)
else
script(
src = "https://widget.intercom.io/widget/xs5g95pd"
)