Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove $ from Uploadcare Widget #629

Draft
wants to merge 98 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
48bc965
Add .editorconfig
bautrukevich Dec 20, 2019
4de5e98
Remove $ from progress.js
bautrukevich Dec 20, 2019
d7a442a
Merge pull request #627 from uploadcare/feat/add-editorconfig
bautrukevich Dec 20, 2019
1f500cb
Add window
bautrukevich Dec 20, 2019
df81721
Remove $ from files.js
bautrukevich Dec 24, 2019
f3d3ef3
Add isFunction to utils.js
bautrukevich Dec 24, 2019
fe5a639
Remove $ from locale.js
bautrukevich Dec 24, 2019
be059ed
Remove $ from stylesheets.js
bautrukevich Dec 24, 2019
f925f9d
Remove $ from settings.js
bautrukevich Dec 24, 2019
8ad7295
Add replacement for $.Callbacks
bautrukevich Dec 24, 2019
a0dbe02
Remove $.Callbacks from settings.js
bautrukevich Dec 24, 2019
b4225f1
Remove ar locale from utils (autocomplete error)
bautrukevich Dec 24, 2019
22b25a6
Remove $ from utils/pusher.js
bautrukevich Dec 24, 2019
480468a
Add extend function to utils.js
bautrukevich Dec 24, 2019
65af19d
Replace Object.assign with deep extend function
bautrukevich Dec 24, 2019
39ef623
Replace Object.assign with deep extend function
bautrukevich Dec 24, 2019
959277c
Add isPlainObject
bautrukevich Dec 24, 2019
ab3947e
Merge pull request #630 from uploadcare/fix/remove-jquery-from-src
bautrukevich Dec 24, 2019
dc23b15
Merge branch 'development' into fix/remove-jquery-from-utils-folder
bautrukevich Dec 24, 2019
5730580
Merge branch 'development' into fix/remove-jquery-from-ui
bautrukevich Dec 25, 2019
8bd75ff
Remove $ from messages.js
bautrukevich Dec 25, 2019
32608d5
Remove $ from image-loader.js
bautrukevich Dec 25, 2019
4308191
Update progress.js and change template.js param for progress
bautrukevich Dec 25, 2019
e490a2a
Merge pull request #628 from uploadcare/fix/remove-jquery-from-ui
bautrukevich Dec 25, 2019
3ba056d
Merge pull request #633 from uploadcare/fix/remove-jquery-from-utils-…
bautrukevich Dec 27, 2019
8d2e84d
Remove jquery-xdr.js
bautrukevich Dec 27, 2019
251bf85
fix circle usage (#634)
jeetiss Dec 27, 2019
a09a187
Fix base preview-tab.js
bautrukevich Dec 27, 2019
b06f4cc
Remove image processor utils from namespace.api.js
bautrukevich Dec 27, 2019
d189a43
Fix image-loader.js
bautrukevich Dec 27, 2019
4c4afcc
Remove shrink file from object.js
bautrukevich Dec 27, 2019
dceb6ef
Remove image processor utils from preview-tab.js
bautrukevich Dec 27, 2019
a0df853
rewrite widget/live.js (#635)
jeetiss Dec 27, 2019
7d3e239
remove $ from base-widget (#637)
jeetiss Dec 27, 2019
c682a51
off submit-guard (#640)
jeetiss Dec 27, 2019
fa441bb
remove $ from multiple widget (#639)
jeetiss Dec 27, 2019
686b89c
remove $ from template (#638)
jeetiss Dec 27, 2019
5a97f23
Remove $ from dnd (#641)
jeetiss Dec 28, 2019
9364da5
Remove ordering and crop from widget
bautrukevich Dec 30, 2019
77dfa47
remove $ from promise collection (#642)
jeetiss Dec 30, 2019
7b0d090
Merge pull request #636 from uploadcare/fix/remove-vendors
bautrukevich Dec 30, 2019
a4d734c
rewrite listen to promises (#644)
jeetiss Jan 9, 2020
e5c4d00
Remove $ from `dialog.js` (#675)
jeetiss Jan 14, 2020
d33de0c
remove $ from tabs (#677)
jeetiss Jan 16, 2020
60ec2e5
add typescript (#679)
jeetiss Jan 23, 2020
e225615
fix preview tab (#683)
jeetiss Jan 30, 2020
7227189
fix settings (#684)
jeetiss Jan 30, 2020
7628e19
fix preview tab multiple (#685)
jeetiss Jan 30, 2020
ce2a7ef
remove then (#687)
jeetiss Feb 3, 2020
59d1055
Add addData in dialog.js
bautrukevich Jan 29, 2020
f9d84b6
Update utils.js
bautrukevich Jan 30, 2020
a395c4b
Remove $ from groups.js
bautrukevich Jan 30, 2020
ee71710
Remove isArrayLike and each jquery functions
bautrukevich Feb 5, 2020
7ad81e8
Remove $ from bundles
bautrukevich Feb 5, 2020
e38ca2e
Remove $ from image-processor.js
bautrukevich Jan 30, 2020
12402f2
Add UploadClient dependency
bautrukevich Feb 5, 2020
610af72
Resolve modules for browser in rollup config
bautrukevich Feb 5, 2020
232f1e1
Add WidgetFile abstraction
bautrukevich Feb 5, 2020
20bfaaa
Add WidgetFile to SavedFileGroup
bautrukevich Feb 5, 2020
0df8778
Refactor image-loader.ts
bautrukevich Feb 5, 2020
a6a4965
Remove then()
bautrukevich Feb 5, 2020
e1962be
Merge pull request #697 from uploadcare/fix/image-loader.ts
bautrukevich Feb 5, 2020
0a97106
Merge pull request #695 from uploadcare/fix/remove-jquery-from-bundles
bautrukevich Feb 5, 2020
7e69aaf
Update fileInput fn
bautrukevich Feb 5, 2020
871eb90
Move jsonp and fixedPipe to base.js
bautrukevich Feb 5, 2020
06c1935
Rollback shrinkFile function
bautrukevich Feb 5, 2020
4b211dd
Merge pull request #693 from uploadcare/fix/remove-jquery-utils
bautrukevich Feb 5, 2020
61b3b7c
Merge pull request #696 from uploadcare/fix/remove-jquery-image-proce…
bautrukevich Feb 5, 2020
99c671d
Merge branch 'development' into feat/add-data-dialog
bautrukevich Feb 6, 2020
2b3a9fa
Update camera-tab.js
bautrukevich Feb 6, 2020
0f21f50
Update base-preview-tab.js
bautrukevich Feb 6, 2020
24b59a1
Add WidgetFile to base-widget.js
bautrukevich Feb 6, 2020
94ab583
Add build settings to WidgetFile
bautrukevich Feb 6, 2020
9bc59f7
Add WidgetFile to widget.js
bautrukevich Feb 6, 2020
eeb116b
Update dialog.js
bautrukevich Feb 6, 2020
937551e
Fix preview-tab.js
bautrukevich Feb 6, 2020
d0a45c2
Remove deps from uploadcare.api.js
bautrukevich Feb 6, 2020
9ffb3c2
Fix url-tab.js
bautrukevich Feb 6, 2020
e532f10
Fix remote tab
bautrukevich Feb 6, 2020
21de659
Fix camera tab
bautrukevich Feb 6, 2020
1e51ed8
Rename type to source in addData and add source to settings
bautrukevich Feb 6, 2020
5fcc359
Add source to remote tab
bautrukevich Feb 6, 2020
4eabb46
Update source in url tab
bautrukevich Feb 6, 2020
684abaa
Comment dialog api for multiple files
bautrukevich Feb 6, 2020
e92cb7b
Export ajaxDefaults from base.js
bautrukevich Feb 6, 2020
05e6b4f
Merge pull request #694 from uploadcare/feat/add-data-dialog
bautrukevich Feb 10, 2020
9aae5a4
Merge pull request #701 from uploadcare/fix/remote-tab
bautrukevich Feb 10, 2020
529b87f
Remove namespaces (#702)
jeetiss Feb 11, 2020
1ddf9d3
Merge branch 'development' into fix/url-tab
bautrukevich Feb 12, 2020
8144605
Merge branch 'development' into fix/camera-tab
bautrukevich Feb 12, 2020
7a62f2a
Merge pull request #699 from uploadcare/fix/url-tab
bautrukevich Feb 12, 2020
cedaa78
Merge pull request #700 from uploadcare/fix/camera-tab
bautrukevich Feb 14, 2020
272f557
Merge branch 'master' into development
jeetiss Feb 17, 2020
8b1b41b
fix linter problems
jeetiss Feb 17, 2020
9759e76
use version without jquery
jeetiss Feb 18, 2020
257a923
Merge pull request #716 from uploadcare/updata-dev
jeetiss Feb 19, 2020
c5db5c1
Remove $ from deps (#717)
jeetiss Mar 5, 2020
a9bdb58
fix: render preview for uploading image (#705)
bautrukevich Mar 19, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
16 changes: 14 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
{
"extends": ["standard", "prettier"],
"parser": "babel-eslint",
"plugins": ["prettier"]
"parser": "@typescript-eslint/parser",
"plugins": ["prettier", "@typescript-eslint"],

// add hacky support typescript for standard linter
// remove when https://github.com/standard/standard/issues/1283
// will be fixed
"rules": {
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": ["error", { "args": "none" }],
"camelcase": "off",
"@typescript-eslint/camelcase": ["error", { "properties": "never" }],
"semi": "off",
"@typescript-eslint/semi": ["error", "never"]
}
}
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,8 @@ If you're looking for the widget v2 docs, check out [here][uc-docs-widget-v2].

There are a few types of JS bundles:

* `uploadcare.full.js` — a full bundle with built-in jQuery.
* `uploadcare.js` — a bundle without built-in jQuery.
* `uploadcare.api.js` — a bundle without UI of the widget and built-in jQuery
[JavaScript API][uc-docs-widget-js-api] only.
* `uploadcare.lang.en.js` — a bundle without built-in jQuery, `en` locale only.
* `uploadcare.js` — default bundle with widget code.
* `uploadcare.lang.en.js` — a bundle with `en` locale only.

Each bundle has its minified version. Just add `.min` before `.js`,
e.g. `uploadcare.min.js`.
Expand Down
7 changes: 2 additions & 5 deletions dummy/crop.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@
UPLOADCARE_TABS = "default huddle";
UPLOADCARE_DEBUG_UPLOADS = true;
</script>
<script src="./uploadcare.full.js"></script>
<script>
$ = uploadcare.jQuery;
jQuery = uploadcare.jQuery;
</script>
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<script src="./uploadcare.js"></script>

<style>
.long-input {
Expand Down
14 changes: 5 additions & 9 deletions dummy/default.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
<meta charset="UTF-8">
<meta charset="UTF-8" />
<script>
UPLOADCARE_PUBLIC_KEY = "demopublickey";
UPLOADCARE_TABS = "default huddle";
UPLOADCARE_DEBUG_UPLOADS = true;
</script>
<script src="./uploadcare.full.js"></script>
<script>
$ = uploadcare.jQuery;
jQuery = uploadcare.jQuery;
UPLOADCARE_PUBLIC_KEY = 'demopublickey'
UPLOADCARE_TABS = 'default huddle'
UPLOADCARE_DEBUG_UPLOADS = true
</script>
<script src="./uploadcare.js"></script>

<p>
We’ve developed a beautiful widget for the web.
Expand Down
7 changes: 2 additions & 5 deletions dummy/delayed.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@
UPLOADCARE_TABS = "default huddle";
UPLOADCARE_DEBUG_UPLOADS = true;
</script>
<script src="./uploadcare.full.js"></script>
<script>
$ = uploadcare.jQuery;
jQuery = uploadcare.jQuery;
</script>
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<script src="./uploadcare.js"></script>

<script>
UPLOADCARE_MANUAL_START = true;
Expand Down
2 changes: 1 addition & 1 deletion dummy/dialog.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
UPLOADCARE_TABS = 'default huddle'
UPLOADCARE_DEBUG_UPLOADS = true
</script>
<script src="./uploadcare.full.js"></script>
<script src="./uploadcare.js"></script>

<button>open</button>

Expand Down
7 changes: 2 additions & 5 deletions dummy/dnd.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@
UPLOADCARE_TABS = "default huddle";
UPLOADCARE_DEBUG_UPLOADS = true;
</script>
<script src="./uploadcare.full.js"></script>
<script>
$ = uploadcare.jQuery;
jQuery = uploadcare.jQuery;
</script>
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<script src="./uploadcare.js"></script>

<style>
#target {
Expand Down
5 changes: 1 addition & 4 deletions dummy/effects-old.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,10 @@
UPLOADCARE_TABS = "default huddle";
UPLOADCARE_DEBUG_UPLOADS = true;
</script>
<!-- <script src="./uploadcare.full.js"></script> -->
<!-- <script src="./uploadcare.js"></script> -->
<script src="https://ucarecdn.com/libs/widget/3.7.9/uploadcare.full.js" charset="utf-8"></script>
<script src="https://ucarecdn.com/libs/widget-tab-effects/1.x/uploadcare.tab-effects.js"></script>
<script>
$ = uploadcare.jQuery;
jQuery = uploadcare.jQuery;

uploadcare.registerTab('preview', uploadcareTabEffects)
</script>

Expand Down
6 changes: 2 additions & 4 deletions dummy/effects.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@
UPLOADCARE_TABS = "default huddle";
UPLOADCARE_DEBUG_UPLOADS = true;
</script>
<script src="./uploadcare.full.js"></script>
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<script src="./uploadcare.js"></script>
<script src="https://ucarecdn.com/libs/widget-tab-effects/1.x/uploadcare.tab-effects.js"></script>
<script>
$ = uploadcare.jQuery;
jQuery = uploadcare.jQuery;

uploadcare.registerTab('preview', uploadcareTabEffects)
</script>

Expand Down
7 changes: 2 additions & 5 deletions dummy/embedded.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@
UPLOADCARE_TABS = "default huddle";
UPLOADCARE_DEBUG_UPLOADS = true;
</script>
<script src="./uploadcare.full.js"></script>
<script>
$ = uploadcare.jQuery;
jQuery = uploadcare.jQuery;
</script>
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<script src="./uploadcare.js"></script>

<style>
input[type="text"] {
Expand Down
7 changes: 2 additions & 5 deletions dummy/form.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@
UPLOADCARE_TABS = "default huddle";
UPLOADCARE_DEBUG_UPLOADS = true;
</script>
<script src="./uploadcare.full.js"></script>
<script>
$ = uploadcare.jQuery;
jQuery = uploadcare.jQuery;
</script>
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<script src="./uploadcare.js"></script>

<style>
.param {
Expand Down
7 changes: 2 additions & 5 deletions dummy/in_hidden_el.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@
UPLOADCARE_TABS = "default huddle";
UPLOADCARE_DEBUG_UPLOADS = true;
</script>
<script src="./uploadcare.full.js"></script>
<script>
$ = uploadcare.jQuery;
jQuery = uploadcare.jQuery;
</script>
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<script src="./uploadcare.js"></script>

<div id="hidden-div" style="display:none">
<input type="hidden" role="uploadcare-uploader" />
Expand Down
7 changes: 2 additions & 5 deletions dummy/locale.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@
UPLOADCARE_TABS = "default huddle";
UPLOADCARE_DEBUG_UPLOADS = true;
</script>
<script src="./uploadcare.full.js"></script>
<script>
$ = uploadcare.jQuery;
jQuery = uploadcare.jQuery;
</script>
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<script src="./uploadcare.js"></script>

<script>
UPLOADCARE_LOCALE = "ru";
Expand Down
6 changes: 1 addition & 5 deletions dummy/multiple.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@
UPLOADCARE_TABS = "default huddle";
UPLOADCARE_DEBUG_UPLOADS = true;
</script>
<script src="./uploadcare.full.js"></script>
<script>
$ = uploadcare.jQuery;
jQuery = uploadcare.jQuery;
</script>
<script src="./uploadcare.js"></script>

<style>
dt {
Expand Down
8 changes: 2 additions & 6 deletions dummy/multiple_crop.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@
UPLOADCARE_TABS = "default huddle";
UPLOADCARE_DEBUG_UPLOADS = true;
</script>
<script src="./uploadcare.full.js"></script>
<script>
$ = uploadcare.jQuery;
jQuery = uploadcare.jQuery;
</script>
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<script src="./uploadcare.js"></script>

<input
type="text"
Expand All @@ -31,7 +28,6 @@
<div id="list"></div>

<script>
var $ = uploadcare.jQuery;
var widget = uploadcare.MultipleWidget("#uploader");

widget.onChange(function(group) {
Expand Down
6 changes: 1 addition & 5 deletions dummy/preview_step.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@
UPLOADCARE_TABS = "default huddle";
UPLOADCARE_DEBUG_UPLOADS = true;
</script>
<script src="./uploadcare.full.js"></script>
<script>
$ = uploadcare.jQuery;
jQuery = uploadcare.jQuery;
</script>
<script src="./uploadcare.js"></script>

<p>
With enabled preview step:
Expand Down
6 changes: 1 addition & 5 deletions dummy/rebuild-locale.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@
UPLOADCARE_TABS = 'default huddle'
UPLOADCARE_DEBUG_UPLOADS = true
</script>
<script src="./uploadcare.full.js"></script>
<script>
$ = uploadcare.jQuery
jQuery = uploadcare.jQuery
</script>
<script src="./uploadcare.js"></script>

<script>
let rebuild = locale =>
Expand Down
6 changes: 1 addition & 5 deletions dummy/system.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@
UPLOADCARE_TABS = "default huddle";
UPLOADCARE_DEBUG_UPLOADS = true;
</script>
<script src="./uploadcare.full.js"></script>
<script>
$ = uploadcare.jQuery;
jQuery = uploadcare.jQuery;
</script>
<script src="./uploadcare.js"></script>

<script src="https://cdnjs.cloudflare.com/ajax/libs/fastclick/1.0.6/fastclick.js"></script>
<script>
Expand Down
7 changes: 2 additions & 5 deletions dummy/ui.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@
UPLOADCARE_TABS = "default huddle";
UPLOADCARE_DEBUG_UPLOADS = true;
</script>
<script src="./uploadcare.full.js"></script>
<script>
$ = uploadcare.jQuery;
jQuery = uploadcare.jQuery;
</script>
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<script src="./uploadcare.js"></script>

<style>
body {
Expand Down
7 changes: 2 additions & 5 deletions dummy/upload_api.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@
UPLOADCARE_TABS = "default huddle";
UPLOADCARE_DEBUG_UPLOADS = true;
</script>
<script src="./uploadcare.full.js"></script>
<script>
$ = uploadcare.jQuery;
jQuery = uploadcare.jQuery;
</script>
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<script src="./uploadcare.js"></script>

<script>
UPLOADCARE_PUBLIC_KEY = "1c86ca998ba22e75fbc6";
Expand Down
7 changes: 2 additions & 5 deletions dummy/validators.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@
UPLOADCARE_TABS = "default huddle";
UPLOADCARE_DEBUG_UPLOADS = true;
</script>
<script src="./uploadcare.full.js"></script>
<script>
$ = uploadcare.jQuery;
jQuery = uploadcare.jQuery;
</script>
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<script src="./uploadcare.js"></script>

<p>
images only, 500kb max<br />
Expand Down
7 changes: 2 additions & 5 deletions dummy/with_value.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@
UPLOADCARE_TABS = "default huddle";
UPLOADCARE_DEBUG_UPLOADS = true;
</script>
<script src="./uploadcare.full.js"></script>
<script>
$ = uploadcare.jQuery;
jQuery = uploadcare.jQuery;
</script>
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<script src="./uploadcare.js"></script>

<style>
input {
Expand Down
4 changes: 4 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
}
Loading