Skip to content

Commit 31ec2c7

Browse files
committed
Add Ajax.js
1 parent 9039f30 commit 31ec2c7

File tree

4 files changed

+93
-0
lines changed

4 files changed

+93
-0
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
be.bastelstu.promiseWrap.tar
2+
files_wcf.tar

Makefile

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
WCF_FILES = $(shell find files_wcf -type f)
2+
3+
all: be.bastelstu.promiseWrap.tar
4+
5+
be.bastelstu.promiseWrap.tar: files_wcf.tar *.xml
6+
tar cvf be.bastelstu.promiseWrap.tar --numeric-owner --exclude-vcs -- files_wcf.tar *.xml
7+
8+
files_wcf.tar: $(WCF_FILES)
9+
tar cvf files_wcf.tar --numeric-owner --exclude-vcs --transform='s,files_wcf/,,' -- $(WCF_FILES)
10+
11+
clean:
12+
-rm -f files_wcf.tar
13+
14+
distclean: clean
15+
-rm -f be.bastelstu.promiseWrap.tar
16+
17+
.PHONY: distclean clean
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
* Copyright (c) 2016 Tim Düsterhus
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy
5+
* of this software and associated documentation files (the "Software"), to deal
6+
* in the Software without restriction, including without limitation the rights
7+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
* copies of the Software, and to permit persons to whom the Software is
9+
* furnished to do so, subject to the following conditions:
10+
*
11+
* The above copyright notice and this permission notice shall be included in all
12+
* copies or substantial portions of the Software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20+
* SOFTWARE.
21+
*/
22+
23+
define([ 'Bastelstu.be/core'
24+
, 'WoltLabSuite/Core/Ajax'
25+
], function (core, _Ajax) {
26+
"use strict";
27+
28+
class Ajax {
29+
static api(callbackObject, data) {
30+
return new core.Promise(function (resolve, reject) {
31+
_Ajax.api(callbackObject, data, resolve, reject)
32+
})
33+
}
34+
35+
static apiOnce(options) {
36+
return new core.Promise(function (resolve, reject) {
37+
options.success = resolve
38+
options.failure = reject
39+
40+
_Ajax.apiOnce(options)
41+
})
42+
}
43+
}
44+
45+
return Ajax
46+
});

package.xml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<package name="be.bastelstu.promiseWrap" xmlns="http://www.woltlab.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.woltlab.com http://www.woltlab.com/XSD/maelstrom/package.xsd">
3+
<packageinformation>
4+
<packagename>Promise Wrap</packagename>
5+
<isapplication>0</isapplication>
6+
<version>1.0.0 Alpha 1</version>
7+
<date>2016-10-14</date>
8+
<license><![CDATA[MIT License <https://opensource.org/licenses/MIT>]]></license>
9+
</packageinformation>
10+
11+
<authorinformation>
12+
<author>Tim Düsterhus</author>
13+
<authorurl>http://tims.bastelstu.be</authorurl>
14+
</authorinformation>
15+
16+
<requiredpackages>
17+
<requiredpackage minversion="3.0.0 Alpha 1">com.woltlab.wcf</requiredpackage>
18+
<requiredpackage minversion="2.4.1">be.bastelstu.core-js</requiredpackage>
19+
</requiredpackages>
20+
21+
<excludedpackages>
22+
<excludedpackage version="3.1.0 Alpha 1">com.woltlab.wcf</excludedpackage>
23+
</excludedpackages>
24+
25+
<instructions type="install">
26+
<instruction type="file" application="wcf">files_wcf.tar</instruction>
27+
</instructions>
28+
</package>

0 commit comments

Comments
 (0)