From: Plusb Preco Date: Sun, 12 Jun 2016 18:42:26 +0000 (+0900) Subject: :memo: Update Korean docs as upstream X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=68e99be9f66c0c8fd3156e62ed38731d6c25e178;p=platform%2Fframework%2Fweb%2Fcrosswalk-tizen.git :memo: Update Korean docs as upstream [ci skip] --- diff --git a/docs-translations/ko-KR/api/app.md b/docs-translations/ko-KR/api/app.md index e86e39e..40c5194 100644 --- a/docs-translations/ko-KR/api/app.md +++ b/docs-translations/ko-KR/api/app.md @@ -351,6 +351,7 @@ Linux에선, 첫 번째로 보여지는 윈도우가 포커스됩니다. OS X에 * `music` - 사용자의 음악 디렉터리. * `pictures` - 사용자의 사진 디렉터리. * `videos` - 사용자의 동영상 디렉터리. +* `pepperFlashSystemPlugin` - 시스템 버전의 Pepper Flash 플러그인의 전체 경로. ### `app.setPath(name, path)` diff --git a/docs-translations/ko-KR/api/download-item.md b/docs-translations/ko-KR/api/download-item.md index a748908..781d686 100644 --- a/docs-translations/ko-KR/api/download-item.md +++ b/docs-translations/ko-KR/api/download-item.md @@ -2,49 +2,70 @@ > 원격 소스로부터의 파일 다운로드를 제어합니다. -`DownloadItem`은 EventEmitter를 상속받았으며 Electron의 다운로드 아이템을 표현합니다. -이 클래스 객체는 `Session` 모듈의 `will-download` 이벤트에 사용되며 사용자가 다운로드 -아이템을 다룰 수 있도록 도와줍니다. +`DownloadItem`은 `EventEmitter`를 상속받았으며 Electron의 다운로드 아이템을 +표현합니다. 이 클래스 객체는 `Session` 클래스의 `will-download` 이벤트에 사용되며 +사용자가 다운로드 아이템을 다룰 수 있도록 도와줍니다. ```javascript // 메인 프로세스 win.webContents.session.on('will-download', (event, item, webContents) => { // Set the save path, making Electron not to prompt a save dialog. - item.setSavePath('/tmp/save.pdf'); - console.log(item.getMimeType()); - console.log(item.getFilename()); - console.log(item.getTotalBytes()); - item.on('updated', () => { - console.log('Received bytes: ' + item.getReceivedBytes()); - }); - item.on('done', (e, state) => { + item.setSavePath('/tmp/save.pdf') + + item.on('updated', (event, state) => { + if (state === 'interrupted') { + console.log('Download is interrupted but can be resumed') + } else if (state === 'progressing') { + if (item.isPaused()) { + console.log('Download is paused') + } else { + console.log(`Received bytes: ${item.getReceivedBytes()}`) + } + } + }) + item.once('done', (event, state) => { if (state === 'completed') { - console.log('Download successfully'); + console.log('Download successfully') } else { - console.log('Download is cancelled or interrupted that can\'t be resumed'); + console.log(`Download failed: ${state}`) } - }); -}); + }) +}) ``` ## Events ### Event: 'updated' -`downloadItem`이 갱신될 때 발생하는 이벤트입니다. +Returns: + +* `event` Event +* `state` String + +다운로드가 업데이트되었으며 아직 끝나지 않았을 때 발생하는 이벤트입니다. + +`state`는 다음 중 하나가 될 수 있습니다: + +* `progressing` - 다운로드가 진행중입니다. +* `interrupted` - 다운로드가 중지되었으며 다시 재개할 수 있습니다. ### Event: 'done' +Returns: + * `event` Event * `state` String - * `completed` - 다운로드가 성공적으로 완료되었습니다. - * `cancelled` - 다운로드가 취소되었습니다. - * `interrupted` - 다운로드 중 파일 서버로부터의 연결이 끊겼습니다. 다운로드가 종료될 때 발생하는 이벤트입니다. 이 이벤트는 다운로드 중 문제가 발생하여 중단되거나, 모두 성공적으로 완료된 경우, `downloadItem.cancel()` 같은 메서드를 통해 취소하는 경우의 종료 작업이 모두 포함됩니다. +`state`는 다음 중 하나가 될 수 있습니다: + +* `completed` - 다운로드가 성공적으로 완료되었습니다. +* `cancelled` - 다운로드가 취소되었습니다. +* `interrupted` - 다운로드가 중지되었으며 다시 재개할 수 있습니다. + ## Methods `downloadItem` 객체는 다음과 같은 메서드를 가지고 있습니다: @@ -61,10 +82,18 @@ win.webContents.session.on('will-download', (event, item, webContents) => { 다운로드를 일시 중지합니다. +### `downloadItem.isPaused()` + +다운로드가 일시 중지되었는지 여부를 반환합니다. + ### `downloadItem.resume()` 중디된 다운로드를 재개합니다. +### `downloadItem.canResume()` + +다운로드를 재개할 수 있는지 여부를 반환합니다. + ### `downloadItem.cancel()` 다운로드를 취소합니다. @@ -101,3 +130,14 @@ win.webContents.session.on('will-download', (event, item, webContents) => { ### `downloadItem.getContentDisposition()` 응답 헤더에서 Content-Disposition 필드를 문자열로 반환합니다. + +### `downloadItem.getState()` + +현재 상태를 `String` 타입으로 가져옵니다. + +값은 다음이 될 수 있습니다: + +* `progressing` - 다운로드가 진행중입니다. +* `completed` - 다운로드가 성공적으로 완료되었습니다. +* `cancelled` - 다운로드가 취소되었습니다. +* `interrupted` - 다운로드가 중지되었습니다. diff --git a/docs-translations/ko-KR/api/session.md b/docs-translations/ko-KR/api/session.md index 9f860f0..a2dc9b6 100644 --- a/docs-translations/ko-KR/api/session.md +++ b/docs-translations/ko-KR/api/session.md @@ -539,3 +539,23 @@ HTTP 요청을 보내기 전 요청 헤더를 사용할 수 있을 때 `listener * `timestamp` Double * `fromCache` Boolean * `error` String - 에러 설명. + +#### `ses.protocol` + +현재 세션의 [protocol](protocol.md) 모듈 인스턴스를 반환합니다. + +```javascript +const {app, session} = require('electron') +const path = require('path') + +app.on('ready', function () { + const protocol = session.fromPartition(partitionName).protocol + protocol.registerFileProtocol('atom', function (request, callback) { + var url = request.url.substr(7) + callback({path: path.normalize(__dirname + '/' + url)}) + }, function (error) { + if (error) + console.error('Failed to register protocol') + }) +}) +``` diff --git a/docs-translations/ko-KR/development/build-system-overview.md b/docs-translations/ko-KR/development/build-system-overview.md index 044a2da..b10b813 100644 --- a/docs-translations/ko-KR/development/build-system-overview.md +++ b/docs-translations/ko-KR/development/build-system-overview.md @@ -8,7 +8,7 @@ Electron은 프로젝트 생성을 위해 [gyp](https://gyp.gsrc.io/)를 사용 Electron을 빌드 할 때 `gyp` 파일들은 다음과 같은 규칙을 따릅니다: -* `atom.gyp`는 Electron의 빌드 과정 자체를 정의합니다. +* `electron.gyp`는 Electron의 빌드 과정 자체를 정의합니다. * `common.gypi`는 Node가 Chromium과 함께 빌드될 수 있도록 조정한 빌드 설정입니다. * `vendor/brightray/brightray.gyp`는 `brightray`의 빌드 과정을 정의하고 Chromium 링킹에 대한 기본적인 설정을 포함합니다. diff --git a/docs-translations/ko-KR/tutorial/using-pepper-flash-plugin.md b/docs-translations/ko-KR/tutorial/using-pepper-flash-plugin.md index 4e85f46..e813491 100644 --- a/docs-translations/ko-KR/tutorial/using-pepper-flash-plugin.md +++ b/docs-translations/ko-KR/tutorial/using-pepper-flash-plugin.md @@ -39,6 +39,9 @@ app.on('ready', () => { }); ``` +`app.getPath('pepperFlashSystemPlugin')` 형태로 호출하면 시스템에 설치된 Pepper +Flash 플러그인의 경로를 가져올 수도 있습니다. + ## `` 태그를 이용하여 플러그인을 활성화 `plugins` 속성을 `` 태그에 추가합니다.