mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-25 04:24:45 -04:00
Clean code.
This commit is contained in:
parent
1a47a2aa3b
commit
d5a0dce27a
6 changed files with 12 additions and 12 deletions
|
@ -20,7 +20,7 @@ modulejs.define('boot', ['$'], function ($) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: url,
|
url: url,
|
||||||
data: data,
|
data: data,
|
||||||
type: 'POST',
|
type: 'post',
|
||||||
dataType: 'json'
|
dataType: 'json'
|
||||||
}).done(function (config) {
|
}).done(function (config) {
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ modulejs.define('core/server', ['_', '$', 'config', 'core/location'], function (
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: location.getAbsHref(),
|
url: location.getAbsHref(),
|
||||||
data: data,
|
data: data,
|
||||||
type: 'POST',
|
type: 'post',
|
||||||
dataType: 'json'
|
dataType: 'json'
|
||||||
})
|
})
|
||||||
.done(function (json) {
|
.done(function (json) {
|
||||||
|
|
|
@ -110,8 +110,8 @@ modulejs.define('main/info', ['$', 'config'], function ($, config) {
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: 'server/php/index.php',
|
url: 'server/php/index.php',
|
||||||
type: 'POST',
|
type: 'post',
|
||||||
dataType: 'JSON',
|
dataType: 'json',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
.always(function () {
|
.always(function () {
|
||||||
|
|
|
@ -112,7 +112,7 @@ describe('module \'' + ID + '\'', function () {
|
||||||
|
|
||||||
assert.isTrue(this.xAjax.calledOnce);
|
assert.isTrue(this.xAjax.calledOnce);
|
||||||
assert.strictEqual(this.xAjax.lastCall.args[0].url, 'server/php/index.php');
|
assert.strictEqual(this.xAjax.lastCall.args[0].url, 'server/php/index.php');
|
||||||
assert.strictEqual(this.xAjax.lastCall.args[0].type, 'POST');
|
assert.strictEqual(this.xAjax.lastCall.args[0].type, 'post');
|
||||||
assert.strictEqual(this.xAjax.lastCall.args[0].dataType, 'json');
|
assert.strictEqual(this.xAjax.lastCall.args[0].dataType, 'json');
|
||||||
|
|
||||||
assert.isTrue(this.xAjaxResult.done.calledOnce);
|
assert.isTrue(this.xAjaxResult.done.calledOnce);
|
||||||
|
@ -134,7 +134,7 @@ describe('module \'' + ID + '\'', function () {
|
||||||
|
|
||||||
assert.isTrue(this.xAjax.calledOnce);
|
assert.isTrue(this.xAjax.calledOnce);
|
||||||
assert.strictEqual(this.xAjax.lastCall.args[0].url, '.');
|
assert.strictEqual(this.xAjax.lastCall.args[0].url, '.');
|
||||||
assert.strictEqual(this.xAjax.lastCall.args[0].type, 'POST');
|
assert.strictEqual(this.xAjax.lastCall.args[0].type, 'post');
|
||||||
assert.strictEqual(this.xAjax.lastCall.args[0].dataType, 'json');
|
assert.strictEqual(this.xAjax.lastCall.args[0].dataType, 'json');
|
||||||
|
|
||||||
assert.isTrue(this.xAjaxResult.done.calledOnce);
|
assert.isTrue(this.xAjaxResult.done.calledOnce);
|
||||||
|
|
|
@ -200,7 +200,7 @@ describe('module \'' + ID + '\'', function () {
|
||||||
assert.deepEqual(this.xAjax.lastCall.args, [{
|
assert.deepEqual(this.xAjax.lastCall.args, [{
|
||||||
url: this.xAbsHref,
|
url: this.xAbsHref,
|
||||||
data: xData,
|
data: xData,
|
||||||
type: 'POST',
|
type: 'post',
|
||||||
dataType: 'json'
|
dataType: 'json'
|
||||||
}]);
|
}]);
|
||||||
assert.isTrue(this.xAjaxResult.done.calledOnce);
|
assert.isTrue(this.xAjaxResult.done.calledOnce);
|
||||||
|
@ -229,7 +229,7 @@ describe('module \'' + ID + '\'', function () {
|
||||||
assert.deepEqual(this.xAjax.lastCall.args, [{
|
assert.deepEqual(this.xAjax.lastCall.args, [{
|
||||||
url: this.xAbsHref,
|
url: this.xAbsHref,
|
||||||
data: xData,
|
data: xData,
|
||||||
type: 'POST',
|
type: 'post',
|
||||||
dataType: 'json'
|
dataType: 'json'
|
||||||
}]);
|
}]);
|
||||||
assert.isTrue(this.xAjaxResult.done.calledOnce);
|
assert.isTrue(this.xAjaxResult.done.calledOnce);
|
||||||
|
|
|
@ -139,8 +139,8 @@ describe('module \'' + ID + '\'', function () {
|
||||||
assert.isTrue(this.xAjax.calledOnce);
|
assert.isTrue(this.xAjax.calledOnce);
|
||||||
assert.deepEqual(this.xAjax.lastCall.args, [{
|
assert.deepEqual(this.xAjax.lastCall.args, [{
|
||||||
url: 'server/php/index.php',
|
url: 'server/php/index.php',
|
||||||
type: 'POST',
|
type: 'post',
|
||||||
dataType: 'JSON',
|
dataType: 'json',
|
||||||
data: {
|
data: {
|
||||||
action: 'login',
|
action: 'login',
|
||||||
pass: pass
|
pass: pass
|
||||||
|
@ -194,8 +194,8 @@ describe('module \'' + ID + '\'', function () {
|
||||||
assert.isTrue(this.xAjax.calledOnce);
|
assert.isTrue(this.xAjax.calledOnce);
|
||||||
assert.deepEqual(this.xAjax.lastCall.args, [{
|
assert.deepEqual(this.xAjax.lastCall.args, [{
|
||||||
url: 'server/php/index.php',
|
url: 'server/php/index.php',
|
||||||
type: 'POST',
|
type: 'post',
|
||||||
dataType: 'JSON',
|
dataType: 'json',
|
||||||
data: {
|
data: {
|
||||||
action: 'logout'
|
action: 'logout'
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue