RE: Redcase Plugin » patch_scripts_js.diff
| redmine/vendor/plugins/redcase/assets/javascripts/scripts.js 2012-01-07 20:10:08.000000000 +0000 | ||
|---|---|---|
|
Ext.dd.StatusProxy.prototype.animRepair = false;
|
||
|
Ext.QuickTips.init();
|
||
|
Ext.chart.Chart.CHART_URL = '/plugin_assets/redcase/javascripts/ext-3.1.1/resources/charts.swf';
|
||
|
|
||
|
Ext.override(Ext.tree.TreeNodeUI,
|
||
|
{
|
||
|
renderElements: function(n, a, targetNode, bulkRender)
|
||
| ... | ... | |
|
|
||
|
function request(method, params, success, failureMsg)
|
||
|
{
|
||
|
params.format = 'json';
|
||
|
conn = new Ext.data.Connection();
|
||
|
params.format = 'json';
|
||
|
conn = new Ext.data.Connection();
|
||
|
var csrf = Ext.select("meta[name='csrf-token']").first();
|
||
|
Ext.Ajax.defaultHeaders = Ext.apply(Ext.Ajax.defaultHeaders || {}, {'X-CSRF-Token': csrf.getAttribute('content')});
|
||
|
conn.defaultHeaders = Ext.apply(conn.defaultHeaders || {}, {'X-CSRF-Token': csrf.getAttribute('content')});
|
||
|
conn.request(
|
||
|
{
|
||
|
url : context + method,
|
||
| ... | ... | |
|
* Moving test case inside 'Test cases' tree.
|
||
|
*/
|
||
|
function onMove(dropEvent)
|
||
|
{
|
||
|
{
|
||
|
var csrf = Ext.select("meta[name='csrf-token']").first();
|
||
|
Ext.Ajax.defaultHeaders = Ext.apply(Ext.Ajax.defaultHeaders || {}, {'X-CSRF-Token': csrf.getAttribute('content')});
|
||
|
if(dropEvent.dropNode.isLeaf())
|
||
|
{
|
||
|
request(
|
||
| ... | ... | |
|
function onxMove(dropEvent)
|
||
|
{
|
||
|
conn = new Ext.data.Connection();
|
||
|
|
||
|
|
||
|
var csrf = Ext.select("meta[name='csrf-token']").first();
|
||
|
Ext.Ajax.defaultHeaders = Ext.apply(Ext.Ajax.defaultHeaders || {}, {'X-CSRF-Token': csrf.getAttribute('content')});
|
||
|
conn.defaultHeaders = Ext.apply(conn.defaultHeaders || {}, {'X-CSRF-Token': csrf.getAttribute('content')});
|
||
|
if(dropEvent.dropNode.isLeaf())
|
||
|
{
|
||
|
if(dropEvent.target.getOwnerTree() != dropEvent.dropNode.getOwnerTree())
|
||
| ... | ... | |
|
{
|
||
|
if (btn == 'ok')
|
||
|
{
|
||
|
conn = new Ext.data.Connection();
|
||
|
conn = new Ext.data.Connection();
|
||
|
|
||
|
var csrf = Ext.select("meta[name='csrf-token']").first();
|
||
|
Ext.Ajax.defaultHeaders = Ext.apply(Ext.Ajax.defaultHeaders || {}, {'X-CSRF-Token': csrf.getAttribute('content')});
|
||
|
conn.defaultHeaders = Ext.apply(conn.defaultHeaders || {}, {'X-CSRF-Token': csrf.getAttribute('content')});
|
||
|
conn.request(
|
||
|
{
|
||
|
url : 'redcase/test_suite_manager',
|
||
| ... | ... | |
|
|
||
|
parentNode = currentNode.parentNode;
|
||
|
conn = new Ext.data.Connection();
|
||
|
|
||
|
var csrf = Ext.select("meta[name='csrf-token']").first();
|
||
|
Ext.Ajax.defaultHeaders = Ext.apply(Ext.Ajax.defaultHeaders || {}, {'X-CSRF-Token': csrf.getAttribute('content')});
|
||
|
conn.defaultHeaders = Ext.apply(conn.defaultHeaders || {}, {'X-CSRF-Token': csrf.getAttribute('content')});
|
||
|
if(currentNode.isLeaf())
|
||
|
{
|
||
|
conn.request(
|
||
| ... | ... | |
|
|
||
|
parentNode = currentNode.parentNode;
|
||
|
conn = new Ext.data.Connection();
|
||
|
|
||
|
var csrf = Ext.select("meta[name='csrf-token']").first();
|
||
|
Ext.Ajax.defaultHeaders = Ext.apply(Ext.Ajax.defaultHeaders || {}, {'X-CSRF-Token': csrf.getAttribute('content')});
|
||
|
conn.defaultHeaders = Ext.apply(conn.defaultHeaders || {}, {'X-CSRF-Token': csrf.getAttribute('content')});
|
||
|
conn.request(
|
||
|
{
|
||
|
url : 'redcase/reassign_test_case',
|
||
| ... | ... | |
|
{
|
||
|
if (btn == 'ok')
|
||
|
{
|
||
|
conn = new Ext.data.Connection();
|
||
|
conn = new Ext.data.Connection();
|
||
|
var csrf = Ext.select("meta[name='csrf-token']").first();
|
||
|
Ext.Ajax.defaultHeaders = Ext.apply(Ext.Ajax.defaultHeaders || {}, {'X-CSRF-Token': csrf.getAttribute('content')});
|
||
|
conn.defaultHeaders = Ext.apply(conn.defaultHeaders || {}, {'X-CSRF-Token': csrf.getAttribute('content')});
|
||
|
conn.request(
|
||
|
{
|
||
|
url : 'redcase/execution_suite_manager',
|
||
| ... | ... | |
|
return;
|
||
|
}
|
||
|
parentNode = currentNode.parentNode;
|
||
|
conn = new Ext.data.Connection();
|
||
|
conn = new Ext.data.Connection();
|
||
|
var csrf = Ext.select("meta[name='csrf-token']").first();
|
||
|
Ext.Ajax.defaultHeaders = Ext.apply(Ext.Ajax.defaultHeaders || {}, {'X-CSRF-Token': csrf.getAttribute('content')});
|
||
|
conn.defaultHeaders = Ext.apply(conn.defaultHeaders || {}, {'X-CSRF-Token': csrf.getAttribute('content')});
|
||
|
conn.disableCaching = false;
|
||
|
if (currentNode.isLeaf())
|
||
|
{
|
||
| ... | ... | |
|
|
||
|
parentNode = xcurrentNode.parentNode;
|
||
|
conn = new Ext.data.Connection();
|
||
|
|
||
|
var csrf = Ext.select("meta[name='csrf-token']").first();
|
||
|
Ext.Ajax.defaultHeaders = Ext.apply(Ext.Ajax.defaultHeaders || {}, {'X-CSRF-Token': csrf.getAttribute('content')});
|
||
|
conn.defaultHeaders = Ext.apply(conn.defaultHeaders || {}, {'X-CSRF-Token': csrf.getAttribute('content')});
|
||
|
if (xcurrentNode.isLeaf())
|
||
|
{
|
||
|
conn.request(
|
||
| ... | ... | |
|
|
||
|
editorSuite.on('beforecomplete', function(editor, newValue, originalValue) {
|
||
|
|
||
|
conn = new Ext.data.Connection();
|
||
|
conn = new Ext.data.Connection();
|
||
|
var csrf = Ext.select("meta[name='csrf-token']").first();
|
||
|
Ext.Ajax.defaultHeaders = Ext.apply(Ext.Ajax.defaultHeaders || {}, {'X-CSRF-Token': csrf.getAttribute('content')});
|
||
|
conn.defaultHeaders = Ext.apply(conn.defaultHeaders || {}, {'X-CSRF-Token': csrf.getAttribute('content')});
|
||
|
|
||
|
conn.request({
|
||
|
url: 'redcase/test_suite_manager',
|
||
| ... | ... | |
|
editorExec.on('beforecomplete', function(editor, newValue, originalValue) {
|
||
|
|
||
|
conn = new Ext.data.Connection();
|
||
|
|
||
|
var csrf = Ext.select("meta[name='csrf-token']").first();
|
||
|
Ext.Ajax.defaultHeaders = Ext.apply(Ext.Ajax.defaultHeaders || {}, {'X-CSRF-Token': csrf.getAttribute('content')});
|
||
|
conn.defaultHeaders = Ext.apply(conn.defaultHeaders || {}, {'X-CSRF-Token': csrf.getAttribute('content')});
|
||
|
conn.request({
|
||
|
url: 'redcase/execution_suite_manager',
|
||
|
method: 'GET',
|
||
| ... | ... | |
|
return findNext(next);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
function execute() {
|
||
|
function execute() {
|
||
|
node = exec2Tree.getSelectionModel().getSelectedNode();
|
||
|
result = Ext.get('results');
|
||
|
envs = Ext.get('environments');
|
||
|
version = Ext.get('version');
|
||
|
comment = Ext.get('exec-comment');
|
||
|
conn = new Ext.data.Connection();
|
||
|
conn = new Ext.data.Connection();
|
||
|
var csrf = Ext.select("meta[name='csrf-token']").first();
|
||
|
Ext.Ajax.defaultHeaders = Ext.apply(Ext.Ajax.defaultHeaders || {}, {'X-CSRF-Token': csrf.getAttribute('content')});
|
||
|
conn.defaultHeaders = Ext.apply(conn.defaultHeaders || {}, {'X-CSRF-Token': csrf.getAttribute('content')});
|
||
|
Element.show('ajax-indicator');
|
||
|
conn.request({
|
||
|
url: 'redcase/execute',
|
||
| ... | ... | |
|
"version": version.getValue(false),
|
||
|
"result": result.getValue(false),
|
||
|
"envs": envs.getValue(false),
|
||
|
"comment": comment.getValue(false),
|
||
|
"comment": comment.getValue(false),
|
||
|
"format": "json"
|
||
|
},
|
||
|
success: function(responseObject) {
|
||
| ... | ... | |
|
r = Ext.get('all-results-d');
|
||
|
r.setDisplayed('none');
|
||
|
if (node.isLeaf()) {
|
||
|
conn = new Ext.data.Connection();
|
||
|
conn = new Ext.data.Connection();
|
||
|
var csrf = Ext.select("meta[name='csrf-token']").first();
|
||
|
Ext.Ajax.defaultHeaders = Ext.apply(Ext.Ajax.defaultHeaders || {}, {'X-CSRF-Token': csrf.getAttribute('content')});
|
||
|
Element.show('ajax-indicator');
|
||
|
conn.request({
|
||
|
waitMsg: 'loading test case info',
|
||
| ... | ... | |
|
|
||
|
function getHistory(rs)
|
||
|
{
|
||
|
unique = {}
|
||
|
txt = "<table class='redcase-row' width='100%'>"
|
||
|
txt += "<tr style='font-weight: bold; background-color: #eeeeee'><td>Date</td><td>Result</td><td>Comments</td><td>Executor</td><td>Environment</td><td>Version</td></tr>"
|
||
|
unique = {}
|
||
|
txt = "<table class='redcase-row' width='100%'>"
|
||
|
txt += "<tr style='font-weight: bold; background-color: #eeeeee'><td>date</td><td>result</td><td>comments</td><td>executor</td><td>environment</td><td>version</td></tr>";
|
||
|
for(i = 0; i < rs.length; i++) {
|
||
|
switch (rs[i].result)
|
||
|
{
|
||
| ... | ... | |
|
function update_exe_tree()
|
||
|
{
|
||
|
choosen = Ext.get('list_id').getValue(false);
|
||
|
conn = new Ext.data.Connection();
|
||
|
conn = new Ext.data.Connection();
|
||
|
var csrf = Ext.select("meta[name='csrf-token']").first();
|
||
|
Ext.Ajax.defaultHeaders = Ext.apply(Ext.Ajax.defaultHeaders || {}, {'X-CSRF-Token': csrf.getAttribute('content')});
|
||
|
nameEl = Ext.get('list_name');
|
||
|
|
||
|
Element.show('ajax-indicator');
|
||
|
|
||
|
conn.request(
|
||
|
{
|
||
|
url : 'redcase/index',
|
||
| ... | ... | |
|
{
|
||
|
choosen = Ext.get('list2_id').getValue(false);
|
||
|
conn = new Ext.data.Connection();
|
||
|
|
||
|
var csrf = Ext.select("meta[name='csrf-token']").first();
|
||
|
Ext.Ajax.defaultHeaders = Ext.apply(Ext.Ajax.defaultHeaders || {}, {'X-CSRF-Token': csrf.getAttribute('content')});
|
||
|
Element.show('ajax-indicator');
|
||
|
|
||
|
conn.request(
|
||