Questtype ?Textinput?: add support for field sizes (Issue #252) and general improvements
This commit is contained in:
commit
8d903135a5
3476 changed files with 599099 additions and 0 deletions
|
|
@ -0,0 +1,7 @@
|
|||
thumbs-up.png
|
||||
https://www.iconfinder.com/icons/83403/thumbs_up_icon#size=32
|
||||
Creative Commons (Attribution-Share Alike 3.0 Unported)
|
||||
|
||||
thumbs-down.png
|
||||
https://www.iconfinder.com/icons/83402/down_thumbs_icon#size=32
|
||||
Creative Commons (Attribution-Share Alike 3.0 Unported)
|
||||
23
www/analytics/plugins/Feedback/angularjs/ratefeature/ratefeature-controller.js
vendored
Normal file
23
www/analytics/plugins/Feedback/angularjs/ratefeature/ratefeature-controller.js
vendored
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
/*!
|
||||
* Piwik - Web Analytics
|
||||
*
|
||||
* @link http://piwik.org
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
|
||||
*/
|
||||
|
||||
angular.module('piwikApp').controller('RateFeatureController', function($scope, rateFeatureModel, $filter){
|
||||
|
||||
$scope.dislikeFeature = function () {
|
||||
$scope.like = false;
|
||||
};
|
||||
|
||||
$scope.likeFeature = function () {
|
||||
$scope.like = true;
|
||||
};
|
||||
|
||||
$scope.sendFeedback = function (message) {
|
||||
rateFeatureModel.sendFeedbackForFeature($scope.title, $scope.like, message);
|
||||
$scope.ratingDone = true;
|
||||
// alert($filter('translate')('Feedback_ThankYou'));
|
||||
};
|
||||
});
|
||||
22
www/analytics/plugins/Feedback/angularjs/ratefeature/ratefeature-directive.js
vendored
Normal file
22
www/analytics/plugins/Feedback/angularjs/ratefeature/ratefeature-directive.js
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
/*!
|
||||
* Piwik - Web Analytics
|
||||
*
|
||||
* @link http://piwik.org
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
|
||||
*/
|
||||
|
||||
/**
|
||||
* Usage:
|
||||
* <div piwik-rate-feature title="My Feature Name">
|
||||
*/
|
||||
angular.module('piwikApp').directive('piwikRateFeature', function($document, piwik, $filter){
|
||||
|
||||
return {
|
||||
restrict: 'A',
|
||||
scope: {
|
||||
title: '@'
|
||||
},
|
||||
templateUrl: 'plugins/Feedback/angularjs/ratefeature/ratefeature.html?cb=' + piwik.cacheBuster,
|
||||
controller: 'RateFeatureController'
|
||||
};
|
||||
});
|
||||
22
www/analytics/plugins/Feedback/angularjs/ratefeature/ratefeature-model.js
vendored
Normal file
22
www/analytics/plugins/Feedback/angularjs/ratefeature/ratefeature-model.js
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
/*!
|
||||
* Piwik - Web Analytics
|
||||
*
|
||||
* @link http://piwik.org
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
|
||||
*/
|
||||
|
||||
angular.module('piwikApp').factory('rateFeatureModel', function (piwikApi) {
|
||||
|
||||
var model = {};
|
||||
|
||||
model.sendFeedbackForFeature = function (featureName, like, message) {
|
||||
return piwikApi.fetch({
|
||||
method: 'Feedback.sendFeedbackForFeature',
|
||||
featureName: featureName,
|
||||
like: like ? '1' : '0',
|
||||
message: message + ''
|
||||
});
|
||||
};
|
||||
|
||||
return model;
|
||||
});
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
<div title="{{ 'Feedback_RateFeatureTitle'|translate:title }}" class="ratefeature">
|
||||
|
||||
<div class="iconContainer"
|
||||
ng-mouseenter="view.expanded=true;"
|
||||
ng-mouseleave="view.expanded=false">
|
||||
|
||||
<img ng-click="likeFeature();view.showFeedbackForm=true;"
|
||||
class="like-icon"
|
||||
src="plugins/Feedback/angularjs/ratefeature/thumbs-up.png"/>
|
||||
|
||||
<img ng-click="dislikeFeature();view.showFeedbackForm=true;"
|
||||
class="dislike-icon"
|
||||
ng-show="view.expanded"
|
||||
src="plugins/Feedback/angularjs/ratefeature/thumbs-down.png"/>
|
||||
</div>
|
||||
|
||||
<div class="ui-confirm ratefeatureDialog" piwik-dialog="view.showFeedbackForm" yes="sendFeedback(view.feedbackMessage)">
|
||||
<h2>{{ 'Feedback_RateFeatureThankYouTitle'|translate:title }}</h2>
|
||||
<p ng-if="like">{{ 'Feedback_RateFeatureLeaveMessageLike'|translate }}</p>
|
||||
<p ng-if="!like">{{ 'Feedback_RateFeatureLeaveMessageDislike'|translate }}</p>
|
||||
<br />
|
||||
|
||||
<div class="messageContainer">
|
||||
<textarea ng-model="view.feedbackMessage"></textarea>
|
||||
</div>
|
||||
|
||||
<input type="button"
|
||||
title="{{ 'Feedback_RateFeatureSendFeedbackInformation'|translate }}"
|
||||
value="{{ 'Feedback_SendFeedback'|translate }}" role="yes"/>
|
||||
</div>
|
||||
|
||||
<div class="ui-confirm ratefeatureDialog" piwik-dialog="ratingDone" yes="">
|
||||
<h2>{{ 'Feedback_ThankYou'|translate:title }}</h2>
|
||||
|
||||
<input type="button" value="{{ 'General_Ok'|translate }}" role="yes"/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
.ratefeatureDialog {
|
||||
text-align: center;
|
||||
|
||||
textarea {
|
||||
margin-top: 5px;
|
||||
width: 100%;
|
||||
height: 80px;
|
||||
}
|
||||
}
|
||||
|
||||
.ratefeature {
|
||||
|
||||
font-size: 1px;
|
||||
|
||||
.iconContainer {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.dislike-icon,
|
||||
.like-icon {
|
||||
opacity: 0.2;
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
opacity: 0.9;
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.1 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.2 KiB |
Loading…
Add table
Add a link
Reference in a new issue