How to show only the contact form on a Uservoice widget? - uservoice

I'm using the Uservoice JS widget API to display only the contact form, but it always reverts to showing the 'Post an idea' (smartvote) form. Here's what I've configured:
UserVoice.push(['set', {
accent_color: '#000000',
trigger_color: 'white',
trigger_background_color: '#c9000b',
contact_enabled: true,
smartvote_enabled: false,
post_suggestion_enabled: false
}]);
// Add default trigger to the bottom-right corner of the window:
UserVoice.push(['addTrigger', {
trigger_position: 'top-right',
trigger_style: 'tab',
mode: 'contact'
}]);
Any ideas?

Related

Changing ui-views from other ui-views with Angular UI-router

I have a page with 2 ui-views, the top view has a form and some controls and the bottom view will be changed by the top view, but defaults to displaying a few tables.
I decided to try and do this initial page all in one state, and I am wondering if this is the correct way in this case. The state is called "tracker" and has the views with content as described above. When the user clicks a button in the top view, I want the bottom view to display alternate content (e.g. a map).
I can figure out how to change state "tracker" (views loaded with "controls.html" and "content.html") to a complete second state ("controls.html" and "map.html").
What I'm confused about is how would I change only the bottom view content#tracker between "contact.html" and "map.html" based on the button state in the top view.
The router is:
(function() {
'use strict';
angular.module('pb.tracker').config(function($stateProvider) {
$stateProvider.state('tracker', {
url: '/tracker',
controller: 'TrackerController as track',
data: {
pageTitle: 'Parcel Tracker',
access: 'public',
bodyClass: 'tracker'
},
views: {
'': {
templateUrl: 'modules/tracker/templates/tracker.html'
},
'controls#tracker': {
templateUrl: 'modules/tracker/templates/tracker-controls.html'
},
'content#tracker': {
templateUrl: 'modules/tracker/templates/tracker-details.html'
}
}
});
});
})();
and the base page's html is
<div class="container">
<div class="row spacer-top-xl">
<div class="col-md-12">
<div ui-view="controls"></div>
<div ui-view="content"></div>
</div>
</div>
</div>
One way out is using $broadcast and $on :
From the top view controller..
$scope.sendBroadcast = function() {
$rootScope.$broadcast('myAction');
}
and from the bottom view controller
$scope.$on('myAction', function() {
//Message received
});
another option may be using a service and $watch on a particular value for change.

Bootstrap popover contents coming but not showing in html

I am having trouble in showing popover.
Scenerio:
I want to show popover on hover, and popeover's content comes from ajax request.
Coffeescript:
$('.preview').bind 'mouseenter', ->
that = #
unless $(#).data('original-title')
$.ajax
type: "get"
url: $(that).data('url')
success: (data) ->
$(that).data('content', data)
$(that).popover({
html: true
delay: { show: 100, hide: 360000 }
trigger: 'hover'
content: data
template: '<div class="popover preview-popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
})
this code generate a small popover .... which have contents(ajax loaded html) but not visible

How can i add a button on a div in my tpl inside a dataview?

i have a problem trying to add a button in a tpl. i have this inside a panel. I want to upload a file trough this button. the record its getting in the itemClick listener, and i can edit and save the record in the db, but i want to upload a file with this.
items:{
height: 310,
bind: '{somestore}',
id: 'somestore-panel',
xtype: 'dataview',
columnWidth: '100',
tpl: [
'<tpl for="." >',
'<div id="upload-button" ></div>',
'</tpl>'
]
cls: 'div-selection',
overItemCls: 'over-selection',
listeners: {
'itemclick': 'onClickDataButton',
afterrender:function(){
var button = new Ext.Button({
renderTo:'upload-button',
xtype: 'filefield',
text:'Vote',
width:100,
id:'upload-form',
handler:function(){
alert('Vote Button is clicked');
}
})
console.log(button);
}
}
}
and its returning a
Cannot read property 'dom' of null
All the store its getting correct and all its fine if i dont use a button, i dont know if there is a better way to add a component.

Multiple Jquery-ui dilaog box with one button

I am using jquery ui Dialog box. It works fine but I have a requirement that with one button I should be able to create a dialog box with each click.
So Eg: On first click a dialog box is opened. On second click, a new dialog must be created with the first one intact at it's place. I am implementing sticky notes using this.
How can this be achieved??
You can create Modal Dialog Dynamically
$("button").click(function () {
var dynamicDialog = $('<div id="MyDialog">cotent </div>');
dynamicDialog.dialog({
title: "Success Message",
modal: false,
buttons: [{
text: "Yes",
click: function () {}
}]
});
});
Demo
Note: since all come on same location just move and see the new dialog in the demo

MVC 4 Edit and Insert in same HTML

I want to use modal popups for editing and inserting at view html but i couldn't be sure how to do this?
Is there any way to do this?
I don't want to create new html for insert form because there is only name field. Modal pop-up will suit perfectly i think.
Create your html
<div id="demoDialog" title="Dialog Title">
<!-- Content, form, etc. -->
<form></form>
</div>
Initialize the dialog window
Reference: http://api.jqueryui.com/1.8/dialog/
// Dialog creation
$("#demoDialog").dialog({
resizable: false,
draggable: false,
autoOpen: false,
modal: true,
open: function(){
$(".ui-widget-overlay").hide().fadeTo(800, 0.8);
}
});
// Open the dialog
$("#showDialog").click(function(){
$("#demoDialog").dialog( "open" );
return false;
});
You can use a partial view to load your html content. Have inside your dialog ID somehow to store the value returned from the modal window if you need to feed it to another form or processing.