-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:formio/formio.js into FIO-7208-mi…
…grate-tree-component-to-contrib
- Loading branch information
Showing
24 changed files
with
709 additions
and
409 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
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
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
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,24 @@ | ||
export default { | ||
type: 'form', | ||
display: 'form', | ||
components: [ | ||
{ | ||
label: 'Text Field', | ||
description: "<img <img src='https://somesite' onerror='var _ee = 2' >", | ||
tooltip: "<img src='https://somesite' onerror='var _ee = 1 >", | ||
applyMaskOn: 'change', | ||
tableView: true, | ||
key: 'textField', | ||
type: 'textfield', | ||
input: true | ||
}, | ||
{ | ||
type: 'button', | ||
label: 'Submit', | ||
key: 'submit', | ||
disableOnInvalid: true, | ||
input: true, | ||
tableView: false | ||
} | ||
], | ||
}; |
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
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 |
---|---|---|
@@ -1,26 +1,28 @@ | ||
import XHR from './xhr'; | ||
const azure = (formio) => ({ | ||
uploadFile(file, fileName, dir, progressCallback, url, options, fileKey, groupPermissions, groupId, abortCallback) { | ||
return XHR.upload(formio, 'azure', (xhr, response) => { | ||
xhr.openAndSetHeaders('PUT', response.url); | ||
xhr.setRequestHeader('Content-Type', file.type); | ||
xhr.setRequestHeader('x-ms-blob-type', 'BlockBlob'); | ||
return file; | ||
}, file, fileName, dir, progressCallback, groupPermissions, groupId, abortCallback).then(() => { | ||
return { | ||
storage: 'azure', | ||
name: XHR.path([dir, fileName]), | ||
size: file.size, | ||
type: file.type, | ||
groupPermissions, | ||
groupId, | ||
}; | ||
}); | ||
}, | ||
downloadFile(file) { | ||
return formio.makeRequest('file', `${formio.formUrl}/storage/azure?name=${XHR.trim(file.name)}`, 'GET'); | ||
} | ||
}); | ||
function azure(formio) { | ||
return { | ||
uploadFile(file, fileName, dir, progressCallback, url, options, fileKey, groupPermissions, groupId, abortCallback) { | ||
return XHR.upload(formio, 'azure', (xhr, response) => { | ||
xhr.openAndSetHeaders('PUT', response.url); | ||
xhr.setRequestHeader('Content-Type', file.type); | ||
xhr.setRequestHeader('x-ms-blob-type', 'BlockBlob'); | ||
return file; | ||
}, file, fileName, dir, progressCallback, groupPermissions, groupId, abortCallback).then(() => { | ||
return { | ||
storage: 'azure', | ||
name: XHR.path([dir, fileName]), | ||
size: file.size, | ||
type: file.type, | ||
groupPermissions, | ||
groupId, | ||
}; | ||
}); | ||
}, | ||
downloadFile(file) { | ||
return formio.makeRequest('file', `${formio.formUrl}/storage/azure?name=${XHR.trim(file.name)}`, 'GET'); | ||
} | ||
}; | ||
} | ||
|
||
azure.title = 'Azure File Services'; | ||
export default azure; |
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 |
---|---|---|
@@ -1,33 +1,35 @@ | ||
const base64 = () => ({ | ||
title: 'Base64', | ||
name: 'base64', | ||
uploadFile(file, fileName) { | ||
const reader = new FileReader(); | ||
function base64() { | ||
return { | ||
title: 'Base64', | ||
name: 'base64', | ||
uploadFile(file, fileName) { | ||
const reader = new FileReader(); | ||
|
||
return new Promise((resolve, reject) => { | ||
reader.onload = (event) => { | ||
const url = event.target.result; | ||
resolve({ | ||
storage: 'base64', | ||
name: fileName, | ||
url: url, | ||
size: file.size, | ||
type: file.type, | ||
}); | ||
}; | ||
return new Promise((resolve, reject) => { | ||
reader.onload = (event) => { | ||
const url = event.target.result; | ||
resolve({ | ||
storage: 'base64', | ||
name: fileName, | ||
url: url, | ||
size: file.size, | ||
type: file.type, | ||
}); | ||
}; | ||
|
||
reader.onerror = () => { | ||
return reject(this); | ||
}; | ||
reader.onerror = () => { | ||
return reject(this); | ||
}; | ||
|
||
reader.readAsDataURL(file); | ||
}); | ||
}, | ||
downloadFile(file) { | ||
// Return the original as there is nothing to do. | ||
return Promise.resolve(file); | ||
} | ||
}); | ||
reader.readAsDataURL(file); | ||
}); | ||
}, | ||
downloadFile(file) { | ||
// Return the original as there is nothing to do. | ||
return Promise.resolve(file); | ||
} | ||
}; | ||
} | ||
|
||
base64.title = 'Base64'; | ||
export default base64; |
Oops, something went wrong.