Initial commit
This commit is contained in:
44
lib/assets/javascripts/builder/editor/feedback/feedback-button-view.js
Executable file
44
lib/assets/javascripts/builder/editor/feedback/feedback-button-view.js
Executable file
@@ -0,0 +1,44 @@
|
||||
var CoreView = require('backbone/core-view');
|
||||
var template = require('./feedback-button.tpl');
|
||||
var TipsyTooltipView = require('builder/components/tipsy-tooltip-view');
|
||||
|
||||
module.exports = CoreView.extend({
|
||||
|
||||
tagName: 'a',
|
||||
className: 'EditorMenu-feedback typeform-share button js-feedback',
|
||||
|
||||
attributes: {
|
||||
href: '',
|
||||
target: ''
|
||||
},
|
||||
|
||||
events: {
|
||||
'click': '_onClick'
|
||||
},
|
||||
|
||||
initialize: function (opts) {
|
||||
if (!opts.modals) throw new Error('modals is required');
|
||||
this._modals = opts.modals;
|
||||
},
|
||||
|
||||
render: function () {
|
||||
this.clearSubViews();
|
||||
|
||||
this.$el.append(template());
|
||||
|
||||
var tooltip = new TipsyTooltipView({
|
||||
el: this.el,
|
||||
gravity: 'w',
|
||||
title: function () {
|
||||
return _t('feedback');
|
||||
}
|
||||
});
|
||||
this.addView(tooltip);
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
_onClick: function () {
|
||||
this.$el.blur();
|
||||
}
|
||||
});
|
||||
8
lib/assets/javascripts/builder/editor/feedback/feedback-button.tpl
Executable file
8
lib/assets/javascripts/builder/editor/feedback/feedback-button.tpl
Executable file
@@ -0,0 +1,8 @@
|
||||
<svg width="18px" height="16px" viewBox="-1 -1 18 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="feedback" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<path d="M16,11 L8,11 L5,14 L5,11 L0,11 L0,0 L16,0 L16,11 Z M7.29289322,10.2928932 L7.58578644,10 L8,10 L15,10.0047607 L15.0084229,1 L1,0.993103027 L1,10 L5,10 L6,10 L6,11 L6,11.5374756 L7.29289322,10.2928932 Z" id="Combined-Shape" fill="#FFFFFF "></path>
|
||||
<rect id="Rectangle-25" fill="#FFFFFF " x="4" y="3" width="8" height="1"></rect>
|
||||
<rect id="Rectangle-25" fill="#FFFFFF " x="4" y="5" width="8" height="1"></rect>
|
||||
<rect id="Rectangle-25" fill="#FFFFFF " x="4" y="7" width="5" height="1"></rect>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 753 B |
2
lib/assets/javascripts/builder/editor/feedback/feedback-modal.tpl
Executable file
2
lib/assets/javascripts/builder/editor/feedback/feedback-modal.tpl
Executable file
@@ -0,0 +1,2 @@
|
||||
<div class="typeform-widget" data-url="https://cartohq.typeform.com/to/t7Dk8K" data-text="CARTO Builder" style="width:100%;height:100%;"></div>
|
||||
<script>(function(){var qs,js,q,s,d=document,gi=d.getElementById,ce=d.createElement,gt=d.getElementsByTagName,id='typef_orm',b='https://s3-eu-west-1.amazonaws.com/share.typeform.com/';if(!gi.call(d,id)){js=ce.call(d,'script');js.id=id;js.src=b+'widget.js';q=gt.call(d,'script')[0];q.parentNode.insertBefore(js,q)}})()</script>
|
||||
Reference in New Issue
Block a user