Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatt <matt@59fd770c-687e-43c8-a1e3-f5a4ff64c105>2008-12-26 16:50:57 +0300
committermatt <matt@59fd770c-687e-43c8-a1e3-f5a4ff64c105>2008-12-26 16:50:57 +0300
commit446fd843abd0640403c30a763493a8fb1d821160 (patch)
tree65ebec570ef05ae3f3d84e14a3e4cd7ab6b128ea /plugins/Goals/templates/GoalForm.js
parent35d668736cc7596e9f48ac050ce685a45296cbb6 (diff)
- cacheFile is now creating the directory if not already created
- adding log_conversion table, and goal table in 0.2.27 - adding case sensitive/case insensitive matching - when goal plugin is disabled, conversions are not being recorded - adding release notes in the Goal tab to let users know that this is alpha release
Diffstat (limited to 'plugins/Goals/templates/GoalForm.js')
-rw-r--r--plugins/Goals/templates/GoalForm.js41
1 files changed, 38 insertions, 3 deletions
diff --git a/plugins/Goals/templates/GoalForm.js b/plugins/Goals/templates/GoalForm.js
index 27e250c5ca..4345bc8958 100644
--- a/plugins/Goals/templates/GoalForm.js
+++ b/plugins/Goals/templates/GoalForm.js
@@ -3,7 +3,7 @@ function showAddNewGoal()
{
$("#GoalForm").show();
$("#EditGoals").hide();
- lazyScrollTo("#bottom", 100);
+ $.scrollTo("#AddEditGoals", 400);
return false;
}
@@ -11,12 +11,12 @@ function showEditGoals()
{
$("#EditGoals").show();
$("#GoalForm").hide();
- lazyScrollTo("#bottom", 100);
+ $.scrollTo("#AddEditGoals", 400);
return false;
}
// init the goal form with existing goal value, if any
-function initGoalForm(goalMethodAPI, submitText, goalName, matchAttribute, pattern, patternType, revenue, goalId)
+function initGoalForm(goalMethodAPI, submitText, goalName, matchAttribute, pattern, patternType, caseSensitive, revenue, goalId)
{
$('#goal_name').val(goalName);
$('input[@name=match_attribute][value='+matchAttribute+']').attr('checked', true);
@@ -24,6 +24,7 @@ function initGoalForm(goalMethodAPI, submitText, goalName, matchAttribute, patte
$('#examples_pattern').html(mappingMatchTypeExamples[matchAttribute]);
$('option[value='+patternType+']').attr('selected', true);
$('input[name=pattern]').val(pattern);
+ $('#case_sensitive').attr('checked', caseSensitive);
$('input[name=revenue]').val(revenue);
$('input[name=methodGoalAPI]').val(goalMethodAPI);
$('#goal_submit').val(submitText);
@@ -32,6 +33,11 @@ function initGoalForm(goalMethodAPI, submitText, goalName, matchAttribute, patte
}
}
+function initAndShowAddGoalForm()
+{
+ initGoalForm('Goals.addGoal', 'Add Goal', '', 'url', '', 'contains', false, '0');
+ return showAddNewGoal();
+}
function bindGoalForm()
{
$('input[@name=match_attribute]').click( function() {
@@ -46,8 +52,36 @@ function bindGoalForm()
$.ajax( ajaxRequestAddGoal );
return false;
});
+
+ $('a[name=linkAddNewGoal]').click( function(){
+ initAndShowAddGoalForm();
+ } );
}
+function bindListGoalEdit()
+{
+ $('a[name=linkEditGoal]').click( function() {
+ var goalId = $(this).attr('id');
+ var goal = piwik.goals[goalId];
+ initGoalForm("Goals.updateGoal", "Update Goal", goal.name, goal.match_attribute, goal.pattern, goal.pattern_type, (goal.case_sensitive=='0' ? false : true), goal.revenue, goalId);
+ showAddNewGoal();
+ return false;
+ });
+
+ $('a[name=linkDeleteGoal]').click( function() {
+ var goalId = $(this).attr('id');
+ var goalName = 'test goal';//piwik.goals[goalId][name]
+ if(confirm(sprintf('Are you sure you want to delete the Goal %s?','"'+goalName+'"')))
+ {
+ $.ajax( getAjaxDeleteGoal( goalId ) );
+ return false;
+ }
+ });
+
+ $('a[name=linkEditGoals]').click( function(){
+ return showEditGoals();
+ } );
+}
function getAjaxDeleteGoal(idGoal)
{
var ajaxRequest = getStandardAjaxConf();
@@ -76,6 +110,7 @@ function getAjaxAddGoal()
parameters.matchAttribute = $('input[name=match_attribute][checked]').val();
parameters.patternType = $('[name=pattern_type]').val();
parameters.pattern = encodeURIComponent( $('input[name=pattern]').val() );
+ parameters.caseSensitive = $('#case_sensitive').attr('checked') == true ? 1: 0;
parameters.revenue = $('input[name=revenue]').val();
parameters.idGoal = $('input[name=goalIdUpdate]').val();