-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
62 changed files
with
4,037 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[main] | ||
host = https://www.transifex.com | ||
|
||
[wp-testing.wp-testing] | ||
file_filter = languages/wp-testing-<lang>.po | ||
source_file = languages/wp-testing.pot | ||
source_lang = en | ||
type = PO | ||
minimum_perc = 80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
SELECT | ||
SUM(IF(score_value > 0, 0, score_value)) AS total_negative, | ||
SUM(IF(score_value > 0, score_value, 0)) AS total_positive | ||
FROM | ||
wp_t_scores | ||
WHERE | ||
question_id IN (84 , 85, 0) | ||
AND scale_id = 15 | ||
GROUP BY scale_id | ||
HAVING total_positive > total_negative; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
jQuery(document).ready(function($) { | ||
var box = $('#wpt_quick_fill_questions'), | ||
toggle = box.find('.toggle'), | ||
panel = box.find('.wp-hidden-child'), | ||
ok = box.find('.button'), | ||
text = box.find('textarea'), | ||
table = $('#wpt_add_questions table.wpt_questions'); | ||
|
||
toggle.click(function() { | ||
panel.toggle(); | ||
return false; | ||
}); | ||
|
||
ok.click(function() { | ||
var source = text.val(), | ||
questions = parseQuestions(source); | ||
|
||
fillQuestions(questions); | ||
|
||
text.val(''); | ||
panel.toggle(); | ||
}); | ||
|
||
function parseQuestions(source) { | ||
var result = []; | ||
|
||
source = $.trim(source); | ||
if (source == '') { | ||
return result; | ||
} | ||
|
||
result = source.split(/[\r\n]+/); | ||
|
||
jQuery.each(result, function(i, row) { | ||
result[i] = $.trim(row.replace(/^\w{1,3}[^\w\s]\s+/, '')); | ||
}); | ||
|
||
return result; | ||
}; | ||
|
||
function fillQuestions(newQuestions) { | ||
if (newQuestions.length == 0) { | ||
return; | ||
} | ||
|
||
// Merge existing questions with new | ||
var questions = []; | ||
table.find('input:text').each(function() { | ||
if ($(this).val() != '') { | ||
questions.push($(this).val()); | ||
} | ||
}); | ||
$(newQuestions).each(function(i, newQuestion) { | ||
questions.push(newQuestion); | ||
}); | ||
|
||
// Redraw table | ||
var startFrom = table.data('startFrom'), | ||
firstRow = table.find('tr:first').removeClass('bar').remove(); | ||
|
||
table.find('tr').remove(); | ||
|
||
$(questions).each(function(i, question) { | ||
var inputNameKey = 'wpt_question_title[' + JSON.stringify({"i": startFrom + i, "id": ''}) + ']'; | ||
firstRow | ||
.clone() | ||
.addClass(i % 2 ? 'alternate' : 'bar') | ||
.appendTo(table) | ||
.find('input') | ||
.val(question) | ||
.attr('name', inputNameKey) | ||
.attr('id', 'wpt_question_title_' + (startFrom + i)); | ||
}); | ||
|
||
}; | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
jQuery(document).ready(function($) { | ||
var box = $('#wpt_quick_fill_scores'), | ||
sourceRows = box.find('table tr.quick-score'), | ||
targetTable = $('#wpt_edit_questions table.wpt_questions'), | ||
toggle = box.find('.toggle'), | ||
panel = box.find('.wp-hidden-child'), | ||
ok = box.find('.button'); | ||
|
||
toggle.click(function() { | ||
fillUpSourceTableFromTarget(); | ||
panel.toggle(); | ||
return false; | ||
}); | ||
|
||
ok.click(function() { | ||
sourceRows.each(function() { | ||
var quickClass = $(this).data('quickScoreClass'), | ||
score = $(this).find('.score input').val(), | ||
questions = $(this).find('.questions input').val().split(/[^\d]+/), | ||
target = targetTable.find('.' + quickClass); | ||
|
||
target.val(''); | ||
$(questions).each(function(i, questionNumber) { | ||
if ('' == questionNumber) { | ||
return; | ||
} | ||
target.filter('.question-' + questionNumber).val(score); | ||
}); | ||
}); | ||
|
||
panel.toggle(); | ||
}); | ||
|
||
function fillUpSourceTableFromTarget() { | ||
sourceRows.each(function() { | ||
var quickClass = $(this).data('quickScoreClass'), | ||
target = targetTable.find('.' + quickClass), | ||
questions = []; | ||
scores = []; | ||
|
||
target.each(function() { | ||
var value = $(this).val(); | ||
if ('' == value) { | ||
return; | ||
} | ||
scores.push(value); | ||
questions.push($(this).data('questionNumber')); | ||
}); | ||
$(this).find('.questions input').val(questions.join(', ')); | ||
|
||
scores = _.uniq(scores); | ||
var score = 1; | ||
if (scores.length == 1) { | ||
score = scores[0]; | ||
} else if (scores.length > 1) { | ||
score = ''; | ||
} | ||
$(this).find('.score input').val(score); | ||
}); | ||
}; | ||
}); |
Oops, something went wrong.