From a065e04d529da1d847b5062a12c46d916408bf32 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 21:46:22 -0500 Subject: update based on https://github.com/mdn/yari/issues/2028 --- files/ko/mozilla/add-ons/amo/index.html | 15 - files/ko/mozilla/add-ons/amo/policy/index.html | 29 -- .../add-ons/bootstrapped_extensions/index.html | 349 ------------- .../index.html | 59 --- .../mozilla/add-ons/extension_packaging/index.html | 34 -- files/ko/mozilla/add-ons/plugins/index.html | 43 -- .../add-ons/plugins/macromedia_flash/index.html | 150 ------ .../mozilla/add-ons/plugins/reference/index.html | 16 - .../reference/np_getmimedescription/index.html | 38 -- .../plugins/reference/npn_posturlnotify/index.html | 76 --- .../index.html | 89 ---- files/ko/mozilla/add-ons/themes/index.html | 64 --- .../contents.rdf/index.html | 44 -- .../getting_started/index.html | 108 ---- .../creating_a_skin_for_firefox/index.html | 27 - .../install.rdf/index.html | 44 -- .../creating_a_skin_for_firefox/uuid/index.html | 10 - .../ko/mozilla/add-ons/themes/obsolete/index.html | 10 - .../mozilla/firefox/developer_edition/index.html | 56 --- files/ko/mozilla/firefox/headless_mode/index.html | 204 -------- .../mozilla/firefox/multiple_profiles/index.html | 242 --------- files/ko/mozilla/http_cache/index.html | 483 ------------------ .../index.html | 73 --- .../ko/mozilla/javascript_code_modules/index.html | 97 ---- files/ko/mozilla/js-ctypes/index.html | 53 -- .../\354\206\214\352\260\234/index.html" | 84 ---- files/ko/mozilla/marketplace/submission/index.html | 9 - files/ko/mozilla/marketplace_kr/index.html | 137 ------ files/ko/mozilla/mobile/index.html | 30 -- .../ko/mozilla/mobile/viewport_meta_tag/index.html | 99 ---- .../index.html | 98 ---- .../persona/bootstrapping_persona/index.html | 29 -- .../persona/browser_compatibility/index.html | 86 ---- files/ko/mozilla/persona/index.html | 137 ------ files/ko/mozilla/persona/quick_setup/index.html | 248 ---------- .../persona/user_interface_guidelines/index.html | 113 ----- files/ko/mozilla/persona/why_persona/index.html | 31 -- files/ko/mozilla/projects/emscripten/index.html | 37 -- files/ko/mozilla/projects/index.html | 14 - files/ko/mozilla/projects/l20n/index.html | 126 ----- files/ko/mozilla/projects/psm/index.html | 15 - .../mozilla/qa/bug_writing_guidelines/index.html | 177 ------- files/ko/mozilla/qa/index.html | 65 --- files/ko/mozilla/tech/index.html | 13 - files/ko/mozilla/tech/xpcom/guide/index.html | 16 - .../tech/xpcom/language_bindings/index.html | 25 - files/ko/mozilla/tech/xpcom/reference/index.html | 30 -- .../about_scriptable_interfaces/index.html | 26 - .../reference/interface/nsiloginmanager/index.html | 372 -------------- .../tech/xul/attribute/accesskey/index.html | 44 -- .../tech/xul/attribute/currentset/index.html | 25 - .../tech/xul/attribute/image.onload/index.html | 12 - files/ko/mozilla/tech/xul/attribute/index.html | 270 ---------- files/ko/mozilla/tech/xul/index.html | 25 - files/ko/mozilla/tech/xul/menu/index.html | 338 ------------- files/ko/mozilla/tech/xul/property/index.html | 219 -------- files/ko/mozilla/tech/xul/splitter/index.html | 79 --- .../ko/mozilla/tech/xul/template_guide/index.html | 52 -- files/ko/mozilla/tech/xul/toolbar/index.html | 218 -------- files/ko/mozilla/tech/xul/toolbarbutton/index.html | 477 ------------------ .../ko/mozilla/tech/xul/toolbarpalette/index.html | 98 ---- files/ko/mozilla/tech/xul/xul_controls/index.html | 548 --------------------- files/ko/mozilla/tech/xul/xul_reference/index.html | 148 ------ .../xul/xul_tutorial/adding_buttons/index.html | 102 ---- .../xul_tutorial/adding_event_handlers/index.html | 137 ------ .../xul_tutorial/adding_html_elements/index.html | 114 ----- .../adding_labels_and_images/index.html | 65 --- .../xul_tutorial/adding_more_elements/index.html | 87 ---- .../xul/xul_tutorial/box_model_details/index.html | 99 ---- .../xul/xul_tutorial/content_panels/index.html | 55 --- .../xul/xul_tutorial/creating_a_window/index.html | 113 ----- .../xul_tutorial/cross_package_overlays/index.html | 79 --- .../xul_tutorial/element_positioning/index.html | 259 ---------- .../xul_tutorial/focus_and_selection/index.html | 132 ----- .../mozilla/tech/xul/xul_tutorial/grids/index.html | 156 ------ .../tech/xul/xul_tutorial/groupboxes/index.html | 74 --- files/ko/mozilla/tech/xul/xul_tutorial/index.html | 132 ----- .../xul/xul_tutorial/input_controls/index.html | 110 ----- .../tech/xul/xul_tutorial/introduction/index.html | 38 -- .../xul_tutorial/introduction_to_rdf/index.html | 74 --- .../xul_tutorial/introduction_to_xbl/index.html | 82 --- .../xul/xul_tutorial/keyboard_shortcuts/index.html | 384 --------------- .../tech/xul/xul_tutorial/list_controls/index.html | 133 ----- .../tech/xul/xul_tutorial/localization/index.html | 279 ----------- .../xul/xul_tutorial/manifest_files/index.html | 118 ----- .../xul_tutorial/more_button_features/index.html | 69 --- .../xul_tutorial/more_event_handlers/index.html | 140 ------ .../xul/xul_tutorial/more_menu_features/index.html | 109 ---- .../tech/xul/xul_tutorial/popup_menus/index.html | 190 ------- .../xul/xul_tutorial/progress_meters/index.html | 59 --- .../xul/xul_tutorial/property_files/index.html | 64 --- .../tech/xul/xul_tutorial/scroll_bars/index.html | 71 --- .../xul/xul_tutorial/scrolling_menus/index.html | 46 -- .../xul/xul_tutorial/simple_menu_bars/index.html | 160 ------ .../tech/xul/xul_tutorial/splitters/index.html | 139 ------ .../xul/xul_tutorial/stack_positioning/index.html | 35 -- .../xul/xul_tutorial/stacks_and_decks/index.html | 61 --- .../tech/xul/xul_tutorial/tabboxes/index.html | 159 ------ .../tech/xul/xul_tutorial/templates/index.html | 126 ----- .../tech/xul/xul_tutorial/the_box_model/index.html | 118 ----- .../xul/xul_tutorial/the_chrome_url/index.html | 45 -- .../tech/xul/xul_tutorial/toolbars/index.html | 107 ---- .../mozilla/tech/xul/xul_tutorial/trees/index.html | 166 ------- .../tech/xul/xul_tutorial/using_spacers/index.html | 112 ----- .../xul/xul_tutorial/xpcom_examples/index.html | 132 ----- .../xul/xul_tutorial/xpcom_interfaces/index.html | 187 ------- .../tech/xul/xul_tutorial/xul_structure/index.html | 166 ------- .../index.html" | 124 ----- .../index.html" | 47 -- .../index.html" | 26 - .../localizing_with_verbatim/index.html" | 125 ----- .../index.html" | 135 ----- 112 files changed, 12723 deletions(-) delete mode 100644 files/ko/mozilla/add-ons/amo/index.html delete mode 100644 files/ko/mozilla/add-ons/amo/policy/index.html delete mode 100644 files/ko/mozilla/add-ons/bootstrapped_extensions/index.html delete mode 100644 files/ko/mozilla/add-ons/extension_frequently_asked_questions/index.html delete mode 100644 files/ko/mozilla/add-ons/extension_packaging/index.html delete mode 100644 files/ko/mozilla/add-ons/plugins/index.html delete mode 100644 files/ko/mozilla/add-ons/plugins/macromedia_flash/index.html delete mode 100644 files/ko/mozilla/add-ons/plugins/reference/index.html delete mode 100644 files/ko/mozilla/add-ons/plugins/reference/np_getmimedescription/index.html delete mode 100644 files/ko/mozilla/add-ons/plugins/reference/npn_posturlnotify/index.html delete mode 100644 files/ko/mozilla/add-ons/setting_up_extension_development_environment/index.html delete mode 100644 files/ko/mozilla/add-ons/themes/index.html delete mode 100644 files/ko/mozilla/add-ons/themes/obsolete/creating_a_skin_for_firefox/contents.rdf/index.html delete mode 100644 files/ko/mozilla/add-ons/themes/obsolete/creating_a_skin_for_firefox/getting_started/index.html delete mode 100644 files/ko/mozilla/add-ons/themes/obsolete/creating_a_skin_for_firefox/index.html delete mode 100644 files/ko/mozilla/add-ons/themes/obsolete/creating_a_skin_for_firefox/install.rdf/index.html delete mode 100644 files/ko/mozilla/add-ons/themes/obsolete/creating_a_skin_for_firefox/uuid/index.html delete mode 100644 files/ko/mozilla/add-ons/themes/obsolete/index.html delete mode 100644 files/ko/mozilla/firefox/developer_edition/index.html delete mode 100644 files/ko/mozilla/firefox/headless_mode/index.html delete mode 100644 files/ko/mozilla/firefox/multiple_profiles/index.html delete mode 100644 files/ko/mozilla/http_cache/index.html delete mode 100644 files/ko/mozilla/implementing_pontoon_in_a_mozilla_website/index.html delete mode 100644 files/ko/mozilla/javascript_code_modules/index.html delete mode 100644 files/ko/mozilla/js-ctypes/index.html delete mode 100644 "files/ko/mozilla/marketplace/publishing/\354\206\214\352\260\234/index.html" delete mode 100644 files/ko/mozilla/marketplace/submission/index.html delete mode 100644 files/ko/mozilla/marketplace_kr/index.html delete mode 100644 files/ko/mozilla/mobile/index.html delete mode 100644 files/ko/mozilla/mobile/viewport_meta_tag/index.html delete mode 100644 files/ko/mozilla/participating_in_the_mozilla_project/index.html delete mode 100644 files/ko/mozilla/persona/bootstrapping_persona/index.html delete mode 100644 files/ko/mozilla/persona/browser_compatibility/index.html delete mode 100644 files/ko/mozilla/persona/index.html delete mode 100644 files/ko/mozilla/persona/quick_setup/index.html delete mode 100644 files/ko/mozilla/persona/user_interface_guidelines/index.html delete mode 100644 files/ko/mozilla/persona/why_persona/index.html delete mode 100644 files/ko/mozilla/projects/emscripten/index.html delete mode 100644 files/ko/mozilla/projects/index.html delete mode 100644 files/ko/mozilla/projects/l20n/index.html delete mode 100644 files/ko/mozilla/projects/psm/index.html delete mode 100644 files/ko/mozilla/qa/bug_writing_guidelines/index.html delete mode 100644 files/ko/mozilla/qa/index.html delete mode 100644 files/ko/mozilla/tech/index.html delete mode 100644 files/ko/mozilla/tech/xpcom/guide/index.html delete mode 100644 files/ko/mozilla/tech/xpcom/language_bindings/index.html delete mode 100644 files/ko/mozilla/tech/xpcom/reference/index.html delete mode 100644 files/ko/mozilla/tech/xpcom/reference/interface/about_scriptable_interfaces/index.html delete mode 100644 files/ko/mozilla/tech/xpcom/reference/interface/nsiloginmanager/index.html delete mode 100644 files/ko/mozilla/tech/xul/attribute/accesskey/index.html delete mode 100644 files/ko/mozilla/tech/xul/attribute/currentset/index.html delete mode 100644 files/ko/mozilla/tech/xul/attribute/image.onload/index.html delete mode 100644 files/ko/mozilla/tech/xul/attribute/index.html delete mode 100644 files/ko/mozilla/tech/xul/index.html delete mode 100644 files/ko/mozilla/tech/xul/menu/index.html delete mode 100644 files/ko/mozilla/tech/xul/property/index.html delete mode 100644 files/ko/mozilla/tech/xul/splitter/index.html delete mode 100644 files/ko/mozilla/tech/xul/template_guide/index.html delete mode 100644 files/ko/mozilla/tech/xul/toolbar/index.html delete mode 100644 files/ko/mozilla/tech/xul/toolbarbutton/index.html delete mode 100644 files/ko/mozilla/tech/xul/toolbarpalette/index.html delete mode 100644 files/ko/mozilla/tech/xul/xul_controls/index.html delete mode 100644 files/ko/mozilla/tech/xul/xul_reference/index.html delete mode 100644 files/ko/mozilla/tech/xul/xul_tutorial/adding_buttons/index.html delete mode 100644 files/ko/mozilla/tech/xul/xul_tutorial/adding_event_handlers/index.html delete mode 100644 files/ko/mozilla/tech/xul/xul_tutorial/adding_html_elements/index.html delete mode 100644 files/ko/mozilla/tech/xul/xul_tutorial/adding_labels_and_images/index.html delete mode 100644 files/ko/mozilla/tech/xul/xul_tutorial/adding_more_elements/index.html delete mode 100644 files/ko/mozilla/tech/xul/xul_tutorial/box_model_details/index.html delete mode 100644 files/ko/mozilla/tech/xul/xul_tutorial/content_panels/index.html delete mode 100644 files/ko/mozilla/tech/xul/xul_tutorial/creating_a_window/index.html delete mode 100644 files/ko/mozilla/tech/xul/xul_tutorial/cross_package_overlays/index.html delete mode 100644 files/ko/mozilla/tech/xul/xul_tutorial/element_positioning/index.html delete mode 100644 files/ko/mozilla/tech/xul/xul_tutorial/focus_and_selection/index.html delete mode 100644 files/ko/mozilla/tech/xul/xul_tutorial/grids/index.html delete mode 100644 files/ko/mozilla/tech/xul/xul_tutorial/groupboxes/index.html delete mode 100644 files/ko/mozilla/tech/xul/xul_tutorial/index.html delete mode 100644 files/ko/mozilla/tech/xul/xul_tutorial/input_controls/index.html delete mode 100644 files/ko/mozilla/tech/xul/xul_tutorial/introduction/index.html delete mode 100644 files/ko/mozilla/tech/xul/xul_tutorial/introduction_to_rdf/index.html delete mode 100644 files/ko/mozilla/tech/xul/xul_tutorial/introduction_to_xbl/index.html delete mode 100644 files/ko/mozilla/tech/xul/xul_tutorial/keyboard_shortcuts/index.html delete mode 100644 files/ko/mozilla/tech/xul/xul_tutorial/list_controls/index.html delete mode 100644 files/ko/mozilla/tech/xul/xul_tutorial/localization/index.html delete mode 100644 files/ko/mozilla/tech/xul/xul_tutorial/manifest_files/index.html delete mode 100644 files/ko/mozilla/tech/xul/xul_tutorial/more_button_features/index.html delete mode 100644 files/ko/mozilla/tech/xul/xul_tutorial/more_event_handlers/index.html delete mode 100644 files/ko/mozilla/tech/xul/xul_tutorial/more_menu_features/index.html delete mode 100644 files/ko/mozilla/tech/xul/xul_tutorial/popup_menus/index.html delete mode 100644 files/ko/mozilla/tech/xul/xul_tutorial/progress_meters/index.html delete mode 100644 files/ko/mozilla/tech/xul/xul_tutorial/property_files/index.html delete mode 100644 files/ko/mozilla/tech/xul/xul_tutorial/scroll_bars/index.html delete mode 100644 files/ko/mozilla/tech/xul/xul_tutorial/scrolling_menus/index.html delete mode 100644 files/ko/mozilla/tech/xul/xul_tutorial/simple_menu_bars/index.html delete mode 100644 files/ko/mozilla/tech/xul/xul_tutorial/splitters/index.html delete mode 100644 files/ko/mozilla/tech/xul/xul_tutorial/stack_positioning/index.html delete mode 100644 files/ko/mozilla/tech/xul/xul_tutorial/stacks_and_decks/index.html delete mode 100644 files/ko/mozilla/tech/xul/xul_tutorial/tabboxes/index.html delete mode 100644 files/ko/mozilla/tech/xul/xul_tutorial/templates/index.html delete mode 100644 files/ko/mozilla/tech/xul/xul_tutorial/the_box_model/index.html delete mode 100644 files/ko/mozilla/tech/xul/xul_tutorial/the_chrome_url/index.html delete mode 100644 files/ko/mozilla/tech/xul/xul_tutorial/toolbars/index.html delete mode 100644 files/ko/mozilla/tech/xul/xul_tutorial/trees/index.html delete mode 100644 files/ko/mozilla/tech/xul/xul_tutorial/using_spacers/index.html delete mode 100644 files/ko/mozilla/tech/xul/xul_tutorial/xpcom_examples/index.html delete mode 100644 files/ko/mozilla/tech/xul/xul_tutorial/xpcom_interfaces/index.html delete mode 100644 files/ko/mozilla/tech/xul/xul_tutorial/xul_structure/index.html delete mode 100644 "files/ko/mozilla/\352\260\234\353\260\234\354\236\220_\355\224\204\353\241\234\352\267\270\353\236\250/index.html" delete mode 100644 "files/ko/mozilla/\354\225\210\353\223\234\353\241\234\354\235\264\353\223\234\354\232\251_\355\214\214\354\235\264\354\226\264\355\217\255\354\212\244/index.html" delete mode 100644 "files/ko/mozilla/\354\247\200\354\227\255\355\231\224/index.html" delete mode 100644 "files/ko/mozilla/\354\247\200\354\227\255\355\231\224/localizing_with_verbatim/index.html" delete mode 100644 "files/ko/mozilla/\354\247\200\354\227\255\355\231\224/pontoon_\354\247\200\354\227\255\355\231\224/index.html" (limited to 'files/ko/mozilla') diff --git a/files/ko/mozilla/add-ons/amo/index.html b/files/ko/mozilla/add-ons/amo/index.html deleted file mode 100644 index e1684b2100..0000000000 --- a/files/ko/mozilla/add-ons/amo/index.html +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: AMO -slug: Mozilla/Add-ons/AMO -tags: - - NeedsTranslation - - TopicStub -translation_of: Mozilla/Add-ons/AMO ---- -

Pages documenting addons.mozilla.org:

- -

{{Listsubpages("/en-US/Add-ons/AMO", 10)}}

- -

 

- -

 

diff --git a/files/ko/mozilla/add-ons/amo/policy/index.html b/files/ko/mozilla/add-ons/amo/policy/index.html deleted file mode 100644 index 58fb599b47..0000000000 --- a/files/ko/mozilla/add-ons/amo/policy/index.html +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: AMO Policies -slug: Mozilla/Add-ons/AMO/Policy -tags: - - AMO - - Add-ons - - Firefox - - NeedsTranslation - - Policies - - TopicStub -translation_of: Mozilla/Add-ons/AMO/Policy ---- -

{{AddonSidebar}}

- -

Mozilla is committed to ensuring an excellent experience for both our users and developers of add-ons. Please review the policies below before submitting your add-on.

- -
-
Developer Agreement
-
This agreement is effective as of June 10, 2019.
-
Add-on policies
-
Add-ons extend the core capabilities of Firefox, enabling users to modify and personalize their Web experience. A healthy add-on ecosystem, built on trust, is vital for developers to be successful and users to feel safe making Firefox their own.
-
For these reasons, Mozilla requires all add-ons to comply with the add-on policies on acceptable practices. The policies are not intended to serve as legal advice, nor are they intended to serve as a comprehensive list of terms to include in your add-on’s privacy policy.
-
Featured Add-ons
-
How up-and-coming add-ons become featured and what's involved in the process.
-
Contact Us
-
How to get in touch with us regarding these policies or your add-on. -

 

-
-
diff --git a/files/ko/mozilla/add-ons/bootstrapped_extensions/index.html b/files/ko/mozilla/add-ons/bootstrapped_extensions/index.html deleted file mode 100644 index 19bb9e4af8..0000000000 --- a/files/ko/mozilla/add-ons/bootstrapped_extensions/index.html +++ /dev/null @@ -1,349 +0,0 @@ ---- -title: Bootstrapped extensions -slug: Mozilla/Add-ons/Bootstrapped_extensions -translation_of: Archive/Add-ons/Bootstrapped_extensions ---- -

{{ gecko_minversion_header("2.0") }}

- -
-

노트: 부가기능 SDK 를 사용한 모든 확장기능은 부트스트랩입니다! 모든 부트스트랩 코드는 생성되었으므로 따로 고민할 필요 없습니다. 부가기능 SDK를 사용하지 않으셨나요? 계속 읽어주세요...

-
- -

전통적인 확장기능은 오버레이를 포함하고 있습니다. 오버레이는 확장기능 패키지에서 XUL 파일을 꺼내 자동으로 UI 위에 덧씌웁니다. 이 방식을 쓰면 UI에 무언가 더하는 확장기능을 만들기 쉬워지지만 업데이트, 설치, 사용불가를 할 때마다 파이어폭스를 다시 시작해야 합니다.

- -

Gecko 2.0{{ geckoRelease("2.0") }}은 부트스트랩 확장기능을 소개합니다. 이것은 오버레이 대신 직접 파이어폭스로 삽입되게 프로그램밍된  확장기능입니다.  확장기능 안에 포함된 어떤 스크립트 파일이 브라우저가 이 확장기능을 설치, 제거, 실행, 종료할 수 있게 해 줍니다.

- -

파이어폭스가 하는 일은 스크립트 파일에 따라 호출하는 것 뿐입니다.  UI의 추가, 제거, 설치, 종료 등은 모두 확장기능이 알아서 합니다.

- -

이 문서는 어떻게 부트스트랩 확장기능이 작동하는지 알려줍니다. 오버레이 확장기능을 부트스트랩으로 바꾸려면 converting from an overlay extension to restartless 이 문서를 확인하세요.

- -

시작과 종료 프로세스

- -

부트스트랩 확장기능의 가장 중요한 점은 필요에 따라 파이어폭스가 마음대로 켜고 끌 수 있어야 한다는 점입니다. 확장기능의 startup() 함수가 호출되면 UI와 다른 기능들이 수동으로 실행되어야 합니다. 마찬가지로 shutdown() 함수가 호출되면 파이어폭스에 추가한 것과 그것의 오브젝트의 모든 리퍼런스를 제거해야 합니다.

- -

startup() 함수가 호출될 때의 예:

- - - -

shutdown() 함수가 호출될 때의 예:

- - - -

파이어폭스 UI를 변경할 때

- -

부트스트랩 부가기능의 chrome.manifest

- -

다으의 경우에서 부트스트랩 부가기능의 chrome.manifest 을 사용할 수 있습니다:

- -
    -
  1. 부가기능을  chrome:// URL로 켤 때  (매니페스트에서 content, locale, 그리고 skin 인스트럭션을 사용하세요);
  2. -
  3. 이미 있는 chrome:// URI 를 교체할 때 (override 인스트럭션을 사용하세요).
  4. -
- -

부트스트랩 부가기능에서 모든 chrome.manifest 인스트럭션이 지원되는 것은 아닙니다. 예를 들어 XUL Overlays 는 부트스트랩 부가기능에서 사용할 수 없습니다. 더 자세한 내용은 chrome.manifest 문서를 참고하세요.

- -

파이어폭스 10 이후 버전에서 부가기능의 xpi 파일의 최상단(install.rdf 등과 같은 위치)에 위치해 있는  chrome.manifest 파일은 자동으로 열립니다. 파이어폭스 8과 9에서 당신은 직접 {{ ifmethod("nsIComponentManager", "addBootstrappedManifestLocation") }}{{ ifmethod("nsIComponentManager", "removeBootstrappedManifestLocation") }}를 통해 매니페스트 파일을 열고 닫아야 합니다. 이 기능은 파이어폭스 8 이전 버전에서는 지원되지 않습니다.

- -

UI를 수동으로 추가하기

- -

만약 파이어폭스의 UI를 바꾸는 부트스트랩 확장기능을 개발하기로 했다면 여기 몇가지 제안사항이 있습니다.

- -

우선 {{ domxref("document.getElementById()") }}를 호출해서 바꾸고자 하는 UI 엘리먼츠를 ID로 찾아야 합니다. 그 다음 UI를 추가하기 위한 조작을 합니다. 예를 들어 파이어폭스의 메뉴바에 접근하기 위해서 이렇게 합니다.  document.getElementById("main-menubar").

- -

종료할 대마다 추가한 모든 UI를 제거해야 합니다.

- -

부트스트랩 확장기능 만들기

- -

확장기능이 부트스트랩이라는 것을 표시하기 위해 install manifest 에 다음 줄을 추가하세요:

- -
<em:bootstrap>true</em:bootstrap>
- -

그 다음 필요한 기능들이 담긴 bootstrap.js 파일을 추가합니다; 이것은 확장기능 패키지에서 install.rdf 파일과 같이 있어야 합니다.

- -

Backward compatibility이전버전과의 호환

- -

오래된 버전의 파이어폭스는 bootstrap 속성이나 bootstrap.js 파일을 인식하지 못하기 때문에 부트스트랩 확장기능과 전통적인 확장기능이 모두 담긴 XPI 파일을 만드는 것은 어려운 일이 아닙니다. 확장기능을 부트스트랩으로 만든 다음 오버레이를 추가하세요. 새 버전의 파이어폭스는 bootstrap.js 스크립트를 사용하면서 컴포넌트와 오버레이를 무시할 것이고 오래된 버전은 오버레이를 사용할 것입니다.

- -

부트스트랩 진입점

- -

bootstrap.js 스크립트는 브라우저가 확장기능을 관리할 때 호출하는 특정 함수들을 포함하고 있어야 합니다. 스크립트는 특정 샌드박스에서 실행되며 샌드박스는 확장기능이 종료되기 전까지 캐시로 남아있습니다.

- -

startup

- -

확장기능을 시작할 때 호출됩니다. 파이어폭스가 켜질 때, 비활성화된 확장기능이 활성화될 때 또는 업데이트를 설치하기 위해 종료되었을 때 같은 상황에서 호출됩니다. 이처럼 파이어폭스의 생명주기동안 여러번 호출될 수 있습니다.

- -

이 함수가 호출되었을 때 부가기능은 UI를 추가하고 동작에 필요한 작업을 시작해야 합니다.

- -
void startup(
-  data,
-  reason
-);
-
- -
변수
- -
-
data
-
A bootstrap data structure.
-
reason
-
 reason constants 중의 하나로 왜 확장기능이 시작되었는지를 표시합니다. APP_STARTUP, ADDON_ENABLE, ADDON_INSTALL, ADDON_UPGRADE, 또는 ADDON_DOWNGRADE 중의 하나가 됩니다.
-
- -

shutdown

- -

파이어폭스가 꺼질때, 확장기능이 업그레이드되거나 비활성화 될 때 처럼 확장기능이 종료할 때 호출됩니다. 추가된 UI를 제거하고 태스크는 종료하고 오브젝트는 처리해야 합니다.

- -
void shutdown(
-  data,
-  reason
-);
-
- -
변수
- -
-
data
-
A bootstrap data structure.
-
reason
-
reason constants 중의 하나로 왜 확장기능이 종료되었는지를 표시합니다. APP_SHUTDOWN, ADDON_DISABLE, ADDON_UNINSTALL, ADDON_UPGRADE, 또는 ADDON_DOWNGRADE 중의 하나가 됩니다.
-
- -

install

- -

부트스트랩 스크립트는 확장기능이 설치, 업그레이드, 다운그레이드 되고 나서 첫번째로 startup() 함수를 호출하기 전에 호출할 install() 함수를 포함해야 합니다.

- -
노트: 이 메소드는 확장기능이 실행되지 않으면 호출되지 않습니다; 예를 들어 확장기능이 설치되었지만 파이어폭스의 현재 버전과 호환되지 않으면 install() 함수는 확장기능이 제거되기 전까지 호환성 문제를 해결하지 않는 이상 호출되지 않습니다. 그러나 만약 확장기능이 파이어폭스에 호환되도록 업그레이드된다면 install() 함수는 그때 startup() 함수가 호출되기 전에 호출될 것입니다.
- -
void install(
-  data,
-  reason
-);
-
- -
변수
- -
-
data
-
A bootstrap data structure.
-
reason
-
reason constants의 하나로 왜 확장기능이 설치되었는지 표시힙니다. ADDON_INSTALL, ADDON_UPGRADE, or ADDON_DOWNGRADE중 하나가 됩니다.
-
- -

uninstall

- -

이 함수는 마지막으로 shutdown() 함수가 호출되었을 때 이후 특정 버전의 확장기능이 제거되었을 때 호출됩니다. install() 이 호출되지 않았다면 이 함수는 호출되지 않습니다.

- -
노트: uninstall() 함수는 확장기능이 비활성화 되어있거나 현재 파이어폭스와 버전이 맞지 않더라도 호출될 수 있다는 것을 기억해야 합니다. 그렇기 때문에 현재 파이어폭스에서 지원되지 않는 API들을 우아하게 다루는 것이 중요합니다. 또한 이 함수는 파이어폭스가 실행되지 않을 때 써드파티 애플리케이션이 확장기능을 제거했을 때는 호출되지 않습니다. uninstall 코드가 있는데 실행이 안될 때install() {} 만 있는것은 충분하지 않습니다. install 함수에서 몇몇 코드를 실행하던지, 최소한 install function에 이런 식으로 선언해야 합니다: function install(aData, aReason) {} 그러면 uninstall 코드가 실행될 것입니다.
- -
노트: 부가 기능 관리자에서 부가기능의 "제거"를 클릭할 경우는 바로 uninstall 함수를 호출하진 않습니다. 왜냐하면 "취소"버튼이 있기 때문입니다. 부가기능 관리자를 닫거나 해서 "취소" 버튼이 사라지면 그때 호출됩니다.
- -
노트: uninstall 함수는 업그레이드와 다운그레이드 시에도 호출되기 때문에  다음과 같이 표시해주어야 합니다:
-function uninstall(aData, aReason) {
-     if (aReason == ADDON_UNINSTALL) {
-          console.log('really uninstalling');
-     } else {
-          console.log('not a permanent uninstall, likely an upgrade or downgrade');
-     }
-}
- -
void uninstall(
-  data,
-  reason
-);
-
- -
변수
- -
-
data
-
A bootstrap data structure.
-
reason
-
reason constants의 하나로 왜 확장기능이 제거되었는지 표시해줍니다. ADDON_UNINSTALL, ADDON_UPGRADE, 또는 ADDON_DOWNGRADE 중의 하나가 됩니다.
-
- -

Reason 상수

- -

부트스트랩의 함수는 reason 변수를 허용합니다. 이는 확장기능에게 왜 호출되었는지를 설명합니다. reason 상수는 다음과 같습니다:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
상수설명
APP_STARTUP1파이어폭스가 실행
APP_SHUTDOWN2파이어폭스가 종료
ADDON_ENABLE3부가기능이 활성화
ADDON_DISABLE4부가기능이 비활성화 (혹은 제거중 호출됨)
ADDON_INSTALL5부가기능이 설치됨
ADDON_UNINSTALL6부가기능이 제거됨
ADDON_UPGRADE7부가기능이 업그레이드됨
ADDON_DOWNGRADE8부가기능이 다운그레이드됨
- -

Bootstrap data

- -

각각의 진입점들은 부가기능의 유용한 정보를 담고 있는 간단한 데이터 구조를 갖고 있습니다. 부가기능에 대한 더 많은 정보는 AddonManager.getAddonByID()를 호출하는 것으로 알 수 있습니다. 그 데이터는 다음과 같은 속성을 갖고있는 간단한 자바스크립트 오브젝트입니다:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
속성자료형설명
idstring부가기능의 ID
versionstring부가기능의 버전
installPathnsIFile부가기능이 설치된 장소. 부가기능이 언팩되어있는지 여부에 따라 디렉터리가 될 수도 있고 XPI 파일이 될 수도 있습니다.
resourceURInsIURI부가기능의 루트를 가리키는 URI. 부가기능이 언팩되어있는지 여부에 따라 jar: 이 될 수도 있고 file: URI 이 될 수도 있습니다. {{ gecko_minversion_inline("7.0") }}
oldVersionstring과거 설치된 버전, reason이 ADDON_UPGRADE 이거나 ADDON_DOWNGRADE이고 함수가 install 이나 startup일 경우. {{ gecko_minversion_inline("22.0") }}
newVersionstring설치될 버전. reason이 ADDON_UPGRADE 이나 ADDON_DOWNGRADE이고 함수가 is shutdown 이나 uninstall일 경우. {{ gecko_minversion_inline("22.0") }}
- -
-

노트: startup 함수의 reason이 APP_STARTUP이고 oldVersion 속성이 설정되어있지 않으면 부가기능은 파이어폭스가 시작될 때 업그레이드/다운그레이드 될 수 있습니다. 또한 어떤 상황에서는 uninstall 함수가 호출되지 않고도 업그레이드/다운그레이드가 일어난다는 것을 주의하세요.

-
- -

부가 기능 디버거

- -

파이어폭스 31부터 부트스트랩 부가 기능을 디버깅하기 위해서 부가 기능 디버거를 사용할 수 있습니다.

- -

현지화 (L10n)

- -

부트스트랩 부가기능을 현지화하는 것은 chrome.manifest 호환성이 정착된 파이어폭스 7 이후로 거의 같습니다.

- -

JS와 JSM 파일 - 속성 파일 사용하기

- -

.js와 .jsm 파일을 현지화하기 위해서 속성 파일을 사용해야 합니다.

- -

필요한 최소한의 것들은:

- -
    -
  1. 파일: install.rdf
  2. -
  3. 파일: chrome.manifest
  4. -
  5. 파일: bootstrap.js
  6. -
  7. 폴더: locale -
      -
    1. 폴더: VALID_LOCALE_HERE -
        -
      1. 파일: ANYTHING.properties
      2. -
      -
    2. -
    -
  8. -
- -

locale 폴더 안에 지원할 각각의 언어를 위한 폴더들이 있어야 합니다; 각각의 폭더는 유효한 로케일의 이름이어야 합니다(예: en-US). 폴더 안에는 속성파일이 들어있어야 합니다. chrome.manifest 파일 안에는 이런 로케일들이 정의되어야 합니다. 예를 들어 locale 폴더 안에 en-US 폴더가 들어있을 경우 chrome.manifest 파일에는 다음 줄이 추가되어야 합니다: locale NAME_OF_YOUR_ADDON en-US locale/en-US/

- -

여기 예가 있습니다: GitHub :: l10n-properties - 이 부가기능을 실행하면 프롬프트에 USA나 Great Britain중 당신의 로케일에 가까운 쪽이 뜰 것입니다. about:config에서  general.useragent.locale을 en-US로 바군 뒤 en-GB로 설정하고 부가기능을 비활성화 한 뒤에 활성화하면서 다른 로케일을 시험해볼 수 있습니다.

- -

XUL과 HTML 파일 - Using Entities from DTD Files

- -

HTML파일은 흔히 사용되지만 DTD을 사용해 번역할 수 없습니다. 변경해야 하는 것이 세가지가 있습니다:

- -
    -
  1.  HTML 파일의 확장자를 .xhtml로 변경합니다
  2. -
  3. doctype에서 locale 폴더 속의 DTD 파일의 위치가 이런 식으로 정의되어야 합니다: <!DOCTYPE html SYSTEM "chrome://l10n/locale/mozilla.dtd">
  4. -
  5. html 태그에 xmlns 속성을 붙여야 합니다: <html xmlns="http://www.w3.org/1999/xhtml">
  6. -
- -

최소한으로 필요한 것:

- -
    -
  1. 파일: install.rdf
  2. -
  3. 파일: chrome.manifest
  4. -
  5. 파일: bootstrap.js
  6. -
  7. 폴더: locale -
      -
    1. 폴더: VALID_LOCALE_HERE -
        -
      1. 파일: ANYTHING.dtd
      2. -
      -
    2. -
    -
  8. -
- -

chrome.manifest 파일은 이와 같이 내용에 대한 정의를 포함해야 합니다: content NAME_OF_YOUR_ADDON ./

- -

chrome.manifest 파일은 또한 위의 속성 섹션처럼 locale을 가리키는 라인이 포함되어야 합니다. locale의 폴더 이름이 en-US라면chrome.manifest 파일은 다음 줄을 포함해야 합니다: locale NAME_OF_YOUR_ADDON en-US locale/en-US/

- -

이것은 설치되면 HTML과 XUL 페이지를 열어주는 예시 부가기능입니다: GitHub :: l10n-xhtml-xul. 이것은 어떻게 현지화된 HTML파일을 옵션으로 쓸 수 있는지의 예입니다: GitHub :: l10n-html-options.  about:config에서 general.useragent.locale을 en-US로 바꾼 뒤 en-GB로 바꾸고 열린 페이지를 새로고침 하면 현지화의 변화를 알 수 있습니다.

- -

더 읽어보기

- - diff --git a/files/ko/mozilla/add-ons/extension_frequently_asked_questions/index.html b/files/ko/mozilla/add-ons/extension_frequently_asked_questions/index.html deleted file mode 100644 index 508750dfad..0000000000 --- a/files/ko/mozilla/add-ons/extension_frequently_asked_questions/index.html +++ /dev/null @@ -1,59 +0,0 @@ ---- -title: Extension Frequently Asked Questions -slug: Mozilla/Add-ons/Extension_Frequently_Asked_Questions -tags: - - Add-ons - - Extensions -translation_of: Archive/Mozilla/Extension_Frequently_Asked_Questions ---- -

디버깅

-

확장기능을 디버깅하기 전에development preferences 를 올바르게 설정하시기를 권장합니다.

-

자바스크립트 디버거인 Venkman은 복잡한 디버깅 상황에서 유용한 디버거가 되어 줄 것입니다. 디버깅 하실 때, "Debug -> Exclude Browser Files" 옵션이 활성화 되어 있지 않아야 합니다.

-

 

-

어떻게하면 코드내 에러를 볼 수 있을까?

-

preference 의 javascript.options.showInConsole옵션이 true 값이 되도록 설정하시면, 모든 종류의 에러 메시지는 자바스크립트 콘솔을 통해서 보고될 것입니다.

-

어떻게하면 확장기능이 제대로 동작 하는지 확인할 수 있을까?

-

alert() 이나 dump() 함수, 또는 nsIConsoleService를 사용하실 수 있습니다.

-

왜 내가 만든 스크립트는 제대로 동작하지 않을까?

-

만약 스크립트가 예상대로 동작하지 않는다면, 자바스크립트 콘솔의 에러 메시지를 확인해 보시기를 권합니다. (어떻게하면 코드내 에러를 볼 수 있을까? 위에 있음)

-

한가지 흔한 실수는 윈도우가 완전히 로드되기 전에, 윈도우에 있는 DOM에 접근하려고 하는 것입니다. 이러한 실수는 초기화 코드가 스크립트내의 상위 레벨에서(다른 말로하면, 함수 밖에서) 실행될때 발생합니다. 이를 찾아내기 위해서는 윈도우가 완전히 로드될때까지 특정 부분의 코드가 실행되지 않도록 해주는 load event listener를 사용하시기 바랍니다.

-
function exampleBrowserStartup(event)
-{
-  // place your startup code here
-}
-window.addEventListener("load", exampleBrowserStartup, false);
-
-

웹페이지에 있는 문서를 읽어들일 수 없을 때

-

browser.xul 오버레이로 부터 현재 웹페이지의 문서를 가져올 때, 브라우저의 윈도우 문서를 읽어오도록 하는 document 를 사용하는 대신에 브라우저의 윈도우 내에 포함되어 있는 문서를 읽어오도록 하는 content.document 를 사용하시기 바랍니다. 보다 자세한 내용은 Working with windows in chrome code 에서 확인하실 수 있습니다.

-

또한, XPCNativeWrapper는 기본적으로 웹페이지에 있는 script-defined 객체에 접근하는 것과 그 외 다른 것들을 하지 못 하도록 방지해 줍니다.

-

 

-

XML 파싱에러가 났지만, 파일에 문제가 없어 보일 때

-

일반적으로 파싱에러(붉은색 문구와 붉은색 밑줄-------------^로 표시됨)는 XML에서 의미있게 사용되는 특정한 문자나 속성 값이 소스코드내에서 잘 못 사용됐을 때 발생합니다. 예를들면,

-
<button oncommand="window.open('http://example.com/q?param1=value&param2=val2')"/>
-
-

또는,

-
<script>function lesser(a,b) { return a < b ? a : b; }</script>
-
-

이러한 문제는 다음과 같은 방법으로 해결될 수 있습니다.

-
    -
  1. 에러가 발생한 문자를 XML에서 특정한 의미로 사용되지 않는 표현으로 바꾸십시오. (예: "&" -> "&amp;", "<" -> "&lt;")
  2. -
  3. (만일 텍스트 노드라면, 이를테면 스크립트) CDATA 태그로 텍스트 노드를 에워싸십시오: -
    <script><![CDATA[
    -   function lesser(a,b) {
    -     return a < b ? a : b;
    -   }
    - ]]></script>
    -
  4. -
  5. 스크립트를 다른 파일로 저장한 후, 이를 포함시키도록 하는 코드를 삽입하십시오: -
    <script type="application/x-javascript" src="our.js"/>
    -
  6. -
-

 

-

예제 코드

-

무엇인가 유용한 동작을 구현하기 위해서 필요한 코드가 있다면, 가장 쉬운 방법은 이미 그러한 동작을 구현한 확장기능 (또는 Mozilla의 일부분)을 찾아내어 살펴보는 것입니다. (XPI와 JAR 파일은 ZIP 포멧을 사용합니다.)

-

이와 관련된 문서는 the list of extension-related articles on MDCExample code page on MozillaZine에서 찾아 보실수 있습니다.

-

 

-

도움을 얻을 수 있는 곳

-

Extensions:Other ResourcesExtensions:Community를 꼭 읽어 주십시오.

-

도움을 청하시기 전에, 디버깅자바스크립트 콘솔의 내용을 읽어주십시오. 또한, 질문을 하시기 전에, 질문에 대한 간단한 검색을 해주실 것과 자주묻는질문(FAQ)을 읽어주시길 부탁드립니다.

-

{{ languages( { "es": "es/Preguntas_frecuentes_sobre_Extensiones", "fr": "fr/Foire_aux_questions_sur_les_extensions", "it": "it/Domande_frequenti_sulle_Estensioni", "ko": "ko/\ud655\uc7a5\uae30\ub2a5\uc5d0_\uad00\ud55c_\uc790\uc8fc\ud558\ub294_\uc9c8\ubb38" } ) }}

diff --git a/files/ko/mozilla/add-ons/extension_packaging/index.html b/files/ko/mozilla/add-ons/extension_packaging/index.html deleted file mode 100644 index 2dd7ff02eb..0000000000 --- a/files/ko/mozilla/add-ons/extension_packaging/index.html +++ /dev/null @@ -1,34 +0,0 @@ ---- -title: Extension Packaging -slug: Mozilla/Add-ons/Extension_Packaging -tags: - - Add-ons - - Extensions - - Toolkit API -translation_of: Archive/Add-ons/Extension_Packaging ---- -

확장기능은 설치 가능한 번들의 한 형태입니다. 확장기능은 사용자가 직접 내려받아 설치할 수 있으며 응용프로그램에 미리 포함되어 있거나 외부 프로그램에 의해서 제공되기도 합니다. 확장기능은 chrome, components 등의 디렉토리 구조로 되어 있는데 개별 구조는 XUL 프로그램으로 확장됩니다.

-

모든 확장기능은 자신의 메타정보를 담은 install.rdf 파일을 제공해야 하는데 파일은 유일한 ID, 버전, 저자, 호환성 정보를 담고 있습니다.

-

확장기능 파일과 install.rdf가 준비된 다음 확장 기능의 설치를 위한 몇가지 준비 단계가 있습니다. 사용자 설치가능한 확장기능 디렉토리의 ZIP 포맷인 XPI(xpinstall) 파일, 사용자 응용프로그램이나 프로필 디렉토리에 확장기능을 직접 압축 풀기, 윈도우즈 레즈스트리에 확장기능을 등록의 단계입니다.

-

확장기능 XPI 만들기

-

XPI(XPInstall) 파일은 단순히 install.rdf 파일이 ZIP 파일의 최상단에 위치하는 확장기능 파일을 담은 ZIP 파일입니다. 사용자는 XPI 파일을 웹사이트나 로컬 파일에서 파일을 열거나 확장기능 관리창에 끌어 옮김으로서 내려 받거나 설치할 수 있습니다.

-

파이어폭스 XPI 파일에 대한 MIME 형은 application/x-xpinstall로 인식이 됩니다. 대부분의 HTTP 서버가 .xpi 확장기능에 대한 MIME 타입을 반환하는 설정을 기본으로 하지 않기 때문에 어쩌면 HTTP 서버를 재설정해야 할 수도 있습니다. 아파치 HTTP 서버에서는 아래의 문장을 설정 파일이나 .htaccess 파일에 삽입해야 합니다.

-
AddType application/x-xpinstall .xpi
-
-

확장기능 파일 직접 설치하기

-

만약 응용 프로그램의 위치를 알고 있다면 (예를 들어 응용 프로그램의 설치과정에 확장기능을 설치하게 할려면) 직접 <appdir>/extensions/<extensionID>에 확장 기능 파일을 직접 설치할 수 있습니다. 확장기능은 다음번 응용 프로그램이 실행될 때 확장기능 관리자에 의해 자동으로 인식됩니다.

-

이 방법을 사용할 때 디렉토리와 확장기능 파일에 대한 파일 시스템의 권한이 적절하게 설정되어 있는지 확인해야 합니다. 확장기능 관리자는 확장기능의 권한이 적합한지 아닌지 판단하는 기능이 없습니다.

-

확장기능 위치를 윈도우 레지스트리에 등록하기

-

(자바 런타임 따위의) 외부 설치자가 응용프로그램은 아직 설치되지 않은 상황에 통합적인 위치에 확장기능을 설치하고자 할 수 있습니다. 윈도우즈 레지스트리 사용을 통해 처리할 수 있습니다.

-

여러 항목을 포함한 확장기능 XPI

-

하나의 XPI 파일로 여러개의 확장과 테마를 설치하길 원할 때도 있습니다. 특별한 종류의 여러 항목을 포함한 XPI 포장라고 불리우는 특별한 형태의 XPI는 이런 패키지를 만들 수 있습니다. (Firefox 1.5/XULRunner 1.8 이상이 필요합니다.)

-

Official References for Toolkit API

-

-

diff --git a/files/ko/mozilla/add-ons/plugins/index.html b/files/ko/mozilla/add-ons/plugins/index.html deleted file mode 100644 index 77ab95c032..0000000000 --- a/files/ko/mozilla/add-ons/plugins/index.html +++ /dev/null @@ -1,43 +0,0 @@ ---- -title: Plugins -slug: Mozilla/Add-ons/Plugins -tags: - - Plugins -translation_of: Archive/Plugins ---- -
-

플러그인(Plugins or plug-ins) 은 어떤 특정한 기능을 제공하기 위해 웹브라우저와 상호작용하는 작은 소프트웨어입니다. 일반적인 예로는 특정한 그래픽 형식을 보여주기 위한 플러그인이나 멀티미디어 파일을 재생하기 위한 플러그인을 들 수 있습니다. 플러그인은 현재있는 기능을 수정하거나 덧붙이는 확장기능과는 조금 다릅니다. -

-
- - -
-

문서

-
Gecko 플러그인 API 레퍼런스 -
이 레퍼런스는 Gecko 플러그인을 만들기 위한 응용프로그램 프로그래밍 인터페이스에 대해 기술하고 있으며, 이러한 인터페이스를 사용하는 방법에 대한 정보를 제공합니다. -
-
XPInstall을 이용한 플러그인 설치 -
XPInstall은 별도의 설치프로그램을 실행하기 위해 사용자가 브라우저를 종료하지 않아도 플러그인을 설치할 수 있도록 사용자에게 한결 나은 방법을 제공합니다. -
-
플러그인 검사 -
"Since there are clearly times when it makes sense to use a plug-in, the question arises of how to deal with those who don’t have the required plug-in installed." -
-
플러그인을 스크립트로 제어하기: Macromedia Flash -
이 문서에서는 JavaScript가 Flash 플러그인 내부에 있는 메소드에 접근하기 위해 어떻게 사용되었는지에 대해 설명하고, 마찬가지로 Flash 애니메이션에서 JavaScript를 호출하기 위한 FSCommands 라는 기능에 대해서도 설명합니다. -
-

모두 보기... -

-
-

커뮤니티

-
  • Mozilla 포럼 보기... -
-

{{ DiscussionList("dev-tech-plugins", "mozilla.dev.tech.plugins") }} -

-

관련 주제

-
Gecko -
-
-

Categories -

Interwiki Language Links -


-

{{ languages( { "es": "es/Plugins", "fr": "fr/Plugins", "ja": "ja/Plugins", "pl": "pl/Wtyczki", "pt": "pt/Plugins" } ) }} diff --git a/files/ko/mozilla/add-ons/plugins/macromedia_flash/index.html b/files/ko/mozilla/add-ons/plugins/macromedia_flash/index.html deleted file mode 100644 index 2784594e4c..0000000000 --- a/files/ko/mozilla/add-ons/plugins/macromedia_flash/index.html +++ /dev/null @@ -1,150 +0,0 @@ ---- -title: Macromedia Flash -slug: Mozilla/Add-ons/Plugins/Macromedia_Flash -tags: - - Plugins -translation_of: Archive/Plugins/Scripting_Plugins_Adobe_Flash ---- -

스크립트로 제어할 수 말은 JavaScript와 플러그인이 상호 작용할 수 있다는 말입니다. 특히 Macromedia® Flash™ 플러그인은 JavaScript에서 플러그인에 접근할 수 있는 기능을 제공하고 있으며, 플러그인 안에서 JavaScript 메소드에 접근할 수도 있습니다. 이 문서는 Flash 플러그인이 노출하고 있는 메소드에 JavaScript로 접근하는 방법에 대해서, 그리고 Flash 애니메이션에서 JavaScript 함수에 접근하기 위해 FSCommand라는 기능을 사용하는 방법에 대해서 설명하고 있습니다. 이 문서는 Gecko™ 기반 웹브라우저에서 Flash 플러그인을 사용할 때의 팁에 초점을 두고 있습니다.

- -

올바른 Flash 플러그인(과 브라우저)를 알아내기

- -

Macromedia Flash는 Flash 6r49 버전부터 Netscape Gecko 브라우저에서 스크립트로 제어할 수 있는 기능을 제공합니다. Flash 5 같이 6r49 이전 버전은 Netscape Gecko 브라우저에서 스크립트로 제어할 수 없습니다. 그러므로 클라이언트에 설치된 Flash 버전을 알아내는 일은 Flash를 스크립트로 제어함에 있어서 아주 중요한 일입니다. Mac OS X에서는 피해야 할 문제점이 하나 더 있습니다. Mach-O 바이너리 형식을 사용하는 Camino (이전에는 Chimera였음) 브라우저, Mozilla 브라우저 최신 버전, 앞으로 나올 Netscape 브라우저들은 Flash 플러그인을 스크립트로 제어하는 기능을 사용할 수 없습니다. Macromedia가 Flash 플러그인을 수정하기 전까지는 Mac OS X에서 Gecko 기반 브라우저들은 스크립트로 Flash를 제어할 수 없습니다. 다음에 나오는 예제는 실제로 Flash 버전을 알아내는 휴리스틱(heuristic)한 방법을 보여줍니다.

- -

예제 1: Flash 플러그인 버전을 검사하기

- -

아래의 JavaScript는 Flash 버전을 알아내고, Netscape Gecko에서 스크립트로 제어 가능한지 알아내는 기능을 합니다.

- -
can we have javascript in a wiki page?
-<script type="text/javascript">identifyFlash();</script>
-
- -

일반적으로, 어느 버전 플러그인이 설치돼있는지 알아내는 JavaScript 코드는 navigator 개체(object)안의 mimeTypes 배열을 찾아봅니다. 모든 플러그인은 보통 플러그인 이름과 버전을 포함하고 있는 description 문자열을 제공합니다. Flash 플러그인의 descripton 문자열은 의미있는 정보를 뽑아낼 수 있는 표준적인 버전 번호 명명법으로 기록되어 있습니다. 예를 들어 현재 Flash 플러그인 버전은 Flash 6 r79입니다. description 문자열은 이 버전을 담고 있습니다. 이외에도 OS X에서 Mach-O 바이너리를 사용하는 브라우저에서 스크립트로 제어할 수 없는 Flash 버전은 골라낼 수 있는 방법이 필요합니다. 다행히 Netscape Gecko 기반 Mach-O 브라우저는 user-agent 문자열에 그 정보를 보여줍니다. Flash 플러그인 버전을 알아내는 알고리즘적 접근 방법은 다음과 같을 것입니다.

- -
var plugin = navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin;
-var description = plugin.description;
-// 1.description 문자열을 구성요소 별로 나눈다
-
-var versionArray = description.match(/[\d.]+/g);
-
-// 2. Flash 버전이 6r.49보다 큰지 결정한다
-// 3. 그렇다면 Windows와 Linux에서 스크립트로 제어 가능한 버전이다
-// 4. 브라우저가 Mach-O 바이너리를 사용하는지 검사한다
-// 5. 그렇다면 플러그인 버전이 12보다 큰지 검사한다
-// 버전 12는 Mach-O 브라우저에서도 Flash 플러그인을 스크립트로 제어할 수 있게
-// 수정될 것이라 예상되는 Flash 버전이다
-
-var flashVersionOSXScriptable = 12;
-if(navigator.userAgent.indexOf("Mach-O")!=-1)
-{
-	if(flashversion < flashVersionOSXScriptable)
-		// Flash 버전이 12보다 작으므로 OS X에서 스크립트로 제어할 수 없다
-}
-// 6. 에러 처리(Flash가 설치되지 않은 경우 등)
-
- -

예제 1에서는 JavaScript 문자열의 RegExp (정규 표현식) 개체를 사용합니다. description 문자열은 match 메소드 호출로 인해 구성요소별로 나누어져 배열에 들어갑니다. 여기 사용된 정규 표현식은 문자열이 Flash Major rMinor 같은 식으로 구성되어 있을 것이라고 가정합니다. Major는 "5"나 "6" 같은 메이저 버전 번호이고, Minor는 마이너 버전 번호입니다. 또 예제 1에서는 flashVersionOSXScriptable 상수를 만들어서 12를 할당하는데, 이것은 OS X용 Mach-O 브라우저에서 Flash를 스크립트로 제어할 수 있도록 수정된 Flash 버전이 12일 것이라고 임의로 정한 것입니다. 12 정도면 충분히 큰 버전 번호라고 생각됩니다(현재 버전은 6r.79입니다). Mac OS X에 있는 문제점이 언제 수정될 지 정보를 얻게 된다면 flashVersionOSXScriptable 상수를 좀 더 정확한 값으로 바꿀 수 있을 것입니다. 이 예제를 실제로 구현한 코드는 flashversion.js 파일을 보시면 됩니다.

- -

HTML을 제대로 사용하기

- -

Netscape Gecko 브라우저에서 object 요소나 embed 요소를 사용하면 플러그인을 불러낼 수 있습니다. object 요소는 W3C HTML 4 표준에 포함된 반면 embed 요소는 사용하지 않기를 권장하는 요소입니다. 플러그인을 불러올 때 올바른 마크업 사용하기(Using the Right Markup to Invoke Plugins)에서 관련된 논의를 볼 수 있습니다. 그러나 FSCommand를 이용해서 HTML 페이지에 포함된 JavaScript 함수를 실행하려면 embed 요소를 써야 합니다.

- -

JavaScript에서 Flash에 접근하기

- -

아래에 있는 간단한 예제는 HTML 텍스트 상자에 입력한 내용을 Flash 애니메이션(아래의 회색 텍스트 상자)으로 전달하는 방법을 보여줍니다.

- -

예제 2: JavaScript to Flash Communication

- -

참고: 사용자가 컴퓨터 한 대에 Mozilla 기반 브라우저를 여러 개 설치했다면, JavaScript에서 Flash로의 통신 방법은 버전 8보다 이전에 나온 Flash Player에서는 동작하지 않을 수도 있습니다. (see {{ Bug(284057) }} and {{ Bug(233533) }})

- -

아래에 있는 HTML 텍스트 상자에 아무 텍스트나 넣은 다음 텍스트 상자 밖을 마우스로 클릭하거나 엔터키를 누르면 입력한 텍스트가 Flash로 전달됩니다.

- -
The example is missing.
-
- -

예제 2에서는 Macromedia Flash에 미리 정의된 SetVariable 메소드를 사용했습니다. 일반적으로 Netscape Gecko 브라우저에서 Macromedia에서 Flash에 미리 정의해 놓은 메소드를 호출하려면,

- - - -
<object id="myFlash" ..... >
-<param name="movie" value="somefile.swf" />
-
-....
-
-var myFlash = document.getElementById("myFlash").SetVariable("myVar", sendText);
-
- -


- 예제 2가 어떻게 만들어졌는지 보여주는 더 확장된 코드는 이 파일에서 볼 수 있습니다.

- -

FSCommand: Flash에서 JavaScript에 접근하기

- -

참고: 사용자가 컴퓨터 한 대에 Mozilla 기반 브라우저를 여러 개 설치했다면, 버전 8보다 이전에 나온 Flash Player에서는 FSCommand가 동작하지 않을 수도 있습니다. (see {{ Bug(284057) }} and {{ Bug(233533) }})

- -

예제 2에서, 플러그인을 생성한 HTML(object 요소 또는 embed 요소)의 핸들을 JavaScript 함수에서 일단 얻었습니다. 그 후에 핸들을 이용해서 Flash 플러그인에서 공개된 메소드를 호출했습니다. FSCommand를 이용하면 Macrodedia ActionScript 언어에서 Flash 애니메이션을 포함하는 환경(HTML 페이지 등)에 콜백을 보낼 수 있습니다. 다음의 예제에서 두 가지 통신 방법이 실제로 동작하는 모습을 볼 수 있습니다.

- -

예제 3: JavaScript에서 Flash로 통신 방법과 FSCommand -- Flash에서 JavaScript로 통신 방법

- -
The example is missing.
-
- -

예제 3에서는 HTML 버튼을 클릭하면 Flash 애니메이션에 있는 공이 움직입니다. 이것은 JavaScript에서 Flash로의 통신을 보여주는 것입니다. HTML 버튼을 클릭하면 JavaScript 이벤트가 발생하고 그 이벤트가 Flash 애니메이션을 움직이게 합니다. 더 아래쪽에서, 색이 칠해진 탭을 클릭하면 HTML 페이지의 전체 색깔이 바뀝니다. 이것은 반대 방향으로의 통신 즉, Flash 애니메이션이 자신을 포함하고 있는 HTML 페이지에 뭔가 영향을 준다는 것을 보여줍니다.

- -

예제 3에서 FSCommand의 사용법을 볼 수 있습니다. Netscape Gecko 브라우저에서 Flash 애니메이션을 HTML 페이지에 포함시키고 FSCommand를 사용하려고 한다면, 반드시 embed 요소를 사용해야만 합니다. IE도 지원하려면 object 요소 안에 embed 요소를 포함시킬 수 있습니다. 앞으로 나올 Flash 플러그인은 Netscape Gecko 브라우저에서도 object 요소와 함께 FSCommand를 사용할 수 있게 될 수도 있습니다. 이 문제는 Mozilla 프로젝트의 {{bug(184722) }}에 관리중입니다.

- -

Flash 애니메이션 안에서 색깔을 클릭하면 전체 페이지의 배경색이 토글됩니다. 클릭을 하면 Flash를 포함하는 외부 환경(즉 HTML 페이지)에 콜백을 보내게 되고, 콜백을 처리할 JavaScript 메소드를 찾게 됩니다. Flash 애니메이션의 ActionScript 함수를 호출함으로써 콜백을 보내는 것입니다. 이 콜백을 처리할 JavaScript 함수 이름은 Flash 플러그인이 찾을 수 있는 특별한 이름을 가져야 합니다. embed요소의 이름에 밑줄("_")과 "DoFSCommand"라는 문자열을 붙인 함수 이름이 바로 그것입니다. 예제 3에서 사용된 기법을 보여주는 간단한 코드가 아래에 있습니다.

- -
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
-codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
-id="myFlash" width="250" height="150" VIEWASTEXT>
-
- <param name="movie" value="js2flash.swf" />
- <param name="quality" value="high"></param>
-
-  <embed src="js2flash.swf" width="250" height="150" swLiveConnect="true"
-  quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer"
-  type="application/x-shockwave-flash" name="myFlash">
-  </embed>
-
-</object>
- .....
-
-function myFlash_DoFSCommand(command, args)
-{
-	// Flash 애니메이션에 여러분이 만들어놓은 모든 콜백을 처리합니다
-	// Flash 플러그인이 command와 args에 값을 전달해 줄 것입니다.
-	// Flash 애니메이션이 보내는 모든 정보를 처리하는 함수가 바로 이 함수입니다
-	// FSCommand만 있으면 ActionScript가 JavaScript와 통신할 수 있습니다!
-}
-
- -

위의 코드에서, Flash에서 보낸 것을 처리하는 JavaScript 함수는 embed 요소의 name 속성에 "_DoFSCommand" 문자열을 덧붙여서 만든 이름을 가지고 있습니다. 이 예제의 전체 소스는 flash-to-js.html에서 볼 수 있습니다. Macromedia ActionScript 사전을 보면 Flash 애니메이션 코드에서 FSCommand를 사용할 때 참고할 만한 내용이 있습니다.

- -

Additional References

- -

Macromedia Flash Developer Documentation

- - - -

MDC Resources

- - - -

Notable Bugs

- - diff --git a/files/ko/mozilla/add-ons/plugins/reference/index.html b/files/ko/mozilla/add-ons/plugins/reference/index.html deleted file mode 100644 index fcb2ba7232..0000000000 --- a/files/ko/mozilla/add-ons/plugins/reference/index.html +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: NPAPI plugin reference -slug: Mozilla/Add-ons/Plugins/Reference -tags: - - Deprecated - - Landing - - NPAPI - - NeedsTranslation - - Plugins - - Reference - - TopicStub -translation_of: Archive/Plugins/Reference ---- -

{{deprecated_header}}

-

The articles below describe each of the APIs related to NPAPI plugins.

-

{{LandingPageListSubpages}}

diff --git a/files/ko/mozilla/add-ons/plugins/reference/np_getmimedescription/index.html b/files/ko/mozilla/add-ons/plugins/reference/np_getmimedescription/index.html deleted file mode 100644 index ca0c233725..0000000000 --- a/files/ko/mozilla/add-ons/plugins/reference/np_getmimedescription/index.html +++ /dev/null @@ -1,38 +0,0 @@ ---- -title: NP GetMIMEDescription -slug: Mozilla/Add-ons/Plugins/Reference/NP_GetMIMEDescription -translation_of: Archive/Plugins/Reference/NP_GetMIMEDescription ---- -

NP_GetMIMEDescription 플러그인이 지원하는 MIME Type 목록을 리턴합니다. Unix (Linux) 와 MacOS 에서 동작합니다. Windows에서는 지원하는 mimetype을 dll 리소스 파일에 정의하여야합니다.

-

각각의 MIME type에 대한 서술은 세미콜론(;)으로 구분되어야 합니다.
- 각각의 Mime type에 대한 서술은 Mime type, 확장목록 그리고 간략한 설명을 포함합니다.

-

하나의 MIME type 를 사용한 경우

-
// example inside http://mxr.mozilla.org/mozilla-central/source/modules/plugin/sdk/samples/basic/unix/plugin.cpp
-#define MIME_TYPE_DESCRIPTION "application/basic-plugin:bsp:Basic Example Plug-in for Mozilla"
-const char* NP_GetMIMEDescription(void)
-{
-  return(MIME_TYPES_DESCRIPTION);
-}
-

둘의 MIME type 를 사용한 경우

-
const char* NP_GetMIMEDescription(void)
-{
-  return "application/basic-example-plugin:xmp1:Example 1;application/basic-example2-plugin:xmp2, xm2p:Example 2";
-}
-

Gnome Integration

-

GNOME VFS (gnome-vfs-2.0)를 사용하는 경우라면, 아래 함수를 이용하여 MIME type description 을 얻을수 있습니다.

-
#include <libgnomevfs/gnome-vfs-mime-handlers.h>
-#include <libgnomevfs/gnome-vfs-mime-info.h>
-#include <libgnomevfs/gnome-vfs-utils.h>
-
-// const char* gnome_vfs_mime_get_description (const char *mime_type);
-const char* desc = gnome_vfs_mime_get_description ("audio/ogg");
-

If you use GNOME GIO (gio-2.0), you can get the MIME type description too.

-
#include <gio/gio.h>
-const char* desc = g_content_type_get_description("audio/ogg");
-

JavaScript

-

아래 코드를 이용하여 웹 페이지 내에서, MIME Type에 대한 정보를 얻을 수 있습니다.

-
var mimetype = navigator.mimeTypes['application/basic-example-plugin'];
-if (mimetype) {
-  alert(mimetype.type + ':' + mimetype.suffixes + ':' + mimetype.description);
-}
-
diff --git a/files/ko/mozilla/add-ons/plugins/reference/npn_posturlnotify/index.html b/files/ko/mozilla/add-ons/plugins/reference/npn_posturlnotify/index.html deleted file mode 100644 index c60a613113..0000000000 --- a/files/ko/mozilla/add-ons/plugins/reference/npn_posturlnotify/index.html +++ /dev/null @@ -1,76 +0,0 @@ ---- -title: NPN_PostURLNotify -slug: Mozilla/Add-ons/Plugins/Reference/NPN_PostURLNotify -translation_of: Archive/Plugins/Reference/NPN_PostURLNotify ---- -

« Gecko Plugin API Reference « Plug-in Side Plug-in API - - -

개요

- -

지정한 URL로 POST 호출하고, 결과 알림을 받는다.

- -

문법

- -
#include <npapi.h>
-
-NPError NPN_PostURLNotify(NPP         instance,
-                          const char* url,
-                          const char* target,
-                          uint32      len,
-                          const char* buf,
-                          NPBool      file,
-                          void*       notifyData);
-
- -

파라메터

- -

함수는 다음과 같은 파라메터를 입력받는다:

- -
-
instance
-
현재 플러그인 인스턴스, specified by the plug-in.
-
url
-
POST 호출할 URL, 플러그인.
-
target
-
대상 윈도우, specified by the plug-in. 자세한 설명은 NPN_GetURL을 보라.
-
len
-
buf의 길이.
-
buf
-
로컬 임시 파일 경로, 또는 POST로 전송할 데이터 버퍼.
-
file
-
파일을 POST로 전송할지 여부: -
    -
  • true: buf에 지정된 로컬 파일을 전송하고, 완료되면 파일은 삭제한다.
  • -
  • false: buf에 있는 데이터를 직접 전송한다.
  • -
-
-
notifydata
-
POST 요청을 식별하기 위한 값. NPP_URLNotify의 호출에 의해 이 값이 전달된다. (아래 설명을 보라).
-
- -

반환값

- - - -

설명

- -

NPN_PostURLNotify 함수는 NPN_PostURL와 거의 같지만, 다음과 같은 차이가 있다:

- - - -

NPN_PostURLNotify는 비동기로 동작한다: 함수는 바로 리턴되고, 요청이 처리되면 NPP_URLNotify를 호출한다.

- -

If this function is called with a target parameter value of _self or a parent to _self, this function should return an INVALID_PARAM NPError. This is the only way to notify the plug-in once it is deleted. See NPN_GetURL for information about this parameter.

- -

참고

- - diff --git a/files/ko/mozilla/add-ons/setting_up_extension_development_environment/index.html b/files/ko/mozilla/add-ons/setting_up_extension_development_environment/index.html deleted file mode 100644 index 4d42077d04..0000000000 --- a/files/ko/mozilla/add-ons/setting_up_extension_development_environment/index.html +++ /dev/null @@ -1,89 +0,0 @@ ---- -title: 확장기능 개발 환경 구축 -slug: Mozilla/Add-ons/Setting_up_extension_development_environment -translation_of: Archive/Add-ons/Setting_up_extension_development_environment ---- -

이 글에는 확장기능 개발을 위한 Mozilla 응용프로그램 설정 방법을 제공합니다. 특별한 지정하지 않는 한 이 방법들은 Firefox와 Thunderbird 뿐만 아니라 SeaMonkey 버전 2.0 이상에서도 적용가능합니다.

-

개요

- -

개발용 프로필

-

개발 단계에서 성능저하를 방지하려면 환경 설정 및 확장과 관련된 개인 데이터의 손실을 피하기 위해 개발 작업을 위한 별도의 프로필을 사용 할 수 있습니다.

-

별도의 프로필과 -no-remote 매개 변수와 함께 응용 프로그램을 구동하여 같은 시간에 Thunderbird 또는 Firefox 의 두 개의 인스턴스를 실행 할 수 있습니다.

-

우분투:

-
/usr/bin/firefox -no-remote -P dev
-

다른 리눅스 배포판:

-
/usr/local/bin/firefox -no-remote -P dev
-
-

맥킨토시:

-
/Applications/Firefox.app/Contents/MacOS/firefox-bin -no-remote -P dev &
-
-

윈도우즈:

-
시작 -> 실행 "%ProgramFiles%\Mozilla Firefox\firefox.exe" -no-remote -P dev
-
-

Firefox 대신에 Thunderbird 또는 SeaMonkey를 시작 하려면 , 위의 예제에서 "firefox" 대신 "thunderbird" 또는 "seamonkey" 으로 대체합니다.

-

프로필 지정이 존재 하지 않는 경우 (또는 프로필을 지정 안하는 경우), Thunderbird 또는 Firefox 프로필 관리자가 표시됩니다. 기본 프로필로 실행 하기위해 프로필을 "default"로 지정합니다. (또는 "-P 를 생략합니다.).

-

(There is a thread in the Mozillazine forums that explains how to use both stable and development versions of Firefox to check extension compatibility. See Installing Firefox 3 or Minefield while keeping Firefox 2.)

-

개발용 설정

-

There is a set of development preferences that, when enabled, allows you to view more information about application activity, thus making debugging easier. However,  these preferences can degrade performance, so you may want to use a separate development profile when you enable these preferences. For more information about Mozilla preferences, refer to the mozillaZine article on "about:config".

-

Not all preferences are defined by default, and are therefore not listed in about:config by default. You will have to create new (boolean) entries for them.

- -

Accessing Firefox development preferences

-

To change preference settings in Firefox or SeaMonkey, type about:config in the Location Bar. Alternatively, use the Extension Developer's Extension, which provides a menu interface for Firefox settings.

-

Accessing Thunderbird development preferences

-

To change preference settings in Thunderbird, open the "Preferences" (Unix) or "Options" (Windows) interface. On the "Advanced" page, select the "General" tab then click the "Config Editor" button.

-

개발에 도움되는 확장 기능

-

이 확장 기능들이 당신이 개발을 할때 도움을 줄 수 있습니다.

- -

 

-

Firefox extension proxy file

-

Extension files are normally installed in the user profile. However, it is usually easier to place extension files in a temporary location, which also  protects source files from accidental deletion. This section explains how to create a proxy file that points to an extension that is installed in a location other than the user profile.

-
    -
  1. Get the extension ID from the extension's install.rdf file.
  2. -
  3. Create a file in the "extensions" directory under your profile directory with the extension's ID as the file name (for example "your_profile_directory/extensions/{46D1B3C0-DB7A-4b1a-863A-6EE6F77ECB58}"). (How to find your profile directory) Alternatively, rather than using a GUID, create a unique ID using the format "name@youremail" (for example chromebug@mydomain.com).
  4. -
  5. The contents of this file should be the path to the directory that contains your install.rdf file. (eg. "/full/path/to/yourExtension/". Windows users should use the drive name (CAPS) and backslashes instead of frontslashes (for example "C:\full\path\to\yourExtension\" or "C:\sam\workspace\toolbar\helloWorldtoolbar\").Remember to include the closing slash and remove any trailing whitespace. -
      -
    • In Firefox 3, if you already installed the extension via XPI, you might need to install one or all of the extensions.* files in the profile folder. Backup first, but these files will be regenerated. (I don't know what the original author had in mind here, but the files extensions.cache, extensions.ini, extensions.rdf, compreg.dat, and xpti.dat are all regenerated by Firefox if deleted. You need to delete them if you mess with 'components', no harm done. Firefox will disconnect from its parent process when it regens these files, so you may have to exit once and restart if you use the OS console.)
    • -
    -
  6. -
  7. Place the file in the extensions folder of your profile and restart the application.
  8. -
-

Using directories rather than JARs

-

Regardless of whether you choose to eventually package your extension's chrome in a JAR or in directories, developing in directories is simpler. If you choose a JARed structure for releasing, you can still develop with a directory structure by editing your chrome.manifest. For example, rather than having

-
content	myExtension	jar:chrome/myExtension.jar!/content/
-
-

use

-
content	myExtension	chrome/content/
-
diff --git a/files/ko/mozilla/add-ons/themes/index.html b/files/ko/mozilla/add-ons/themes/index.html deleted file mode 100644 index 58c574d51f..0000000000 --- a/files/ko/mozilla/add-ons/themes/index.html +++ /dev/null @@ -1,64 +0,0 @@ ---- -title: Themes -slug: Mozilla/Add-ons/Themes -tags: - - Add-ons - - Look & Feel - - NeedsTranslation - - Themes - - TopicStub -translation_of: Mozilla/Add-ons/Themes ---- -

Themes are skins for different Mozilla applications. They allow you to change the look and feel of the user interface and personalize it to your tastes. A theme can simply change the colors of the UI or it can change every piece of its appearance. The Theme documentation here is out of date, but we're hoping to get some help to update it soon.

-
-
-

Documentation

-
-
- Building a Theme
-
- A tutorial for building a simple theme in Firefox.
-
- Common Theme Issues and Their Solutions
-
- Common issues seen when AMO editors review themes and how to fix them.
-
- Lightweight themes
-
- Building lightweight themes for Firefox
-
- Creating a Skin for SeaMonkey 2
-
- An introduction to creating new themes for SeaMonkey 2.
-
- Making Sure Your Theme Works with RTL Locales
-
- How to make sure your theme will look right with Hebrew, Arabic, Persian and Urdu locales.
-
- Theme Packaging
-
- How to package themes for Firefox and Thunderbird.
-
- Yet Another Theme Tutorial
-
- Another tutorial in Mozilla theme construction.
-
- Obsolete docs
-
- These docs are very old and will never be updated, but we've kept them in case the are useful source material for people updating the Theme documentation.
-
-
-
-

Getting help

- -

Tools

- -
-
-

 

diff --git a/files/ko/mozilla/add-ons/themes/obsolete/creating_a_skin_for_firefox/contents.rdf/index.html b/files/ko/mozilla/add-ons/themes/obsolete/creating_a_skin_for_firefox/contents.rdf/index.html deleted file mode 100644 index a5cb662916..0000000000 --- a/files/ko/mozilla/add-ons/themes/obsolete/creating_a_skin_for_firefox/contents.rdf/index.html +++ /dev/null @@ -1,44 +0,0 @@ ---- -title: contents.rdf -slug: Mozilla/Add-ons/Themes/Obsolete/Creating_a_Skin_for_Firefox/contents.rdf -translation_of: Archive/Themes/Creating_a_Skin_for_Firefox/contents.rdf ---- -

다음 내용을 복사하여 빈 텍스트 파일에 붙여넣고, "contents.rdf" 라는 이름으로 저장하세요:

-
<?xml version="1.0"?>
-
-<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
-
-  <!-- List all the skins being supplied by this theme -->
-  <RDF:Seq about="urn:mozilla:skin:root">
-    <RDF:li resource="urn:mozilla:skin:My_Theme"/>
-  </RDF:Seq>
-
-  <RDF:Description about="urn:mozilla:skin:My_Theme"
-        chrome:displayName="My Theme"
-        chrome:accessKey="N"
-        chrome:author=""
-        chrome:authorURL=""
-        chrome:description=""
-        chrome:name="My_Theme"
-        chrome:image="preview.png" >
-   <chrome:packages>
-      <RDF:Seq about="urn:mozilla:skin:My_Theme:packages">
-        <RDF:li resource="urn:mozilla:skin:My_Theme:browser"/>
-        <RDF:li resource="urn:mozilla:skin:My_Theme:communicator"/>
-        <RDF:li resource="urn:mozilla:skin:My_Theme:global"/>
-        <RDF:li resource="urn:mozilla:skin:My_Theme:mozapps"/>
-        <RDF:li resource="urn:mozilla:skin:My_Theme:help"/>
-      </RDF:Seq>
-    </chrome:packages>
-  </RDF:Description>
-
-  <!-- Version Information.  State that we work only with major version 1 of this package. -->
-  <RDF:Description chrome:skinVersion="1.5" about="urn:mozilla:skin:My_Theme:browser"/>
-  <RDF:Description chrome:skinVersion="1.5" about="urn:mozilla:skin:My_Theme:communicator"/>
-  <RDF:Description chrome:skinVersion="1.5" about="urn:mozilla:skin:My_Theme:global"/>
-  <RDF:Description chrome:skinVersion="1.5" about="urn:mozilla:skin:My_Theme:mozapps"/>
-  <RDF:Description chrome:skinVersion="1.5" about="urn:mozilla:skin:My_Theme:help"/>
-</RDF:RDF>
-
-

{{ languages( { "fr": "fr/Cr\u00e9er_un_th\u00e8me_pour_Firefox/contents.rdf" } ) }}

diff --git a/files/ko/mozilla/add-ons/themes/obsolete/creating_a_skin_for_firefox/getting_started/index.html b/files/ko/mozilla/add-ons/themes/obsolete/creating_a_skin_for_firefox/getting_started/index.html deleted file mode 100644 index 364b93fcf2..0000000000 --- a/files/ko/mozilla/add-ons/themes/obsolete/creating_a_skin_for_firefox/getting_started/index.html +++ /dev/null @@ -1,108 +0,0 @@ ---- -title: Getting Started -slug: Mozilla/Add-ons/Themes/Obsolete/Creating_a_Skin_for_Firefox/Getting_Started -translation_of: Archive/Mozilla/Creating_a_skin_for_Mozilla/Getting_Started ---- -

설정

-

최신 버전의 파이어폭스를 다운로드하여 설치하세요. DOM Inspector도 함께 설치합니다.

-

테마 압축 풀기

-

이미 기존에 파이어폭스에서 사용할 수 있도록 만들어진 어떤 테마를 살펴보더라도, 파이어폭스의 기본 테마인 Winstripe와의 일관성을 발견할 수 있다. 이 테마는 파이어폭스의 설치 디렉토리에 존재하는 <tt>classic.jar</tt> 파일 안에 들어 있다. .jar 파일은 zip과 확장자만 다르지 그 압축 구조는 같기 때문에 일반적인 zip 압축 프로그램을 사용하여 풀어볼 수 있다. 만약에 압축 프로그램에서 .jar를 지원하지 않는다면 <tt>classic.zip</tt>과 같이 파일 이름을 바꾸고 압축을 해제할 수 있다.

-
Classic.jar 의 위치 찾기
-

Linux: /usr/lib/MozillaFirefox/chrome/classic.jar

-

Windows: \Program Files\Mozilla Firefox\chrome\classic.jar

-

Mac OS X:

- -

<tt>classic.jar</tt>를 다른 쉽게 접근할 수 있는 폴더로 이동합니다. <tt>Classic</tt>를 추천합니다. 그리고 그 폴더에서 압축을 풀어 놓습니다.

-

classic.jar의 내부를 들여다봅시다

-

<tt>classic.jar</tt>의 압축을 풀어보면 <tt>skin</tt> 디렉토리와, <tt>preview.png</tt>, 그리고 <tt>icon.png</tt> 파일이 들어 있습니다.

-
-
- <tt>skin</tt>
-
- 이 디렉토리 안에는 스킨을 이용하는 모든 훌륭한 재료들을 포함하는 <tt>classic</tt> 디렉토리가 있습니다.
-
- <tt>classic</tt>
-
- <tt>classic</tt> 디렉토리는 다음과 같은 디렉토리들을 포함합니다.
-
- <tt>browser</tt>
-
- <tt>browser</tt> 디렉토리에는 툴바 아이콘들이 들어 있습니다. 북마크 관리자나 설정창에 사용되는 아이콘도 여기에 들어 있습니다.
-
- <tt>global</tt>
-
- <tt>global</tt> 디렉토리는 테마에서 특별히 중요한 부분으로, 브라우저의 외관을 설정하는 중요한 CSS 파일을 담고 있습니다.
-
- <tt>mozapps</tt>
-
- <tt>mozapps</tt> 디렉토리에는 브라우저와 확장 관리자, 업데이트 마법사를 위한 스타일 및 아이콘이 들어 있습니다.
-
- <tt>help</tt>
-
- 이 디렉토리에는 헬프 윈도우에 필요한 테마 파일들이 들어 있습니다.
-
- <tt>communicator</tt>
-
- 이 디렉토리의 내용은 사용되지 않으며 추후 삭제될 것입니다.
-
-

새로운 테마 설치하기

-

아무래도 라이브 에디트를 설정하는 것에 부분부분 어려운 점이 있다보니, 일단은 직접 파이어폭스 테마를 만들며 변화하는 모습을 지켜보기 전에 기존의 테마를 설치할 수 있는 상태로 리패키징하는 법을 먼저 배우는 것이 좋겠습니다. 이 부분에서 우리는 작업에 필요한 테마를 "My_Theme"라고 부를 것이지만, 다른 이름으로 불러도 자유입니다.

-
필요한 파일 복사하기
-

먼저 첫번째 과정은 필요한 모든 파일을 올바른 디렉토리 구조로 옮겨넣는 것입니다. <tt>My_Theme</tt>라는 이름의 디렉토리를 하나 만드세요. 이 디렉토리로 들어가 <tt>browser</tt>, <tt>global</tt>, <tt>communicator</tt>, <tt>help</tt>, 그리고 <tt>mozapps</tt>와 같은 이름의 디렉토리들을 만듭니다. <tt>classic.jar</tt> 파일을 열어 보았을 때와 같은 구조이지요, 여기에다가 <tt>icon.png</tt> 파일과 <tt>preview.png</tt> 파일을 만들어 넣습니다.

-
설치 파일 만들기
-
Contents.rdf
-

contents.rdf 파일을 <tt>\My_Theme</tt> 디렉토리에 집어넣고 텍스트 에디터를 사용하여 열어보겠습니다. 이 파일은 스킨에 대해 기술해 놓은 작은 XML 데이터베이스로 이루어져 있습니다.

-

이 파일에는 "My_Theme"의 구성 요소들을 찾아볼 수 있고, 이 내용을 새로 만드는 테마에 맞추어 이름을 바꿀 수도 있습니다.

-

패키지 섹션은 당신이 변경하는 브라우저의 컴포넌트를 목록으로 나타냅니다. 챗질라에서도 이 스킨을 사용한다면 우리는 챗질라에 맞추기 위해 몇 줄을 추가하거나 바꾸어야 할 것입니다. 그러나 지금의 목록은 우리가 변경한 모든 것을 반영하고 있으므로, 이 섹션에서 이전 것을 사용하였던 부분에 대해서면 여기서 파란 색으로 표시된 부분에 이름과 버전에 맞게 변경해주면 됩니다.

-
<RDF:li resource="urn:mozilla:skin:My_Theme:communicator"/>
-<RDF:li resource="urn:mozilla:skin:My_Theme:editor"/>
-<RDF:li resource="urn:mozilla:skin:My_Theme:global"/>
-<RDF:li resource="urn:mozilla:skin:My_Theme:messenger"/>
-<RDF:li resource="urn:mozilla:skin:My_Theme:navigator"/>
-
-

파일을 저장하고 에디터를 종료합니다.

-
install.rdf
-

install.rdf를 복사하여 My_Theme 디렉토리 안에 집어넣습니다. 그리고 이 파일을 텍스트 에디터로 열어봅니다. 이 파일은 스킨에 대해 기술해 놓은 작은 XML 데이터베이스 파일입니다.

-
  <Description about="urn:mozilla:install-manifest">
-  <em:id>{Themes_UUID}</em:id>
-  <em:version>Themes_Version</em:version>
-
-

첫 섹션은 당신의 테마를 위하여 UUID를 확립하고 버전을 부여하는 부분을 포함합니다. 이런 내용을 입력하고 스크롤을 내려봅니다. 또한 당신은 타겟 어플리케이션, 여기서는 파이어폭스가 되겠지요. 이 스킨을 사용할 수 있는 파이어폭스의 버전 범위를 명기해야 합니다. 다음과 같이 말이지요.

-
  <em:targetApplication>
-    <Description>
-      <!-- Firefox's UUID -->
-      <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
-      <em:minVersion>Min_FF_Version</em:minVersion>
-      <em:maxVersion>Max_FF_Version</em:maxVersion>
-    </Description>
-  </em:targetApplication>
-
-

위와 같은 문제들을 해결하였다면 버전으로 인하여 테마가 깨지거나 엉망이 되는 문제는 피할 수 있을 것입니다.

-

CSS 파일

-

이들 디렉토리에 들어있는 CSS 파일은 브라우저의 어느 부분에 그림을 넣고, 버튼이나 컨트롤의 테두리나 두께 등을 정의하여 어떻게 보일지를 지정하는 데 사용됩니다. 그러면 예를 들어서 표준 버튼을 한번 바꾸어 봅시다.

-

<tt>global</tt> 디렉토리로 들어가 <tt>button.css</tt> 파일을 텍스트 에디터로 열어봅시다. 스크롤바를 내려 button { 으로 시작되는 섹션을 찾아봅시다. 이 섹션은 기본 상태, 그러니까 마우스를 위로 올리거나 선택하지 않았고, 그렇다고 사용중지 상태도 아닌 일반적인 버튼의 모양을 정의하는 섹션입니다.

-

background-color: 부분에 DarkBlue를 입력하고, color: 부분에 White 라고 입력한 뒤 파일을 저장합시다. 다른 몇 가지 테스트를 더 해볼 수도 있을 것입니다.

-

JAR 파일로 리패키징하기

-

이제 다음과 같은 디렉토리 구조를 JAR 파일로 리패키징하는 일만 남았습니다. 좋아하는 압축 프로그램을 사용하여 다음 구조를 zip으로 압축합시다:

-
/browser/*
-/communicator/*
-/global/*
-/help/*
-/mozapps/*
-/contents.rdf
-/install.rdf
-/icon.png
-/preview.png
-  
-

이 상태로 그냥 묶는 것이 아니라, 이 구조가 들어있는 부모 디렉토리인 <tt>My_Theme</tt>째 묶어야 설치할 때 에러 메시지를 보지 않을 수 있을 것입니다.

-

웹에서 바로 설치할 수 있도록 만들려면

-

일단 JAR 파일을 웹에 올리고, 클릭하면 바로 설치할 수 있도록 만들기 위해 자바스크립트 하나를 살펴보겠습니다.

-
<a href='javascript:InstallTrigger.installChrome(InstallTrigger.SKIN,
- "myskin.jar", "My Skin Theme")'>누르면 스킨이 설치됩니다</a>
-
-

하드 디스크에 JAR 형태로 존재하는 스킨 파일을 설치하려면 웹 인스톨러 를 사용하여 해당 파일을 업로드하고 바로 실치할 수 있습니다. 혹은 모질라에서 테마 윈도우를 띄우고 .jar 파일을 끌어당겨 놓을 수도 있습니다.

-

{{ languages( { "es": "es/Creando_un_skin_para_Firefox/Como_empezar", "fr": "fr/Cr\u00e9er_un_th\u00e8me_pour_Firefox/Premiers_pas" } ) }}

diff --git a/files/ko/mozilla/add-ons/themes/obsolete/creating_a_skin_for_firefox/index.html b/files/ko/mozilla/add-ons/themes/obsolete/creating_a_skin_for_firefox/index.html deleted file mode 100644 index 469fd9043b..0000000000 --- a/files/ko/mozilla/add-ons/themes/obsolete/creating_a_skin_for_firefox/index.html +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: Creating a Skin for Firefox -slug: Mozilla/Add-ons/Themes/Obsolete/Creating_a_Skin_for_Firefox -tags: - - Add-ons - - Themes -translation_of: Archive/Themes/Creating_a_Skin_for_Firefox ---- -

들어가며

-

파이어폭스에서 사용할 스킨을 만들 때는 이미지 편집과 압축 해제, 그리고 CSS 수정에 대해 알고 있어야 합니다. 파이어폭스는 표준 GIF와 PNG, 그리고 JPEG 이미지 포맷을 버튼에 사용하며, 인터페이스의 스타일을 만들기 위해 CSS를 사용합니다.

-

그러면 스킨이 뭔데?

-

스킨이란 전체적인 인터페이스를 바꾸는 것은 아닙니다. 대신 스킨은 인터페이스가 어떻게 보여질지를 정의해주지요. 이미지를 마우스 오른쪽 버튼으로 클릭했을 때 일어나는 일을 바꿀 수는 없지만, 마우스 오른쪽 버튼을 눌렀을 때 보이는 메뉴의 모습은 바꿀 수 있습니다. 예를 들어 파란 바탕에 분홍색 땡땡이 무늬로 바꿀 수도 있겠지요. 파이어폭스의 기능 자체를 바꾸고 싶다면 Chrome을 직접 수정하실 수 있지만, 그에 대한 설명은 이 문서의 범위를 넘어가는 것입니다.

-

시작하기

- -
-
-

Original Document Information

- -
-

{{ languages( { "fr": "fr/Cr\u00e9er_un_th\u00e8me_pour_Firefox", "pl": "pl/Tworzenie_sk\u00f3rek_dla_Firefoksa" } ) }}

diff --git a/files/ko/mozilla/add-ons/themes/obsolete/creating_a_skin_for_firefox/install.rdf/index.html b/files/ko/mozilla/add-ons/themes/obsolete/creating_a_skin_for_firefox/install.rdf/index.html deleted file mode 100644 index f5add06153..0000000000 --- a/files/ko/mozilla/add-ons/themes/obsolete/creating_a_skin_for_firefox/install.rdf/index.html +++ /dev/null @@ -1,44 +0,0 @@ ---- -title: install.rdf -slug: Mozilla/Add-ons/Themes/Obsolete/Creating_a_Skin_for_Firefox/install.rdf -translation_of: Archive/Themes/Creating_a_Skin_for_Firefox/install.rdf ---- -

다음 내용을 복사하여 빈 텍스트파일에 붙여넣고 "install.rdf"라는 이름으로 저장하세요:

-
<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <Description about="urn:mozilla:install-manifest">
-  <em:id>{Themes_UUID}</em:id>
-    <em:version>Themes_Version</em:version>
-
-<!-- Target Application this extension can install into,
-         with minimum and maximum supported versions. -->
-
-<em:targetApplication>
-    <Description>
-      <!-- Firefox's UUID -->
-      <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
-      <em:minVersion>Min_FF_Version</em:minVersion>
-      <em:maxVersion>Max_FF_Version</em:maxVersion>
-    </Description>
-  </em:targetApplication>
-
-  <!-- Front End MetaData -->
-  <!-- My_Theme -->
-  <em:name>My_Theme</em:name>
-  <em:description>My_Theme</em:description>
-  <em:creator>Your_Name</em:creator>
-  <em:contributor>Contributors_Names</em:contributor>
-  <em:homepageURL>Themes_HomePage</em:homepageURL>
-  <em:updateURL> Url_of_Update_Location </em:updateURL>
-  <em:aboutURL> Url_of_About_Page </em:aboutURL>
-
-  <!-- Front End Integration Hooks (used by Theme Manager)-->
-    <em:internalName>My_Theme</em:internalName>
-  </Description>
-
-</RDF>
-
-

{{ languages( { "fr": "fr/Cr\u00e9er_un_th\u00e8me_pour_Firefox/install.rdf" } ) }}

diff --git a/files/ko/mozilla/add-ons/themes/obsolete/creating_a_skin_for_firefox/uuid/index.html b/files/ko/mozilla/add-ons/themes/obsolete/creating_a_skin_for_firefox/uuid/index.html deleted file mode 100644 index db90531d45..0000000000 --- a/files/ko/mozilla/add-ons/themes/obsolete/creating_a_skin_for_firefox/uuid/index.html +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: UUID -slug: Mozilla/Add-ons/Themes/Obsolete/Creating_a_Skin_for_Firefox/UUID -translation_of: Archive/Themes/Creating_a_Skin_for_Firefox/UUID ---- -

UUID: Universal Unique Identifier

-

A UUID can be obtained by visiting http://www.famkruithof.net/uuid/uuidgen or by typing "firebot: uuid?" on irc.mozilla.org.

-

See Also

-

Generating_GUIDs

-

{{ languages( { "fr": "fr/Cr\u00e9er_un_th\u00e8me_pour_Firefox/UUID" } ) }}

diff --git a/files/ko/mozilla/add-ons/themes/obsolete/index.html b/files/ko/mozilla/add-ons/themes/obsolete/index.html deleted file mode 100644 index d420b6ebf0..0000000000 --- a/files/ko/mozilla/add-ons/themes/obsolete/index.html +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: Obsolete -slug: Mozilla/Add-ons/Themes/Obsolete -tags: - - NeedsTranslation - - TopicStub -translation_of: Mozilla/Add-ons/Themes/Obsolete ---- -

This page collects theme docs that we don't expect will ever be updated, but which we're keeping for the time being as potential source material for updated docs.

-

{{ ListSubPages ("/en-US/Add-ons/Themes/Obsolete", 5) }}

diff --git a/files/ko/mozilla/firefox/developer_edition/index.html b/files/ko/mozilla/firefox/developer_edition/index.html deleted file mode 100644 index 5303ed6630..0000000000 --- a/files/ko/mozilla/firefox/developer_edition/index.html +++ /dev/null @@ -1,56 +0,0 @@ ---- -title: Developer Edition -slug: Mozilla/Firefox/Developer_Edition -tags: - - 초보자 - - 파이어폭스 -translation_of: Mozilla/Firefox/Developer_Edition ---- -

웹 개발자들을 위한 Firefox입니다.

- -

 Firefox 개발자 에디션 내려받기

- -
-
-
-

최신 파이어폭스 기능

- -

파이어폭스 개발자 에디션은 Firefox Release Process의 오로라 채널을 대채합니다. 오로라 채널처럼, 개발자 에디션에서도 6개월에 한번씩 새 기능이 업데이트 됩니다.물론, Nightly 빌드에서 검증된 상태로 말이죠.

- -

개발자 에디션을 사용하면, 여러분은 도구와 플랫폼에 대한 엑세스를 Firefox 릴리즈 보다 적어도 12주 전에 체험할 수 있습니다.

- -

어떤 기능이 새로 생겼는지 알아보세요.

-
- -
-

새로운 테마

- -

이 테마는 개발자 도구에 더 쉽게 접근할 수 있도록 돕습니다.

- -

시험적인 개발자 도구

- -

저희는 여러가지 릴리즈에 포함되지 않은 시험적인 개발자 도구들을 포함하고 있습니다.

- -

예를 들어, 파이어폭스 개발자 에디션은 Valence add-on과, Firefox developer tools를 다른 브라우저에서 연결할 수 있는 도구를 제공합니다.

-
-
- -
-
-

다중 프로필

- -

파이어폭스 개발자 에디션은 다중 프로필을 사용할 수 있습니다. 이는 설치된 다른 파이어폭스 버전과 바꿀 수 있는 것입니다. 이 의미는 굳이 따로 Firefox Beta를 실행시키지 않고도 개발자 에디션을 통해 사용할 수 있다는 것입니다.

- -
-

노트: 개발자 에디션을 처음 시작하게 되면, 커스트마이징되지않은 웹 브라우저를 보실겁니다.애드온, 즐겨찾기, 검색기록 없이 말이죠. 당신은 파이어폭스 동기화를 사용하여 다른 에디션과 동기화 할 수 있습니다.

-
-
- -
-

웹 개발자들을 위한 맞춤 설정

- -

저희는 웹 개발자들을 위해 몇가지 설정을 해 두었습니다. 예를 들면, 크롬과 원격 디버깅이 기본적으로 활성화 되어있습니다.

-
-
- -

 

diff --git a/files/ko/mozilla/firefox/headless_mode/index.html b/files/ko/mozilla/firefox/headless_mode/index.html deleted file mode 100644 index 899740e0af..0000000000 --- a/files/ko/mozilla/firefox/headless_mode/index.html +++ /dev/null @@ -1,204 +0,0 @@ ---- -title: Headless mode -slug: Mozilla/Firefox/Headless_mode -tags: - - QA - - node.js - - 모질라 - - 자동화 - - 테스트 - - 테스팅 - - 헤드리스 - - 헤드리스 모드 -translation_of: Mozilla/Firefox/Headless_mode ---- -

Headless mode는 Firefox를 실행시키기 위한 유용한 방법입니다, 즉 UI컴포넌트가 보이지 않더라도 Firefox는 정상적으로 움직인다는 것입니다. 웹서핑하기에는 불편할 지라도 테스트를 자동화하기에는 매우 유용합니다. 이 글은 Headless Firefox 실행을 위해 알아야할 모든 것을 제공합니다.

- -

headless mode를 사용하기

- -

-headless flag를 붙이는 것만으로 코맨드라인에서 headless mode를 실행할 수 있습니다.

- -
/path/to/firefox -headless
- -

지금은 심플하게 되어있습니다만 앞으로 옵션을 추가할 예정입니다. 

- -

하나의 예를 들자면, headless Firefox를 이용해서 간단하게 스크린샷을 찍을 수 있는 -screenshot 옵션을 작업하고 있습니다.  현재 진행사항은 여기서 {{bug(1378010)}} 볼 수 있습니다.

- -

Browser support

- -

Headless Firefox는 리눅스에서는 Firefox55이상, 윈도우즈와 맥에서는 Firefox56이상의 버전에서 지원하고 있습니다.

- -

headless mode를 이용한 테스트 자동화

- -

headless Firefox를 이용하는 가장 유용한 방법은 자동화된 테스트와 함께 이용하는 것입니다. 즉,테스트의 과정을 더욱 더 효율적으로 만들어 낼 수 있다는 것입니다. 

- -

Selenium in Node.js

- -

여기서는 Node.js 와 selenium-webdriver 패키지를 이용해서 Selenium테스트를 만들어 볼 것입니다. 이 가이드는 Selenium, Webdriver 그리고 Node에 대한 기본적인 지식과 테스팅 환경 설정이 완료되어 있다는 가정하에 쓰여져 있습니다. 그렇지 않다면 Setting up Selenium in Node 를 먼저 보시고 난 후에 본 가이드를 이용하실 것을 권장합니다.

- -

먼저 Node와 selenium-webdriver패키지가 설치되어 있는지 확인합니다. 그리고 selenium-test.js라는 파일을 만들어서 불러옵니다. 그런 후 아래의 내용을 단계별로 진행합니다.

- -
-

Note: 다른 방법으로는 headless-examples repo;가 이용 가능합니다.
- npm install을 이용하는 것만으로 필요한 라이브러리를 설치해 포함시킬수 있습니다.

-
- -
    -
  1. -

    selenium-webdriver module과 firefox submodule을 불러오는 로직을 추가합니다.

    - -
    var webdriver = require('selenium-webdriver'),
    -    By = webdriver.By,
    -    until = webdriver.until;
    -
    -var firefox = require('selenium-webdriver/firefox');
    -
  2. -
  3. -

    다음으로, Firefox Nightly를 설정한 binary objecet를 작성합니다. 그리고 argument를 -headless로 해서 추가하면 headless mode를 실행시키기 위한 준비가 완료됩니다. 

    - -
    var binary = new firefox.Binary(firefox.Channel.NIGHTLY);
    -binary.addArguments("-headless");
    -
  4. -
  5. -

    Firefox용으로 웹드라이버 인스탄스를 작성합니다. 그리고 setFirefoxOptions() 를 이용해서 작성해둔 바이너리를 설정합니다. ( 이 작업은 리눅스와 윈도우즈와 맥에서 headless mode가 릴리즈 되면 불필요합니다. 하지만 Nightly-specific feature에서 테스트하기를 원한다면 유용합니다 )

    - -
    var driver = new webdriver.Builder()
    -    .forBrowser('firefox')
    -    .setFirefoxOptions(new firefox.Options().setBinary(binary))
    -    .build();
    -
  6. -
  7. -

    구글 검색페이지를 이용하는 간단한 테스트를 수행하는 코드를 추가합니다.

    - -
    driver.get('https://www.google.com');
    -driver.findElement(By.name('q')).sendKeys('webdriver');
    -
    -driver.sleep(1000).then(function() {
    -  driver.findElement(By.name('q')).sendKeys(webdriver.Key.TAB);
    -});
    -
    -driver.findElement(By.name('btnK')).click();
    -
    -driver.sleep(2000).then(function() {
    -  driver.getTitle().then(function(title) {
    -    if(title === 'webdriver - Google Search') {
    -      console.log('Test passed');
    -    } else {
    -      console.log('Test failed');
    -    }
    -  });
    -});
    -
    -driver.quit();
    -
  8. -
  9. -

    마지막으로 아래의 명령어와 함께 테스트를 실행해주세요.

    - -
    node selenium-test
    -
  10. -
- -

몇 초 후 콘솔에서 "Test passed"를 보게될 겁니다.  이게 다입니다! 

- -

headless mode를 이용한 Node.js Selenium tests에 관한 유용한 팁이나 트릭은 이 글 (Headless Firefox in Node.js with selenium-webdriver by Myk Melez) 을 참고해주세요.

- -

Selenium in Java

- -
-

Note: Thanks a lot to nicholasdipiazza for writing these instructions!

-
- -

 Gradle projects를 지원하는 IDE를 사용하고 있고 Setting up Selenium in Node 가이드에 설명되어진대로 Geckodriver가 설치되어져 있다는 가정하에 쓰여져 있습니다.

- -
    -
  1. -

    headlessfirefox-gradle.zip 를 다운로드합니다. (see the source here), 압축을 풉니다, 그리고 headlessfirefox폴더를 IED에 gradle project로 Import합니다.

    -
  2. -
  3. -

    build.gradle파일에 selenium을 설정합니다. 필요에 따라 다른 버전을 이용하셔도 상관없습니다. 이번 글에서는 3.5.3을 이용합니다. 

    - -
    group 'com.mozilla'
    -version '1.0'
    -
    -apply plugin: 'java'
    -
    -sourceCompatibility = 1.8
    -
    -repositories {
    -   mavenCentral()
    -}
    -
    -dependencies {
    -   compile('org.seleniumhq.selenium:selenium-api:3.5.3')
    -   compile('org.seleniumhq.selenium:selenium-remote-driver:3.5.3')
    -   compile('org.seleniumhq.selenium:selenium-server:3.5.3')
    -
    -   testCompile group: 'junit', name: 'junit', version: '4.12'
    -}
    -
  4. -
  5. -

    geckodriver를 설치한 경로와 같은 곳에 있는 HeadlessFirefoxSeleniumExample.java 파일에서 webdriver.gecko.driver property를 수정합니다. (see line 15 below).

    - -
    package com.mozilla.example;
    -
    -import org.openqa.selenium.By;
    -import org.openqa.selenium.WebElement;
    -import org.openqa.selenium.firefox.FirefoxBinary;
    -import org.openqa.selenium.firefox.FirefoxDriver;
    -import org.openqa.selenium.firefox.FirefoxOptions;
    -
    -import java.util.concurrent.TimeUnit;
    -
    -public class HeadlessFirefoxSeleniumExample {
    - public static void main(String [] args) {
    -   FirefoxBinary firefoxBinary = new FirefoxBinary();
    -   firefoxBinary.addCommandLineOptions("--headless");
    -   System.setProperty("webdriver.gecko.driver", "/opt/geckodriver");
    -   FirefoxOptions firefoxOptions = new FirefoxOptions();
    -   firefoxOptions.setBinary(firefoxBinary);
    -   FirefoxDriver driver = new FirefoxDriver(firefoxOptions);
    -   try {
    -     driver.get("http://www.google.com");
    -     driver.manage().timeouts().implicitlyWait(4,
    -         TimeUnit.SECONDS);
    -     WebElement queryBox = driver.findElement(By.name("q"));
    -     queryBox.sendKeys("headless firefox");
    -     WebElement searchBtn = driver.findElement(By.name("btnK"));
    -     searchBtn.click();
    -     WebElement iresDiv = driver.findElement(By.id("ires"));
    -     iresDiv.findElements(By.tagName("a")).get(0).click();
    -     System.out.println(driver.getPageSource());
    -   } finally {
    -     driver.quit();
    -   }
    - }
    -}
    -
  6. -
  7. -

    자바 클래스를 실행시킵니다. 그러면 컨솔 또는 터미널에 출력된 HTML컨텐츠를 확인할 수 있습니다.

    -
  8. -
- -

(headless Firefox를 지원하는) 다른 테스팅 솔루션

- -

Slimerjs는 리눅스에서 Firefox를 지원합니다. 윈도우즈와 맥은 지원 예정입니다. 상세한 내용은 이 글 ( Headless SlimerJS with Firefox by Brendan Dahl) 을 참고해주세요.

- -

그 외에 환경변수가 설정가능하다면 거의 모든 일반적인 테스팅 어플리케이션에서 쓰여진 자동화된 테스트에서 headless Firefox를 이용할 수 있습니다. 

- -

트러블슈팅과 상세 지원에 관해

- -

headless mode를 이용중에 문제가 발생했을 경우에는 걱정하시지 말고 이 섹션을 찾아주세요.  이 섹션은 질문이 더 생기거나 답을 찾았을 경우에 내용을 추가 할 수 있도록 설계되어있습니다.

- - - -

엔지니어에게 질문이 있다면 Mozilla IRC#headless 채널이 최고의 장소입니다. 그리고 버그를 확실하게 발견하셨다면 Mozilla Bugzilla에서 내용을 알려주세요. 

- -

관련 글

- - diff --git a/files/ko/mozilla/firefox/multiple_profiles/index.html b/files/ko/mozilla/firefox/multiple_profiles/index.html deleted file mode 100644 index ebf8e4adb3..0000000000 --- a/files/ko/mozilla/firefox/multiple_profiles/index.html +++ /dev/null @@ -1,242 +0,0 @@ ---- -title: 여러 개의 Firefox 프로파일 -slug: Mozilla/Firefox/Multiple_profiles -translation_of: Mozilla/Firefox/Multiple_profiles ---- -

A profile in Firefox is the collection of settings, customizations, add-ons, and other personalizations that a user has made or installed into their copy of Firefox. You can find details about profiles on Mozilla's end-user support site.

- -

여러 개의 프로파일이 필요한 이유

- -

The casual user may want to have different profiles for different family members. Having different profiles would allow each person to have his or her own set of bookmarks, settings, and add-ons.

- -

Web developers might want a secondary profile for testing websites, apps, or other projects on different Firefox channels. For example, you might want to have the Firebug add-on installed for Web development, but not for general-purpose Web browsing. While using the Nightly channel, you may encounter some add-ons that have become temporarily incompatible with new API changes, until the add-on developer has a chance to update them. You can remove such add-ons from your profile for Nightly use while keeping them for use with other profiles.

- -

For QA, testing, and bug triaging contributors, you may want to have multiple development versions of Firefox installed, each with its own profile. Creating new profiles for testing can keep you from losing your preferences, bookmarks, and history. It takes little time to set up a new profile, and once it is complete, all of your Firefox versions will update separately and can be run simultaneously.

- -

가능한 브라우저 개발 채널

- -

There are four available browser channels, each at a different level of stability and development. The four channels are Release, Beta, Developer Edition, and Nightly. The Release channel is recommended for most users, as it is the "official release" channel. However, for those more adventurous, you can try one of the other three channels to see what is coming in Firefox and play around with emerging features. The Beta channel contains the features that are expected to be in the next release of Firefox and are in final stages of testing. Aurora contains experimental features, which are not yet at beta quality. Nightly contains the latest code from Firefox developers and is the least stable channel.

- -

써드파티 도구

- -

In addition to the built-in Profile Manager and the external Profile Manager, there are a few third-party tools that make working with multiple profiles easy.

- -
-

This list is by no means exhaustive. Please add any helpful tools you discover to the list!

-
- -

크로스플랫폼

- - - -

Mac OS X

- - - -

프로파일 관리

- -

Firefox가 실행되는 동안 프로파일 결정

- -

To determine the profile of a currently-running Firefox instance in Windows, macOS or Linux,

- -
    -
  1. Click in the menu: Help > Troubleshooting Information.  A new tab will open.
  2. -
  3. In the section Application Basics, find Profile Folder.
  4. -
  5. Click the button Show Folder, Show Directory, or Show in Finder.  A native file browser window will open.
  6. -
  7. -

    Look at the name of the folder being displayed.  It will be some random characters, followed by a dot/period, followed by the current profile name.  For example, if the folder name is r99d1z7c.default, you are running in a profile named default, which is probably the first profile that was automatically created when Firefox was installed.  If the folder name is b5gkn7wd.Suzie, you are running in a profile named Suzie

    -
  8. -
- -

특정 프로파일로 Firefox 실행

- -

You cannot change the profile while Firefox is running.  Although it is possible in some cases to have multiple instances of Firefox running in different profiles, to avoid confusion, you should first exit/quit/terminate all running instances of Firefox, FirefoxDeveloperEdition or Nightly.  Then follow the instructions below, applicable to your operating system.

- -

윈도우

- -
Windows XP
- -
    -
  1. Click the Start button.
  2. -
  3. Click "Run".
  4. -
  5. Type "firefox -ProfileManager".
  6. -
- -
Windows Vista/7
- -
    -
  1. Click the Start button.
  2. -
  3. Click the search bar at the bottom.
  4. -
  5. Type "firefox -ProfileManager".
  6. -
- -
Windows 8/8.1
- -
    -
  1. Press "Windows + R" on your keyboard.
  2. -
  3. Type firefox -ProfileManager.
  4. -
- -

If the Profile Manager window does not open, Firefox may have been running in the background, even though it was not visible. Close all instances of Firefox, or restart the computer, and then try again.

- -

리눅스

- -

If Firefox is already included in your Linux distribution, or if you have installed Firefox with the package manager of your Linux distribution:

- -
    -
  1. At the top of the Firefox window, click on the File menu and select Quit.
  2. -
  3. In Terminal run firefox --ProfileManager
  4. -
- -

If the Profile Manager window does not open, Firefox may have been running in the background, even though it was not visible. Close all instances of Firefox, or restart the computer and then try again.

- -

macOS

- -
    -
  1. Run the Terminal application, which is found in Applications/Utilities.
  2. -
  3. Type or paste in the path to Firefox, followed by .app/Contents/MacOS/firefox.  For example, if Firefox is installed in the recommended location, you would enter /Applications/Firefox.app/Contents/MacOS/firefox.
  4. -
  5. If you have the path to your desired profile handy, enter a space character, followed by -profile followed by another space character, followed by the full path to the profile folder you wish to launch into.  This will launch Firefox immediately.  Otherwise, enter a space character followed by --profilemanager.  This will present the Profile Manager window in which you can make your selection.
  6. -
  7. Hit return.
  8. -
- -

Here is a complete example Terminal command from steps 2-3:

- -
/Applications/Firefox.app/Contents/macOS/firefox -profile /Users/Suzie/Library/Application\ Support/Firefox/Profiles/r99d1z7c.default
- -

If you want to do this frequently and more easily, you may wish to create an Automator application, as explained in this tutorial.

- -

프로파일 생성하기

- -

프로파일 매니저로 프로파일 만들기

- -

These instructions should be the same for all operating systems.

- -
    -
  1. To start the Create Profile Wizard, click "Create Profile..." in the Profile Manager.
  2. -
  3. Click Next and enter the name of the profile. Use a profile name that is descriptive, such as your personal name. This name is not exposed to the Internet.
  4. -
  5. You can also choose where to store the profile on your computer. To select storage location, click Choose Folder....
  6. -
  7. If you choose your folder location for the profile, select a new or empty folder. If you choose a folder that isn't empty, and you later remove the profile and choose the \"Delete Files\" option, everything inside that folder will be deleted.
  8. -
  9. To create the new profile, click Finish.
  10. -
- -

Firefox 브라우저로 프로파일 만들기

- -

You can create a new Firefox profile directly from the browser.

- -
    -
  1. Type about:profiles into the browser URL search bar
  2. -
  3. On the page, click Create a New Profile button
  4. -
  5. Read the introduction, and click Next
  6. -
  7. Enter a profile name for your new Profile. Use a profile name that is descriptive, such as your personal name. This name is not exposed to the Internet.
  8. -
  9. Optionally, to change where the profile will be stored on your computer, click Choose Folder...
  10. -
  11. To create the new profile, click Finish.
  12. -
- -

프로파일 삭제하기

- -
    -
  1. In the Profile Manager, select the profile to remove, and click Delete Profile....
  2. -
  3. Confirm that you wish to delete the profile: -
      -
    • Don't Delete Files removes the profile from the Profile Manager yet retains the profile data files on your computer in the storage folder so that your information is not lost. "Don't Delete Files" is the preferred option, because it saves the old profile's folder, allowing you to recover the files to a new profile.
    • -
    • Delete Files removes the profile and its files, including the profile bookmarks, settings, passwords, etc.
      -
      - {{ warning("If you use the \"Delete Files\" option, the profile folder, and files will be deleted. This action cannot be undone.") }}
    • -
    • Cancel interrupts the profile deletion.
    • -
    -
  4. -
- -

프로파일의 이름 바꾸기

- -
    -
  1. In the Profile Manager, select the profile you want to rename, and then click "Rename Profile".
  2. -
  3. Enter a new name for the profile and click on OK.
  4. -
- -
-

Note: The folder containing the files for the profile is not renamed.

-
- -

옵션

- -

오프라인 작업

- -

Choosing this option loads the selected profile, and starts Firefox offline. You can view previously viewed web pages, and experiment with your profile.

- -

시작시 묻지 않기

- -

If you have multiple profiles, Firefox prompts you for the profile to use each time you start Firefox. Select this option to allow Firefox to load the selected profile, without prompting at startup.

- -
-

Note: To access other profiles after selecting this option, you must start the Profile Manager first.

-
- -

프로파일 사용하기

- -

Windows

- -

If you want to have the profile manager to pop up each time you start Firefox, so you can choose a profile, you will need to edit the "Target" of the launch icon. To do this:

- -
    -
  1. Right-click the icon and choose "Properties".
  2. -
  3. When the properties dialog box pops up, you should see a "Target" text field that you can edit, and it should show the current file path.
  4. -
  5. After the closing quote, add -ProfileManager.
  6. -
  7. Click Ok.
  8. -
- -

Now whenever you double click that icon, the profile manager should appear, allowing you to choose which profile you'd like to use.

- -

If you want individual icons to launch specific profiles, you will need to edit the "Target" of each icon. To do this:

- -
    -
  1. Right-click the icon and choose "Properties".
  2. -
  3. When the properties dialog box pops up, you should see a "Target" text field that you can edit, and it should show the current file path.
  4. -
  5. To permanently set a specific profile, add -p PROFILE_NAME to the target path, but outside of the quotes, replacing "PROFILE_NAME" with the actual profile name you chose.
  6. -
  7. If you would also like to allow multiple instances of Firefox to run at the same time, add -no-remote after the profile name.
  8. -
- -

Once you are all done, click Ok. Do this for each icon you'd like to have a specific profile for. Once done, each one should automatically start with the specified profile.

- -

리눅스

- -

There is no extremely straightforward way to create custom application launchers in Gnome 3 like there was in Gnome 2. The following tutorial will help get you going overall: Gnome 3 Custom application launcher. Once you get to the point of adding a new item, you can have the profile dialog show up every time or set the launcher to launch a specific profile.

- -

If you want to have the profile manager to pop up each time you start Firefox, so you can choose a profile, you will need to set the command line for your new launcher.

- -
    -
  1. Set the "command" text field to target the executable file, likely "/usr/bin/firefox", and add the -p parameter.
  2. -
- -

If you want individual icons to launch specific profiles, you will need to set the command line for your new launcher. To do this:

- -
    -
  1. Set the "command" text field to target the executable file, likely "/usr/bin/firefox", and add the -p PROFILE_NAME parameter, replacing "PROFILE_NAME" with the specific profile.
  2. -
  3. Repeat as necessary, for each additional profile you want to set.
  4. -
  5. If you would also like to allow multiple instances of Firefox to run at the same time, add "-no-remote" after the profile name.
  6. -
- -

Mac OS X

- -

You can find a useful tutorial to set up custom launchers here: Managing Multiple Firefox Profiles in OSX. Do note it's best to follow all steps in the "Creating the scripts" section, including the "edit Info.plist" step. Leave off the profile name if you want the profile selector to show up every time you launch.

- -

Setting up multiple profiles for different Firefox channels

- -

This section will be especially helpful if you are a developer, wanting to work with multiple channels, and each having their separate launcher.

- -

Windows

- -

In Windows, the Developer and Nightly builds get their own directory in the "Programs" folder, so you don't have to worry about where to store the downloaded files. However, all three will attempt to use the same profile by default. You won't want to keep this behavior, because the different channels have different levels of features. To set each launcher, follow the Windows instructions at Windows Launcher.

- -

Linux

- -

In Linux, things aren't as automatically set up. You will likely get a prompt to download a tar.bz2 file to extract from. Extract the files to a new directory, and use the new launcher instructions from here. The only change you will need to make is the command path. You will want to set it to the directory where you extracted the Firefox channel's tar.bz2 file, and the executable "firefox" file located within this directory. The remaining profile assignment methods will remain the same. You will want to, for sure, add the -no-remote part to the end of the command field, so that you could run multiple instances at the same time.

- -

Mac OS X

- -

You can find a useful tutorial to set up custom launchers here: Managing Multiple Firefox Profiles in OSX. Do note it's best to follow all steps in the "Creating the scripts" section, including the "edit Info.plist" step. Also, you'll want to change the path in the do shell script to point to the correct .app file for the Firefox channel you want to target.

diff --git a/files/ko/mozilla/http_cache/index.html b/files/ko/mozilla/http_cache/index.html deleted file mode 100644 index 8613350f2d..0000000000 --- a/files/ko/mozilla/http_cache/index.html +++ /dev/null @@ -1,483 +0,0 @@ ---- -title: HTTP 캐시 -slug: Mozilla/HTTP_cache -translation_of: Mozilla/HTTP_cache ---- -
-

이 문서는 새로운 HTTP 캐시 version 2를 기술하고 있습니다.

-
- -

 

- -

코드는 /network/cache2 에 존재합니다.

- -

 

- -

API

- -

다음은 HTTP 캐시 v2 API에 대한 자세한 설명으로,  예제들을 포함하고 있습니다.  이 문서에는 IDL files 주석에서 찾을 수 없거나 명시되지 않은 내용만 들어있습니다.

- - - -
-

nsICacheService 등의 오래된 캐시 API를 더 이상 사용하지 말 것을 적극 권장합니다.  이는 곧 완전히 폐기되고 제거될 것입니다. (bug 913828).

-
- -

nsICacheStorageService

- - - -

nsILoadContextInfo

- - - -

nsICacheStorage

- - - -

nsICacheEntryOpenCallback

- - - -

nsICacheEntry

- - - -

Lifetime of a new entry

- - - -

Concurrent read and write

- -
-

Important difference in behavior from the old cache: the cache now supports reading a cache entry data while it is still being written by the first consumer - the writer.

-
- -

This can only be engaged for resumable responses that (bug 960902) don't need revalidation. Reason is that when the writer is interrupted (by e.g. external canceling of the loading channel) concurrent readers would not be able to reach the remaning unread content.

- -
-

This could be improved by keeping the network load running and being stored to the cache entry even after the writing channel has been canceled.

-
- -

When the writer is interrupted, the first concurrent reader in line does a range request for the rest of the data - and becomes that way a new writer. The rest of the readers are still concurrently reading the content since output stream for the cache entry is again open and kept by the current writer.

- -

Lifetime of an existing entry with only a partial content

- - - -

Lifetime of an existing entry that doesn't pass server revalidation

- - - -

Adding a new storage

- -

Should there be a need to add a new distinct storage for which the current scoping model would not be sufficient - use one of the two following ways:

- -
    -
  1. [preffered] Add a new <Your>Storage method on nsICacheStorageService and if needed give it any arguments to specify the storage scope even more.  Implementation only should need to enhance the context key generation and parsing code and enhance current - or create new when needed - nsICacheStorage implementations to carry any additional information down to the cache service.
  2. -
  3. [not preferred] Add a new argument to nsILoadContextInfo; be careful here, since some arguments on the context may not be known during the load time, what may lead to inter-context data leaking or implementation problems. Adding more distinction to nsILoadContextInfo also affects all existing storages which may not be always desirable.
  4. -
- -

See context keying details for more information.

- -

Code examples

- -

TBD

- -

Opening an entry

- -

Creating a new entry

- -

Recreating an already open entry

- -

Implementation

- -

Threading

- -

The cache API is fully thread-safe.

- -

The cache is using a single background thread where any IO operations like opening, reading, writing and erasing happen.  Also memory pool management, eviction, visiting loops happen on this thread.

- -

The thread supports several priority levels. Dispatching to a level with a lower number is executed sooner then dispatching to higher number layers; also any loop on lower levels yields to higher levels so that scheduled deletion of 1000 files will not block opening cache entries.

- -
    -
  1. OPEN_PRIORITY: except opening priority cache files also file dooming happens here to prevent races
  2. -
  3. READ_PRIORITY: top level documents and head blocking script cache files are open and read as the first
  4. -
  5. OPEN
  6. -
  7. READ: any normal priority content, such as images are open and read here
  8. -
  9. WRITE: writes are processed as last, we cache data in memory in the mean time
  10. -
  11. MANAGEMENT: level for the memory pool and CacheEntry background operations
  12. -
  13. CLOSE: file closing level
  14. -
  15. INDEX: index is being rebuild here
  16. -
  17. EVICT: files overreaching the disk space consumption limit are being evicted here
  18. -
- -

NOTE: Special case for eviction - when an eviction is scheduled on the IO thread, all operations pending on the OPEN level are first merged to the OPEN_PRIORITY level. The eviction preparation operation - i.e. clearing of the internal IO state - is then put to the end of the OPEN_PRIORITY level.  All this happens atomically. This functionality is currently pending in bug 976866.

- -

Storage and entries scopes

- -

A scope key string used to map the storage scope is based on the arguments of nsILoadContextInfo. The form is following (currently pending in bug 968593):

- -
a,b,i1009,p,
- - - -

CacheStorageService keeps a global hashtable mapped by the scope key. Elements in this global hashtable are hashtables of cache entries. The cache entries are mapped by concantation of Enhance ID and URI passed to nsICacheStorage.asyncOpenURI.  So that when an entry is beeing looked up, first the global hashtable is searched using the scope key. An entries hashtable is found. Then this entries hashtable is searched using <enhance-id:><uri> string. The elemets in this hashtable are CacheEntry classes, see below.

- -

The hash tables keep a strong reference to CacheEntry objects. The only way to remove CacheEntry objects from memory is by exhausting a memory limit for intermediate memory caching, what triggers a background process of purging expired and then least used entries from memory. Another way is to directly call the nsICacheStorageService.purge method. That method is also called automatically on the "memory-pressure" indication.

- -

Access to the hashtables is protected by a global lock. We also - in a thread-safe manner - count the number of consumers keeping a reference on each entry. The open callback actually doesn't give the consumer directly the CacheEntry object but a small wrapper class that manages the 'consumer reference counter' on its cache entry. This both mechanisms ensure thread-safe access and also inability to have more then a single instance of a CacheEntry for a single <scope+enhanceID+URL> key.

- -

CacheStorage, implementing the nsICacheStorage interface, is forwarding all calls to internal methods of CacheStorageService passing itself as an argument.  CacheStorageService then generates the scope key using the nsILoadContextInfo of the storage. Note: CacheStorage keeps a thread-safe copy of nsILoadContextInfo passed to a *Storage method on nsICacheStorageService.

- -

Invoking open callbacks

- -

CacheEntry, implementing the nsICacheEntry interface, is responsible for managing the cache entry internal state and to properly invoke onCacheEntryCheck and onCacheEntryAvaiable callbacks to all callers of nsICacheStorage.asyncOpenURI.

- - - -

The openers FIFO is an array of CacheEntry::Callback objects. CacheEntry::Callback keeps a strong reference to the opener plus the opening flags.  nsICacheStorage.asyncOpenURI forwards to CacheEntry::AsyncOpen and triggers the following pseudo-code:

- -

CacheStorage::AsyncOpenURI - the API entry point:

- - - -

CacheEntry::AsyncOpen (entry atomic):

- - - -

CacheEntry::InvokeCallbacks (entry atomic):

- - - -

CacheEntry::OnFileReady (entry atomic):

- - - -

CacheEntry::OnHandleClosed (entry atomic):

- - - -

All consumers release the reference:

- - - -

Intermediate memory caching of frequently used metadata (a.k.a. disk cache memory pool)

- -
-

This is a description of this feature status that is currently only a patch in bug 986179. Current behavior is simpler and causes a serious memory consumption regression (bug 975367).

-
- -

For the disk cache entries we keep some of the most recent and most used cache entries' meta data in memory for immediate zero-thread-loop opening. The default size of this meta data memory pool is only 250kB and is controlled by a new browser.cache.disk.metadata_memory_limit preference. When the limit is exceeded, we purge (throw away) first expired and then least used entries to free up memory again. 

- -

Only CacheEntry objects that are already loaded and filled with data and having the 'consumer reference == 0' (bug 942835) can be purged.

- -

The 'least used' entries are recognized by the lowest value of frecency we re-compute for each entry on its every access. The decay time is controlled by the browser.cache.frecency_half_life_hours preference and defaults to 6 hours. The best decay time will be based on results of an experiment.

- -

The memory pool is represented by two lists (strong refering ordered arrays) of CacheEntry objects:

- -
    -
  1. Sorted by expiration time (that default to 0xFFFFFFFF)
  2. -
  3. Sorted by frecency (defaults to 0)
  4. -
- -

We have two such pools, one for memory-only entries actually representing the memory-only cache and one for disk cache entries for which we only keep the meta data.  Each pool has a different limit checking - the memory cache pool is controlled by browser.cache.memory.capacity, the disk entries pool is already described above. The pool can be accessed and modified only on the cache background thread.

- -
"@mozilla.org/netwerk/cache-storage-service;1"
diff --git a/files/ko/mozilla/implementing_pontoon_in_a_mozilla_website/index.html b/files/ko/mozilla/implementing_pontoon_in_a_mozilla_website/index.html deleted file mode 100644 index f839f06acd..0000000000 --- a/files/ko/mozilla/implementing_pontoon_in_a_mozilla_website/index.html +++ /dev/null @@ -1,73 +0,0 @@ ---- -title: 모질라 프로젝트에서 Pontoon 실행하기 -slug: Mozilla/Implementing_Pontoon_in_a_Mozilla_website -translation_of: Mozilla/Implementing_Pontoon_in_a_Mozilla_website ---- -

Pontoon 은 보는 대로 얻을 수 있는 웹기반 지역화 도구입니다. 모질라에서는 현재 다양한 모질라 프로젝트와 Gaia라고 알려진 파이어 폭스 OS 인터페이스를 지역화시키기 위하여 폰툰을 사용하고 있습니다. 폰툰은 매우 간단하고 직관적인 도구입니다. 이는 지역화를 위한 시간을 줄여주기 위하여 어떤 전문적인 기술을 요구하지 않습니다. 여기서 저희는 어떻게 폰툰을 당신의 모질라 프로젝트에 추가하는지 이야기할 것입니다.

- -
-

폰툰을 개선하고 싶으신가요? GitHub에서 어떻게 관여하는지 배우세요.

-
- -
-

단지 당신의 l10n 프로젝트를 시작하고 싶으신가요? getting your project localized를 확인하세요

-
- -

A. 당신의 프로젝트를 번역할 수 있도록 만드세요

- -

저희는 모질라 프로젝트를 지역화하기 위한 표준이 되는 best practices 이 이미 있다는 것을 알고 있지만, 그 방법들을 여기에 추가하는 것이 기억하기에 좋다고 생각하였습니다. 

- -
    -
  1. 당신의 프로젝트가 l10n 프레임 워크들중 하나를 지원한다는 것을 보증하세요(gettext, XLIFF, L20n, lang, properties, etc.).
  2. -
  3. resource files에 번역할만한 문자들을 넣어주세요
  4. -
  5. resource files를 저장소(SVN, HG, Git) 에 Push하세요 -
      -
    • 각각의 지역 폴더들은 반드시 그 디렉토리 트리의 같은 레벨에 위치하고 있어야 합니다. Source locale은 영어로 templates라고 불릴 필요가 있습니다. 당신은 이러한 목적을 위하여 섬세한 지역 폴더를 생성하기 원할지도 모릅니다. 지역 코드는 반드시 그 파일명의 일부가 되서는 안됩니다.
    • -
    • 올바른 패턴: -
      /locales/{locale_code}/path/to/file.extension
      -
    • -
    • 부적절한 패턴: -
      /locales/{locale_code}/path/to/file.{locale_code}.extension
      -
    • -
    -
  6. -
  7. 폰툰이 저장소에 쓰기 권한을 가질 수 있도록 확인하세요. - -
  8. -
- -

B. (선택사항) 당신의 웹 프로젝트의 in-page 지역화를 활성화하세요

- -
    -
  1. 폰툰이 당신의 사이트에 접속하고, 내용을 찾아 올바르게 번역할 수 있도록 HTML <body> element로 부터 오는 스크립트를 연결하세요. - -
  2. -
  3. 만약 당신의 사이트가 CSP를 사용한다면, 부디 다음의 사항들이 pontoon.mozilla.org 도메인에 허가될 수 있도록 확인해주세요 -
      -
    1. iframe 내부를 로딩하는 것
    2. -
    3. 멀리 있는 CSS를 로딩하는 것
    4. -
    5. 멀리 있는 이미지들을 로딩하는 것
    6. -
    -
  4. -
  5. 만약 당신의 사이트가 X-Frame-Options header를 사용한다면, 부디 iframe 내부가 도메인에 허가될 수 있도록 확인해주세요
  6. -
  7. 당신의 사이트가 HTTPS를 지원하는지 확인해주세요. HTTPS는 무료이며, 자동적으로 열립니다. 암호화합시다!
  8. -
- -

C. 폰툰에 당신의 프로젝트를 추가하세요

- -

당신의 프로젝트는 이제 폰툰에 설치될 준비가 되었습니다. 부디 Localization Infrastructure and Tools :: Administration / Setup에 버그를 기록하여 주세요 그리고 아래 사항 정보들을 제공해 주세요

- - - -

더 자세한 사항을 원한다면, Project Management Team과 연락해주세요.

diff --git a/files/ko/mozilla/javascript_code_modules/index.html b/files/ko/mozilla/javascript_code_modules/index.html deleted file mode 100644 index 9c4987b787..0000000000 --- a/files/ko/mozilla/javascript_code_modules/index.html +++ /dev/null @@ -1,97 +0,0 @@ ---- -title: JavaScript code modules -slug: Mozilla/JavaScript_code_modules -translation_of: Mozilla/JavaScript_code_modules ---- -

자바스크립트(영어: JavaScript)는 객체 기반의 스크립트 프로그래밍 언어이다. 이 언어는 웹브라우저 내에서 주로 사용하며, 다른 응용 프로그램의 내장 객체에도 접근할 수 있는 기능을 가지고 있다. 또한 Node.js와 같은 런타임 환경과 같이 서버 사이드 네트워크 프로그래밍에도 사용되고 있다. 자바스크립트는 본래 넷스케이프 커뮤니케이션즈 코퍼레이션의 브렌던 아이크(Brendan Eich)가 처음에는 모카(Mocha)라는 이름으로, 나중에는 라이브스크립트(LiveScript)라는 이름으로 개발하였으며, 최종적으로 자바스크립트가 되었다JavaScript 코드 모듈을 사용하면 여러 개의 권한이 부여 된 JavaScript 범위에서 코드를 공유 할 수 있습니다. 예를 들어, 코드 중복을 피하기 위해 파이어 폭스 자체뿐만 아니라 확장 모듈에서도 모듈을 사용할 수 있습니다.

- -
-

These are not the same thing as standard JavaScript modules. See {{jsxref("Statements/export", "export")}} and {{jsxref("Statements/import", "import")}} to learn more about how to use standard modules.

-
- -

General topics

- -
-
Using JavaScript code modules
-
An introduction to how to use JavaScript code modules.
-
Components.utils.import
-
How to import a JavaScript code module.
-
Components.utils.unload
-
How to unload a JavaScript code module.
-
Code snippets: Modules
-
Examples of how to use code modules.
-
Mozilla Labs JS Modules
-
This page features a list of JavaScript modules, along with download links and documentation, that extension developers can use in their code.
-
- -
-
- -

Standard code modules

- -
-
AddonManager.jsm
-
An interface to install, manage, and uninstall add-ons.
-
AddonRepository.jsm
-
Provides a search of add-ons in the repository.
-
Assert.jsm
-
Implements the CommonJS Unit Testing specification version 1.1, which provides a basic standardized interface for performing in-code logical assertions with optional, customizable error reporting.
-
BookmarkHTMLUtils.jsm
-
Provides utility functions for importing and exporting bookmarks from the old-school "bookmarks.html" style bookmark files.
-
ctypes.jsm
-
Provides an interface that allows JavaScript code to call native libraries without requiring the development of an XPCOM component.
-
CustomizableUI.jsm
-
Allows you to interact with customizable buttons and items in Firefox's main window UI.
-
DeferredTask.jsm
-
Run a task after a delay.
-
Dict.jsm
-
Provides an API for key/value pair dictionaries.
-
DownloadLastDir.jsm
-
Supplies the path to the directory into which the last download occurred.
-
Downloads.jsm
-
Provides a single entry point to interact with the downloading capabilities of the platform.
-
FileUtils.jsm
-
Provides helpers for dealing with files.
-
Geometry.jsm
-
Provides routines for performing basic geometric operations on points and rectangles.
-
HTTP.jsm
-
A wrapper for XMLHttpRequest that provides convenient and simplified API for dealing with HTTP requests.
-
JNI.jsm
-
Abstracts the js-ctypes to provide an interface that allows JavaScript code to call code running in native JVMs.
-
ISO8601DateUtils.jsm
-
Provides routines to convert between JavaScript Date objects and ISO 8601 date strings.
-
Log.jsm (formerly log4moz)
-
Provides a log4j style API for logging, log messages to various endpoints, such as the Browser Console or a file on disk. 
-
NetUtil.jsm
-
Provides helpful networking utility functions, including the ability to easily copy data from an input stream to an output stream asynchronously.
-
openLocationLastURL.jsm
-
Provides access to the last URL opened using the "Open Location" option in the File menu.
-
OSFile.jsm
-
Allows routines to access files. To which can be read, write, rename, create directories,etc.
-
PerfMeasurement.jsm
-
Provides access to low-level hardware and OS performance measurement tools.
-
PluralForm.jsm
-
Supplies an easy way to get the correct plural forms for the current locale, as well as ways to localize to a specific plural rule.
-
PopupNotifications.jsm
-
Gives an easy way to present non-modal notifications to users.
-
Promise.jsm
-
Implements the Promises/A+ proposal as known in April 2013.
-
PromiseWorker.jsm
-
A version of {{domxref("ChromeWorker")}} which uses Promises to return the worker's result instead of using an event to do so.
-
Services.jsm
-
Provides getters for conveniently obtaining access to commonly-used services.
-
source-editor.jsm
-
The Source Editor is used by developer tools such as, the Style Editor; this interface implements the editor and lets you interact with it.
-
Sqlite.jsm
-
A Promise-based API to mozIStorage/SQLite.
-
Task.jsm
-
Implements a subset of Task.js to make sequential, asynchronous operations simple, using the power of JavaScript's yield operator.
-
Timer.jsm
-
A pure JS implementation of window.setTimeout.
-
Webapps.jsm
-
Provides an interface to manage Open Web Apps.
-
WebRequest.jsm
-
Provides an API to add event listeners for the various stages of making an HTTP request. The event listener receives detailed information about the request, and can modify or cancel the request.
-
XPCOMUtils.jsm
-
Contains utilities for JavaScript components loaded by the JS component loader.
-
diff --git a/files/ko/mozilla/js-ctypes/index.html b/files/ko/mozilla/js-ctypes/index.html deleted file mode 100644 index 83634cf2ce..0000000000 --- a/files/ko/mozilla/js-ctypes/index.html +++ /dev/null @@ -1,53 +0,0 @@ ---- -title: js-ctypes -slug: Mozilla/js-ctypes -translation_of: Mozilla/js-ctypes ---- -

js-ctypes 에서는 응용 프로그램과 확장코드가 C로 작성된 네이티브 코드를 통해 앞뒤로 호출할 수 있습니다. C++지원이 제한되니 {{bug("505907")}} 완전히 지원을 바랍니다. binary XPCOM 구성 요서와는 달리,개발자가 파이어 폭스의 여러버전과 함께 사용할 수 있는 단일 바이너리를 출시할 수 있습니다.

-
- 참고: js-ctypes는 크롬 코드에서만 사용할 수 있습니다. 즉, ctypes의 전용 응용 프로그램 및 확장 코드는 웹 사이트에 사용할 수 없습니다.
- - - - - - - -
-

문서

-
-
- 소개: js-ctypes에 사용하기
-
- ctypes 사용하기 시직하기.
-
- JS-ctypes 참조
-
- js-ctypes API에 대한 참조설명서를 참조하십시오.
-
- 표준 OS 라이브러리
-
- 다른 운영 체제의 표준 라이브러리에 대한 문서. (예: 함수는 Windows에서 어떤 DLL을 필요로 하는지에 대한 문서)
-
- 질문
-
- ctypes에 대해 자주 묻는 질문
-
-

모두 보기...

-

예시

- iPhoto 추가하기 -
-
- Firefox에서 "iPhoto에서 이미지를 추가"하는 기능을 구현하는 맥 OS X의 Carbon과 Core Foundation framework routines을 호출하여 JS-ctypes에 사용하는 Firefox 확장기능.
-
-
-

커뮤니티

-
    -
  • Mozilla 포럼 보기...{{DiscussionList("dev-extensions", "mozilla.dev.extensions")}}
  • -
- - -
-

 

diff --git "a/files/ko/mozilla/marketplace/publishing/\354\206\214\352\260\234/index.html" "b/files/ko/mozilla/marketplace/publishing/\354\206\214\352\260\234/index.html" deleted file mode 100644 index 4dc1f99578..0000000000 --- "a/files/ko/mozilla/marketplace/publishing/\354\206\214\352\260\234/index.html" +++ /dev/null @@ -1,84 +0,0 @@ ---- -title: 소개 — 앱 출판 -slug: Mozilla/Marketplace/Publishing/소개 -tags: - - Firefox OS - - Marketplace - - 마켓플레이스 - - 시작 - - 앱 - - 인트로 -translation_of: Archive/Mozilla/Marketplace/Publishing/Introduction ---- -
So you've figured out how you'll make your app a success, chosen how to deliver it and seen the options for delivering it beyond Firefox OS, and written and tested your code. Now it's time to make it available to users worldwide and publish it on Firefox Marketplace. This section provides a guide to all the tasks you need to perform to publish and update your Open Web Apps on Firefox Marketplace, as well as useful additional information.
- -
 
- -
-
-

출판 가이드

- -
-
Submission checklist
-
This checklist will help you prepare for submitting your app.
-
Marketplace review
-
Understand the process and criteria used when your app is reviewed.
-
- -

정책 및 가이드라인

- -
-
Icons (App Center)
-
Get details of the icon sizes required for various releases of Firefox OS.
-
- -
-
Icon design (Mozilla Style Guide)
-
Your app or in-app product icons may follow a circlar or square design, find out more from the Mozilla Style Guide.
-
- -
-
Privacy Policies
-
If your app uses personal data about a user, it must have a privacy policy. These guidelines cover the information you need to include in your app's privacy policy.
-
- -
-
Screenshot guidelines
-
These guidelines provide information on the best approaches to the screenshots  you include in your app's Marketplace listing.
-
App testing and troubleshooting
-
These guidelines provide information on setting up a test environment, testing your app and troubleshooting issues you may find.
-
-
- -
-

앱 제출

- -
-
App submission process guide
-
So you're ready to publish your first app, or want to publish an app with a packaging method or features you haven't used before, get step-by-step instructions for submitting your app to Firefox Marketplace.
-
- -

앱 업데이트하기

- -
-
Updating apps
-
Maintaining the momentum behind your app means offering users regular updates; for new features and, although we all hope not, bug fixes. This page provides the information you need on how to deliver your app updates through Firefox Marketplace.
-
- -

출시된 앱 관리

- -
-
App management guide
-
Your app is published and you now want to make changes or find out how well it's been received. In this section discover how to change your app status, review statistics, and check your reviews and ratings on Firefox Marketplace.
-
- -

추가 도구

- -
-
Adding a subdomain for your app
-
If you want to offer more than one hosted app from your website, you'll need to create a subdomain for each one. This page explains how.
-
-
-
- -

 

diff --git a/files/ko/mozilla/marketplace/submission/index.html b/files/ko/mozilla/marketplace/submission/index.html deleted file mode 100644 index 1c01f1e00d..0000000000 --- a/files/ko/mozilla/marketplace/submission/index.html +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: Submission -slug: Mozilla/Marketplace/Submission -tags: - - NeedsTranslation - - TopicStub -translation_of: Archive/Mozilla/Marketplace/Submission ---- -

Marketplace submission

diff --git a/files/ko/mozilla/marketplace_kr/index.html b/files/ko/mozilla/marketplace_kr/index.html deleted file mode 100644 index e36b711de6..0000000000 --- a/files/ko/mozilla/marketplace_kr/index.html +++ /dev/null @@ -1,137 +0,0 @@ ---- -title: Firefox 마켓플레이스 -slug: Mozilla/Marketplace_KR -tags: - - Firefox OS - - 개관 - - 마켓플레이스 - - 비기너 - - 시작 - - 시작자 - - 아마추어 - - 앱 - - 어플리케이션 - - 우선사항 - - 응용프로그램 - - 인트로 - - 초심자 -translation_of: Archive/Mozilla/Marketplace ---- -
Firefox Marketplace는 개방되고 독점되지 않은 HTML5를 이용해서 만들어진 응용 프로그램들을 위한 온라인 장터입니다. 이곳에서는 당신의 응용프로그램을 Firefox Marketplace에 출판하기 위한 정보들을 찾을 수 있습니다. 응용프로그램들을 성공적으로 만들고 전달하고, 출판하고 업데이트하며 Marketplace의 기능을 이용하기 위한 라이브러리들과 API들을 찾아보세요.
- -
-

파이어폭스 마켓플레이스는 크로스 플랫폼을 지원하는 열린 웹앱환경을 이용한 앱을 출판할 수 있는 곳입니다. Mozilla는 세상 모든 응용프로그램들에 대해 다음과 같은 가치를 추구합니다. - 공개성, 자유성, 사용자 선택성

-
- -
-
-
-

 표준화된 웹 기술, 언어, 도구, 그리고 Firefox Marketplace 를 사용하여 Open Web Apps 를 출시할 수 있습니다. 이러한 응용프로그램들은 패키징되고 Firefox OS에서 구동되거나 당신의 웹 서버에 호스팅될 수 있습니다. 출시된 응용프로그램들은 Firefox OS 스마트폰 사용자에게 그들이 어디에 있든 제공됩니다. 사용자들은 당신의 응용프로그램을 Firefox Marketplace내의 추천 응용프로그램, 카테고리, 강력한 검색기능을 이용해 쉽게 찾을 수 있습니다. 또한 사용자들은 빠르게 무료 응용프로그램들을 설치하거나 유료 응용프로그램들을 신용카드나 다른 수단을 통해 구매할 수 있습니다.

-
-
-
- -
-
-

- -

성공을 위한 준비

- -
-
당신이 기쁨을 위해서, 또는 돈을 목적으로 응용프로그램을 만들지라도 당신은 사람들이 당신이 만든것을 찾고, 사용하고, 즐기기를 원할 것입니다. 이곳에서는 당신이 어떻게 소문을 내고 만족스러운 사용자들을 위해 커뮤니티를 만드는 방법을 설명합니다.
-
- -

공개 옵션

- -
-
패키징되거나 호스팅되거나, 그것이 문제로다. 당신의 응용프로그램 콘텐츠들을 사용자들에게 전달하는 방법과 안드로이드 기기 또는 데스크톱, 그리고 Firefox Os에서 응용프로그램을 사용할 수 있게 해주는 옵션들을 찾아보세요.
-
- -

응용프로그램 출판

- -
-
당신의 응용프로그램들을 대기상태에서 놓아주세요. 응용프로그램들을 제출하고, 평가받고, 업데이트하고, 실적을 모니터링하고, 사용자들의 피드백을 받는 과정들과 같은 Firefox Marketplace에서의 응용프로그램 등록 방법을 찾아보세요.
-
-
- -

앱 개발자들을 위한 도구들

- -
-
Firefox Marketplace 라이브러리 및 API 당신의 마켓플레이스 응용프로그램에 추가할 라이브러리 및 API를 찾아보세요.
-
응용프로그램 개발자 도구 당신이 오픈 웹 응용프로그램 개발에 효율적이고 재밋게 사용할 수 있는 도구들의 완벽한 목록을 찾아보세요.
-
WebIDE Firefox OS 시뮬레이터를 사용하거나 실제의 Firefox OS 기기를 이용하여 당신의 Firefox OS 응용프로그램에 대한 테스트, 배치 및 디버깅을 할 수 있는 기본 도구입니다.
-
-
- -

목차

- -
    -
  1. 성공을 위한 준비 - -
      -
    1. 소개
    2. -
    3. 무엇을 만들지 정합니다
    4. -
    5. 당신의 사용자들을 파악합니다
    6. -
    7. 당신의 비즈니스 모델을 선정합니다
    8. -
    9. 당신의 응용프로그램들을 지역화합니다
    10. -
    11. 당신의 응용프로그램을 홍보합니다
    12. -
    13. 당신의 커뮤니티를 만드세요
    14. -
    -
  2. -
  3. 출시 옵션 -
      -
    1. 소개
    2. -
    3. 패키징된 응용프로그램
    4. -
    5. 호스팅된 응용프로그램
    6. -
    7. 패키징과 호스팅이란?
    8. -
    9. 모바일에 최적화된 웹사이트
    10. -
    11. 응용프로그램을 스스로 출시해보세요
    12. -
    -
  4. -
  5. 응용프로그램 출시 미리보기 -
      -
    1. 소개
    2. -
    3. 제출전 확인사항
    4. -
    5. 마켓플레이스 리뷰 표준
    6. -
    7. 마켓플레이스 공개행사 표준
    8. -
    9. 응용프로그램을 위한 서브도메인 추가
    10. -
    11. 정책 및 가이드라인 -
        -
      1. 안내
      2. -
      3. 마켓플레이스 스크린샷 표준
      4. -
      5. 개인 정책
      6. -
      7. 응용프로그램 테스트 및 원인분석
      8. -
      -
    12. -
    -
  6. -
  7. 당신의 응용프로그램을 제출하기 -
      -
    1. 개관
    2. -
    3. Step 1: 가입
    4. -
    5. Step 2: 응용프로그램 불러오기
    6. -
    7. Step 3: 세부사항 나열
    8. -
    9. Step 4: 다음단계
    10. -
    11. Step 5: 응용프로그램 평가
    12. -
    13. Step 6: 팀 맴버 정의
    14. -
    15. Step 7: 목록 보기
    16. -
    17. Step 8: 다른 지역의 지역화를 위한 편집
    18. -
    -
  8. -
  9. 출판된 응용프로그램 관리 및 업데이트 -
      -
    1. 소개
    2. -
    3. 당신의 응용프로그램 상태
    4. -
    5. 응용프로그램 업데이트
    6. -
    7. 별점
    8. -
    -
  10. -
  11. 추가제출 -
      -
    1. 추가제출 개관
    2. -
    3. 추가제출 리뷰 기준
    4. -
    -
  12. -
  13. 라이브러리 및 API
  14. -
  15. Firefox Marketplace FAQ
  16. -
diff --git a/files/ko/mozilla/mobile/index.html b/files/ko/mozilla/mobile/index.html deleted file mode 100644 index 6431893f01..0000000000 --- a/files/ko/mozilla/mobile/index.html +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: Mobile -slug: Mozilla/Mobile -translation_of: Mozilla/Mobile ---- -

Firefox OS

- -

Firefox OS는 사용자 인터페이스와 HTML, CSS 및 JavaScript로 작성된 응용 프로그램을 구동하는 Linux와 Mozilla의 Gecko 엔진을 사용하는 오픈 소스 모바일 운영 체제입니다.

- -

Firefox OS 설치 방법과 앱을 개발하는 방법에 대해서 살펴보십시오.

- -
-
-
-
-
-
-
- -

Firefox for Android

- -

안드로이드 Firefox 안드로이드 기기를 위한 Mozilla 모바일 브라우저입니다. 최근에 안드로이드 자체 UI를 사용하도록 재개발 되어서 더 빠르고 응답성도 좋아졌습니다. 카메라나 전화기능과 같은 기기 자체의 기능에 접근하는 강력한 API를 제공합니다.

- -

안드로이드용 Firefox를 만드는데 도움을 주는 방법이나 device API를 사용하는 방법, 모바일 부가 기능을 만드는 방법에 대해서 살펴보세요.

- -

Mobile web development

- -

모바일 장치는 데스크톱이나 노트북 컴퓨터와는 매우 다른 하드웨어 특징을 가지고 있으며 기기를 제어하는데 사용되는 API의 대부분은 아직 표준화 단계에 있습니다.

- -

모바일 장치에서 보이는 웹 사이트를 개발하고 제공되는 새로운 가능성 활용하는 방법에 대해서 살펴보십시오. 웹 사이트가 다른 브라우저에서 작동하는지 확인하는 방법을 배웁니다.

diff --git a/files/ko/mozilla/mobile/viewport_meta_tag/index.html b/files/ko/mozilla/mobile/viewport_meta_tag/index.html deleted file mode 100644 index 577fa0b5ee..0000000000 --- a/files/ko/mozilla/mobile/viewport_meta_tag/index.html +++ /dev/null @@ -1,99 +0,0 @@ ---- -title: viewport meta 태그를 이용해 모바일 브라우저상에서 레이아웃 조종하는 법 -slug: Mozilla/Mobile/Viewport_meta_tag -tags: - - viewport - - 레이아웃 - - 모바일 -translation_of: Mozilla/Mobile/Viewport_meta_tag ---- -

앞으로 공개될 Mobile Firefox (Fennec) 1.1 에는 개선된 <meta name="viewport"> 태그를 지원한다. 이전 버전의 Fennec에서 viewport 속성(property)으로 width, height, 그리고 initial-scale 가 지원되긴 했지만 iphone과 android 브라우저에 맞추어 디자인된 몇몇 사이트에서 문제가 있었다. 이제 모바일 safari 에서도 같은 속성들이 지원되며, Fennec을 고쳐서 여러가지 화면크기와 다른 해상도에서도 모바일 사이트들이 문제없이 나타나도록 했다.

- -

이전 touch.facebook.com:

- -

05-11-fennec-meta-viewport-2.png

- -

개선후 touch.facebook.com:

- -

05-11-fennec-meta-viewport-1.png

- -

이러한 개선점들은 최신의 Fennec 1.1 와 Maemo, Windows, Mac, or Linux를 위한 trunk nightly 빌드에서 볼 수 있다.

- -

배경설명

- -

Fenec과 같은 모바일 브라우저들은 뷰포트(viewport)로 알려진 가상 "window"상에 페이지를 렌더링하는데, 보통의 경우 스크린 보다 폭이 넓어 모든 페이지 레이아웃을 억지로 작은 화면에 축소할 필요가 없다. (레이아웃을 축소할 경우 모바일 사이트로 만들지 않은 사이트들은 대개 엉망이 되게 마련이다.) 사용자들은 화면을 움직이거나 줌 기능을 이용해 페이지의 보이지 않는 부분들을 볼 수 있다.

- -

모바일 Safari는 "viewport meta" 태그를 도입해서 웹 개발자들이 뷰포트의 크기와 스케일을 조정할 수 있게 했고, 웹 표준은 아니지만 많은 다른 모바일 브라우저들도 이 태그를 이제 지원한다. 애플의 문서를 통해 이 태그의 사용법을 자세히 알 수 있기는 하지만 Fenec내에서 정확히 어떻게 구현해야 할 것인가에 대해 상당한 연구가 진행되어야 했다. 예를 들어 사파리의 문서에는 페이지 컨텐트를 "comma-delimited list"라고 쓰고 있는데, 현존하는 브라우저와 웹페이지는 comma, semicolon, 그리고 space의 다양한 조합을 사용한다.

- -

다양한 브라우저내의 뷰포트에 대해 더 배우고 싶으면 quirksmode.org에 있는 A Tale of Two Viewports 를 보라.

- -

뷰포트 기본

- -

모바일로 최적화된 사이트는 일반적으로 다음과 같은 태그를 포함한다:

- -
<meta name="viewport" content="width=device-width, initial-scale=1">
- -

width 속성은 뷰포트의 크기를 조정한다. 특정한 숫자를 사용해 width=600라고 할 수도 있고 device-width와 같은 특정한 값을 사용할 수도 있는데, device-width는 100% 스케일에서 CSS 픽셀들로 계산된 화면의 폭을 의미한다. (뷰포트의 높이에 따라 크기와 위치가 변하는 요소들로 이루어진 페이지의 경우 상응하는 heightdevice-height 값들이 유용하게 사용될 수 있다.)

- -

initial-scale 속성은 페이지가 처음 로드될 때 줌 레벨을 조정한다. maximum-scale, minimum-scale, 그리고 user-scalable 속성들은 사용자가 얼마나 페이지를 줌-인, 줌-아우트 할 수 있는지를 조정한다.

- -
-

user-scalable=no를 사용하면 저시력과 같은 시각 장애를 가진 사용자에게 접근성 문제를 일으킬 수 있습니다.

-
- -

픽셀은 사실 픽셀이 아니다

- -

iPhone과 인기가 많은 다양한 안드로이드 폰은 3에서 4인치 (7-10센티미터) 스크린으로 320-480픽셀 (~160 dpi)로 이루어져 있다. 동일한 물리적 스크린을 갖는 Nokia N900에서 구동되는 Maemo의 파이어폭스는 480-800픽셀(~240dpi)이다. 이러한 이유로 Fennec의 최신 버전에서 보여지는 웹페이지들은 아이폰이나 안드로이드에 비해 1/3정도 작기 때문이다(실제 물리적으로). 이는 터치인터페이스에 최적화된 웹사이트에서 사용성과 가독성의 문제를 야기시킨다. Peter-Paul Koch가 이 문제에 대해 픽셀은 사실 픽셀이 아니다를 작성하였다.

- -

Maemo 의 Fennec 1.1는 안드로이드의 웹킷기반 브라우저에 의해 각 CSS의 "픽셀"을 1.5 하드웨어 픽셀로 사용한다. 이는 initial-scale=1 로 정의된 페이지를 Maemo의 Fennec과 아이폰의 사파리, 그리고 HDPI 와 MDPI 모두의 안드로이드 브라우저에서 거의 동일한 물리적 사이즈로 렌더링한다는 뜻이다. 이는 CSS 2.1 명세서에 의해 아래와 같이 정의되어있다:

- -
-

만약 출력장치의 픽셀밀도가 일반적인 컴퓨터 디스플레이와 상이하게 다를경우, user agent는 반드시 픽셀값을 조절해야 한다. It is recommended that the pixel unit refer to the whole number of device pixels that best approximates the reference pixel. It is recommended that the reference pixel be the visual angle of one pixel on a device with a pixel density of 96dpi and a distance from the reader of an arm's length. 

-
- -

웹 개발자들에게 이는 세로모드에서 scale=1로 지정됐을 경우, 위에서 언급된 장치들상에서  320px이 가로로 최대가 되어야 하며,  역시 레이아웃과 이미지들도 마찬가지로 조절이 되어야 함을 의미한다. 하지만 모든 모바일 장치들이 같은 가로 값을 가지지 않는다는 점을 기억해야한다. 작성된 페이지는 가로모드뿐만 아니라, 아이패드와 안드로이드 타블렛과 같은 더 큰 장치들에서도 잘 동작되어야 한다.

- -

240-dpi 화면상에서, initial-scale=1로 정의된 페이지는 Fennec과 안드로이드 웹킷에서 150%로 확대된다. 페이지의 텍스트들은 부드럽고 또렷해질것이나, 아마도 비트맵 이미지들은 최대 해상도에서 이점을 가지지 못한다. 이러한 스크린에서 또렷한 이미지를 보여주기 위해서는, 이미지나 전체적인 레이아웃을 최종 디자인의 150%(아이폰의 레티나 디스플레이와 같은 320-dpi장치들을 지원하기 위해서는 200%이다)로 작성하고, CSS나 viewport속성을 이용해 사이즈를 줄여 보여줄수도 있다.

- -

기본 비율은 디스플레이의 밀도에 따라 달라진다. 200dpi이하의 밀도를 갖는 디스플레이에서는 1.0이다. 200에서 300dpi사이의 장치에서는, 1.5가 된다. 300dpi이상의 장치에서는 소수점 없는 정수가 된다.(밀도/150dpi). 기본 비율은 viewport 크기가 1일때만 참이 됨을 기억하라. 그렇지 않을 경우 CSS픽셀과 장치의 픽셀간 관계는 현재의 zoom 레벨에 따라 달라진다.

- -

뷰포트 너비 와 스크린 너비

- -

많은 사이트에서 세로보기 모드로 iPhone 디스플레이에 정확하게 맞도록 뷰포트의 너비를 "width = 320, initial-scale = 1"로 설정합니다. 위에서 언급했듯이 Fennec1.0에서 특히 디스플레이가 가로 모드일때 문제가 발생했습니다. 이 문제를 해결하기 위해 Fennec 1.1은 필요한 경우 화면을 채우기 위해 뷰포트 너비를 확장합니다. 이런 현상은 Android 및 Mobile Safari의 동작과 일치하며 특히 iPad와 같은 대형 스크린 장치에 유용합니다. (Allen Pike의 iPad 사이트 용 뷰포트를 선택하여 적용해 보세요.)

- -

For pages that set an initial or maximum scale, this means the width property actually translates into a minimum viewport width. For example, if your layout needs at least 500 pixels of width then you can use the following markup. When the screen is more than 500 pixels wide, the browser will expand the viewport (rather than zoom in) to fit the screen:

- -
<meta name="viewport" content="width=500, initial-scale=1">
- -

Fennec 1.1 also adds support for minimum-scale, maximum-scale, and user-scalable, with defaults and limits similar to Safari's. These properties affect the initial scale and width, as well as limiting changes in zoom level.

- -

Mobile browsers handle orientation changes slightly differently. For example, Mobile Safari often just zooms the page when changing from portrait to landscape, instead of laying out the page as it would if originally loaded in landscape. If web developers want their scale settings to remain consistent when switching orientations on the iPhone, they must add a maximum-scale value to prevent this zooming, which has the sometimes-unwanted side effect of preventing users from zooming in:

- -
<meta name="viewport" content="initial-scale=1, maximum-scale=1">
- -

This is not necessary in Fennec; when the device changes orientation, Fennec updates the viewport size, the page layout, and JavaScript/CSS properties like device-width, based on its new window dimensions.

- -

모바일과 태블릿에 대한 일반 viewport 크기

- -

If you are wanting to know what mobile and tablet devices have which viewport widths, there is a comprehensive list of 모바일 및 태블릿 뷰포트 크기. This gives information such as viewport width on portrait and landscape orientation as well as physical screen size, operating system and the pixel density of the device.

- -

표준

- - - - - - - - - - - - - - - - -
사양상태댓글
{{SpecName('CSS3 Device', '#viewport-meta', '<meta name="viewport">')}}{{Spec2('CSS3 Device')}}Non-normatively describes the Viewport META element
- -

There is clearly demand for the viewport meta tag, since it is supported by most popular mobile browsers and used by thousands of web sites. It would be good to have a true standard for web pages to control viewport properties. As the standardization process proceeds, we at Mozilla will work to make sure we can implement any changes made during standardization.

diff --git a/files/ko/mozilla/participating_in_the_mozilla_project/index.html b/files/ko/mozilla/participating_in_the_mozilla_project/index.html deleted file mode 100644 index 834c5cb808..0000000000 --- a/files/ko/mozilla/participating_in_the_mozilla_project/index.html +++ /dev/null @@ -1,98 +0,0 @@ ---- -title: Participating in the Mozilla project -slug: Mozilla/Participating_in_the_Mozilla_project -translation_of: Mozilla/Participating_in_the_Mozilla_project ---- -

버그를 고치거나 모질라 플랫폼 코드를 개선하는 작업에 관심이 있다면, 이 곳은 여러분이 작업하는데 필요한 문서를 찾을 수 있는 곳 입니다.

- - - - - - - -
-

General topics

-
-
- Mozilla developer guide
-
- 모질라 코드베이스 개선을 위한 개발 팁과 가이드.
-
- Mozilla source code
-
- 다운로드 또는 버전 컨트롤을 통해서 모질라 코드를 얻는 방법과 여러분이 수정한 코드를 소스 코드 트리에 포함시키는 방법에 관한 정보.
-
- Build documentation
-
- 파이어폭스와 썬더버드 같은 모질라 프로젝트를 빌드하는 방법에 관한 정보. 이 페이지는 좀 더 정리를 해야할 필요가 있음.
-
- The Mozilla platform
-
- 모질라 플랫폼의 모든 API와 각 종 기술들(technologies)을 사용하는 방법에 관한 정보.
-
- Documenting Mozilla
-
- 모질라와 오픈 웹에 관한 새로운 문서를 적성하거나 기존의 문서 개선에 도움을 주는 방법.
-
- Debugging
-
- 모질라 코드 디버깅시, 유용한 팁과 가이드라인.
-
- Quality assurance
-
- 테스트와 버그 추적(tracking)에 관한 정보.
-
- Localization
-
- 모질라 프로젝트와 문서 등을 여러 언어로 번역에 필요한 참고할 문서들. 
-
- Glossary
-
- 모질라 해커들이 사용하는 용어와 정의.
-
-

Project pages

-
-
- Thunderbird
-
- 모질라 이메일 클라이언트
-
- Sunbird
-
- 모질라 달력(calendar) 프로젝트
-
-
-

Tools

-
-
- Bugzilla
-
- 모질라 프로젝트의 여러 이슈들을 추적하는데 사용되는 버그질라 (Bugzilla) 데이터베이스.
-
- MXR
-
- 웹 상에서 모질라 소스 코드를 보거나 특정 코드를 찾는데 사용되는 프로그램.
-
- Bonsai
-
- 본자이(Bonsai)는 누군가 소스 코드 파일을 수정했을 때, 이를 누가 수정하였는지 알려주는 프로그램.
-
- Tinderbox
-
- 틴더박스(Tinderbox)는 소스 코드 트리가 성공적으로 빌드 되었는지 아닌지를 보여줍니다. 여러분이 현재 올바르게 빌드된 소스 코드 트리를 가지고 작업하는지 알아보기 위해서는 소스 코드를 체크인하거나 체크아웃할 때 반드시 소스 코드 트리의 상태를 확인 하세요. 
-
- Crash tracking
-
- 사코로(Socorro)와 토크백(Talkback) 충돌(crash) 보고 시스템에 관한 정보.
-
- Performance tracking
-
- 모질라 프로젝트의 성능(performance) 정보를 보세요.
-
- Developer forums
-
- 모질자 개발 이슈들에 대한 이야기를 할 수 있는 토론 포럼의 주제별 목록
-
-
-

 

diff --git a/files/ko/mozilla/persona/bootstrapping_persona/index.html b/files/ko/mozilla/persona/bootstrapping_persona/index.html deleted file mode 100644 index 126b3d7a43..0000000000 --- a/files/ko/mozilla/persona/bootstrapping_persona/index.html +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: Persona Hosted Services -slug: Mozilla/Persona/Bootstrapping_Persona -translation_of: Archive/Mozilla/Persona/Bootstrapping_Persona ---- -

To be truly successful and decentralized, Persona needs support from three different groups:

- -

This creates a chicken-and-egg problem: none of these groups would significantly benefit unless there was a critical mass of users, but a distributed system can't get a critical mass of users without support from the above groups.

-

To solve this problem, https://login.persona.org hosts three resources:

-
    -
  1. A fallback Identity Provider, which vouches for users whose email providers don't support Persona.
  2. -
  3. A cross-browser, JavaScript implementation of the navigator.id APIs for browsers without native support.
  4. -
  5. A hosted verification API to make it easy for sites to verify user credentials.
  6. -
-

Together, this allows web sites to offer Persona to users regardless of browser and without email providers needing to get involved.

-

These services are temporary, and the Persona system is designed such that they transparently and automatically drop away as native support gets added to browsers and email providers. Thus, they will become less relevant as Persona matures, and may eventually be removed all together. At that point, https://login.persona.org won't feature at all in the Persona system.

-

Fallback Identity Provider

-

Any domain can become an Identity Provider as long as relying parties are willing to trust the certificates issued by that domain. We expect email providers to act as an IdPs for the addresses they administer, making the user experience of Persona seamless for those users.  It allows the user to leverage their existing relationship with the email provider when authenticating at other sites.

-

However, email providers won't become IdPs until there is significant demand from their users. In the meantime, Mozilla operates a fallback IdP at https://login.persona.org. This fallback allows users to sign into sites with their existing email address, regardless of whether or not the email provider supports Persona. The fallback IdP will certify email addresses from any domain using its own authentication flow and its own password, so long as the user is able to prove control of an address by clicking a link in a verification email.

-

Once an email provider supports Persona natively, its users will transparently begin use it instead of the fallback IdP.

-

Cross-browser API Library

-

For Persona to work, the user's browser must support the navigator.id API. Eventually, browsers will add native support for these APIs, but until then a cross-browser implementation is available at https://login.persona.org/include.js. By including this file, web sites can already begin using Persona. Once native implementations of the API are available, the library will automatically defer to those.

-

Remote verification service

-

At https://login.persona.org Mozilla hosts a remote verification service that web sites can use to verify identity assertions sent from users. This makes it simpler for web sites to support Persona as it takes care of parsing the assertion and cryptographically verifying user identities.

-

Once the Persona data formats stabilize, verification will most likely be done locally on each site's server. This transition is especially important for user privacy, since it will make it impossible for the fallback IdP to track its users. Even with remote verification, users of native IdPs can't be tracked by that IdP.

diff --git a/files/ko/mozilla/persona/browser_compatibility/index.html b/files/ko/mozilla/persona/browser_compatibility/index.html deleted file mode 100644 index b11f987e57..0000000000 --- a/files/ko/mozilla/persona/browser_compatibility/index.html +++ /dev/null @@ -1,86 +0,0 @@ ---- -title: Browser compatibility -slug: Mozilla/Persona/Browser_compatibility -translation_of: Archive/Mozilla/Persona/Browser_compatibility ---- -

Supported Browsers

-

Persona is developed, tested, and supported with the following browsers. Thanks to Persona's cross-platform JavaScript library, users do not need add-ons in order to use Persona.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Desktop Browsers
Internet Explorer8.0*, 9.0, 10.0** (but see Compatibility Mode below)
FirefoxCurrent Stable, Beta, Aurora, Nightly, and Extended Support Releases
- Previous Stable Release
ChromeLatest Stable Release
SafariLatest Stable Release
OperaLatest Stable Release
iOS Browsers
Mobile SafariiOS 5.x — 6.x
Android Browsers
Default Browser2.2 — 4.x
FirefoxCurrent Stable, Beta, Aurora, and Nightly Releases
- Previous Stable Release
ChromeLatest Stable Release
-

*: For Windows XP. : For Windows Vista and Windows 7. **Windows 8.  : As time allows.

-

Unsupported Browsers

- -

Internet Explorer "Compatibility Mode"

-

From version 8.0 onwards Internet Explorer supports a feature called Compatibility Mode, in which the browser may be instructed to emulate a pre-8.0 version when rendering a page. This feature may be controlled in three different ways

-
    -
  1. as a local setting in the browser
  2. -
  3. based on the presence and value of the DOCTYPE declaration in the page
  4. -
  5. as an instruction sent from the site, using the "X-UA-Compatible" header either as an HTTP header or as a <meta> tag in the page. This method overrides the other two.
  6. -
-

Because versions of Internet Explorer earlier than 8.0 are not supported by Persona, any version of Internet Explorer which is configured to emulate a pre-8.0 version will also not function with Persona. This is typically for one of the following reasons:

- -

For more information, see "Understanding Compatibility Modes in Internet Explorer 8" and "IE8 and IE9 Complications".

-

Other Browsers

-

Despite not being explicitly supported, any browser that includes both {{ domxref("window.postMessage()") }} and {{ domxref("Storage", "localStorage") }} should work. These APIs have been available in all major browsers since March 2010.

-

Known Issues

- diff --git a/files/ko/mozilla/persona/index.html b/files/ko/mozilla/persona/index.html deleted file mode 100644 index 5b48646237..0000000000 --- a/files/ko/mozilla/persona/index.html +++ /dev/null @@ -1,137 +0,0 @@ ---- -title: Persona -slug: Mozilla/Persona -tags: - - Persona -translation_of: Archive/Mozilla/Persona ---- -
-

연락 및 도움을 얻고 싶다면!

- -

블로그를 확인하거나, 메일링 리스트에 가입하거나, IRC에서 #identity를 찾아보세요.

-
- -

Mozilla Persona는 웹을 위한 크로스-브라우저 로그인 시스템으로, 쉽고 알맞은 사용이 가능합니다. Persona는 모든 주요 브라우저에서 작동하며, 오늘 당장 시작할 수 있습니다.

- -

왜 우리와 우리의 사이트가 Persona를 사용해야 합니까?

- -
    -
  1. Persona는 사이트별 암호에 대한 사용자의 생성, 관리, 안전하게 관리하는 부담을 사용자와 웹사이트로부터 완전히 제거합니다.
  2. -
  3. Persona는 사용이 간편합니다. 두 번의 클릭 만으로도 Persona 사용자는 VoostThe Times Crossword와 같은 사이트에 새로운 계정을 생성하지 않고도 로그인할 수 있습니다.
  4. -
  5. Persona는 쉽게 구현할 수 있습니다. 개발자는 반나절만에 Persona를 사이트에 추가할 수 있습니다.
  6. -
  7. 무엇보다도, 변경 불가능이 없습니다. 개발자는 모든 사용자의 확인 된 E-Mail 주소를 받고, 사용자는 Persona에 어떠한 E-Mail 주소도 사용할 수 있습니다.
  8. -
- -

여기에 더해, Persona는 점점 나아지고 있습니다: Persona는 공개된 분산프로트콜로 제작되었으며, 직접 브라우저와 통합할 수 있으며 이메일 제공자가 네이티브 지원을 할 수 있도록 합니다. Persona를 사용한 사이트들은 오늘날 코드를 전혀 바꾸지 않아도 자동적으로 UX가 개선됩니다.

- -

시작하기 위해 읽어보세요!

- -
노트: Persona는 개발 중입니다. 블로그로부터 새로운 기능에 대해 알아보거나, 메일링 리스트에 가입하여 여러분의 의견을 피드백 해주세요!
- -

사이트에서 Persona 사용하기

- - - - - - - - - - - - -
-

시작하기

- -
-
왜 Persona를 사용해야 합니까?
-
여러분의 사이트에 Persona를 지원해야 하는지, 그리고 어떻게 다른 ID와 인증 시스템이 다른지 비교해보십시오.
-
빠른 설치
-
여러분의 웹 사이트에 Persona를 빠르게 추가하는 방법을 알아보세요.
-
-
-

Persona API 레퍼런스

- -

navigator.id API 레퍼런스

- -
-
웹 개발자가 Persona를 사이트에 추가할 수 있는 navigator.id 객체를 위한 레퍼런스입니다.
-
인증 API 레퍼런스
-
원격 인증 API에 대한 레퍼런스를 아래 링크에서 제공하고 있습니다.
-
https://verifier.login.persona.org/verify
-
-
-

가이드

- -
-
보안 고려 사항
-
따라하기와 기술은 여러분의 Persona 개발을 안전하게 만듭니다.
-
브라우저 호환성
-
브라우저의 Persona 지원에 대해 자세히 알아보세요.
-
국제화
-
다른 언어에서는 어떻게 Persona를 관리하는지 알아보세요.
-
운영자 가이드
-
Persona에 도움을 보탠 사이트에서 제공하는 팁을 알아보세요.
-
-
-

리소스

- -
-
라이브러리와 플러그인
-
당신이 가장 선호하는 프로그래밍 언어, 웹 프레임워크, 블로그 또는 컨텐츠 관리 시스템(CMS)의 드롭인 라이브러리를 찾아보세요.
-
Persona 설명서
-
Persona 사이트를 위한 예제 소스 코드입니다. C# (MVC3), PHP, Node.JS와 그 외에 대한 미리보기를 포함합니다.
-
 
-
UI 가이드라인
-
사이트 이용자들에게 어떻게 Persona 로그인 시스템을 선사할 수 있는 지 담겨있습니다.
-
 
-
-
- -

 

- - - - - - - - -
-

ID 제공에 대한 정보

- -

만약 여러분이 E-Mail 제공 업체 또는 다른 ID 제공 서비스라면 Persona ID 제공자에 대해 링크를 통해 익혀보세요.

- -
-
IdP 개요
-
Persona ID 제공자의 고수준 보기.
-
IdP 구현
-
IdP에 대해 기술적으로 세세한 가이드입니다.
-
개발 팁
-
A set of tips and tricks useful while developing a new Identity Provider.
-
.well-known/browserid
-
IdP가 광고를 사용할 경우 프로토콜에 대한 지원과 .well-known/browserid 파일에 대한 목적과 구조에 대한 개요입니다.
-
-
-

Persona 프로젝트

- -
-
어휘
-
BrowserID와 Persona의 용어 정의입니다.
-
FAQ
-
일반적인 질문에 대한 답변입니다.
-
프로토콜 개요
-
기본적인 BrowserID 프로토콜의 중간 수준 기술 개요입니다.
-
암호화
-
Persona와 BrowserID에 대한 암호화 개념을 살펴봅니다.
-
명세
-
세부적인 기술은 여기에 있습니다.
-
Persona 웹 사이트
-
To get Persona going, we're hosting three services at https://login.persona.org: a fallback Identity Provider, a portable implementation of the {{ domxref("navigator.id") }} APIs, and an identity assertion verification service.
-
Persona 소스코드
-
Persona의 소스코드를 GitHub에서 찾으실 수 있습니다!
-
-
- -

 

diff --git a/files/ko/mozilla/persona/quick_setup/index.html b/files/ko/mozilla/persona/quick_setup/index.html deleted file mode 100644 index d39d67820f..0000000000 --- a/files/ko/mozilla/persona/quick_setup/index.html +++ /dev/null @@ -1,248 +0,0 @@ ---- -title: 빠른 시작 -slug: Mozilla/Persona/Quick_Setup -translation_of: Archive/Mozilla/Persona/Quick_Setup ---- -

5가지 단계를 통해 Persona 로그인 시스템을 여러분의 사이트에 추가할 수 있습니다.:

- -
    -
  1. 페이지에 Persona 자바스크립트 라이브러리를 포함시킵니다.
  2. -
  3. "로그인", "로그아웃"버튼을 추가합니다
  4. -
  5. Watch for login and logout actions.
  6. -
  7. 이용자의 신원을 검증합니다.
  8. -
  9. 가장 잘 된 연습을 다시 재연합니다..
  10. -
- -

여러분은 시작한 지 반나절 만에 작동하도록 할 수 있을 것이지만, 먼저 해야 할 것이 있습니다: 만약 여러분이 Persona를 여러분의 사이트에 사용하고자 한다면, 조금 기다린 후 Persona notices 메일링 리스트에 가입해주세요. It’s extremely low traffic, only being used to announce changes or security issues which might adversely impact your site.

- -

1단계: Persona 라이브러리 추가하기

- -

Persona는 어느 브라우저에서나 작동되도록 설계되었으며 모든 주요 웹브라우저들과 모바일 브라우저에서 작동합니다.

- -

In the future we expect browsers to provide native support for Persona, but in the meantime we provide a JavaScript library that fully implements the user interface and client-side part of the protocol. By including this library, your users will be able to sign in with Persona whether or not their browser has native support.

- -

Once this library is loaded in your page, the Persona functions you need ({{ domxref("navigator.id.watch()", "watch()") }}, {{ domxref("navigator.id.request()", "request()") }}, and {{ domxref("navigator.id.logout()", "logout()") }}) will be available in the global navigator.id object.

- -

To include the Persona JavaScript library, place this script tag at the bottom of the page body:

- -
<script src="https://login.persona.org/include.js"></script>
-
- -

You must include this on every page which uses {{ domxref("navigator.id") }} functions. Because Persona is still in development, you should not self-host the include.js file.

- -

Suppressing Compatibility Mode

- -

You should also make sure users of Internet Explorer can't use Compatibility Mode, as this will break Persona. To do this:

- - - -

For more information, see the notes in IE Compatibility Mode and "IE8 and IE9 Complications".

- -

Step 2: Add login and logout buttons

- -

Because Persona is designed as a DOM API, you must call functions when a user clicks a login or logout button on your site. To open the Persona dialog and prompt the user to log in, you should invoke {{ domxref("navigator.id.request()") }}. For logout, invoke {{ domxref("navigator.id.logout()") }}. Note, the call to {{ domxref("navigator.id.logout()", "logout()") }} must be made in the click handler of the logout button.

- -

For example:

- -
var signinLink = document.getElementById('signin');
-if (signinLink) {
-  signinLink.onclick = function() { navigator.id.request(); };
-}
-
-var signoutLink = document.getElementById('signout');
-if (signoutLink) {
-  signoutLink.onclick = function() { navigator.id.logout(); };
-}
-
- -

What should those buttons look like? Check out our Branding Resources page for premade images and CSS-based buttons!

- -

Step 3: Watch for login and logout actions

- -

For Persona to function, it must be told what to do when a user logs in or out. This is done by calling the {{ domxref("navigator.id.watch()") }} function and supplying three parameters:

- -
    -
  1. -

    The email address of the user currently logged into your site from this computer, or null if no one is logged in. For example, you might examine the browser's cookies to determine who is signed in.

    -
  2. -
  3. -

    A function to invoke when an onlogin action is triggered. This function is passed a single parameter, an “identity assertion,” which must be verified.

    -
  4. -
  5. -

    A function to invoke when an onlogout action is triggered. This function is not passed any parameters.

    -
  6. -
- -
-

Note: You must always include both onlogin and onlogout when you call {{ domxref("navigator.id.watch()") }}.

-
- -

For example, if you currently think Bob is logged into your site, you might do this:

- -
var currentUser = 'bob@example.com';
-
-navigator.id.watch({
-  loggedInUser: currentUser,
-  onlogin: function(assertion) {
-    // A user has logged in! Here you need to:
-    // 1. Send the assertion to your backend for verification and to create a session.
-    // 2. Update your UI.
-    $.ajax({ /* <-- This example uses jQuery, but you can use whatever you'd like */
-      type: 'POST',
-      url: '/auth/login', // This is a URL on your website.
-      data: {assertion: assertion},
-      success: function(res, status, xhr) { window.location.reload(); },
-      error: function(xhr, status, err) {
-        navigator.id.logout();
-        alert("Login failure: " + err);
-      }
-    });
-  },
-  onlogout: function() {
-    // A user has logged out! Here you need to:
-    // Tear down the user's session by redirecting the user or making a call to your backend.
-    // Also, make sure loggedInUser will get set to null on the next page load.
-    // (That's a literal JavaScript null. Not false, 0, or undefined. null.)
-    $.ajax({
-      type: 'POST',
-      url: '/auth/logout', // This is a URL on your website.
-      success: function(res, status, xhr) { window.location.reload(); },
-      error: function(xhr, status, err) { alert("Logout failure: " + err); }
-    });
-  }
-});
-
- -

In this example, both onlogin and onlogout are implemented by making an asynchronous POST request to your site’s backend. The backend then logs the user in or out, usually by setting or deleting information in a session cookie. Then, if everything checks out, the page reloads to take into account the new login state.

- -

Note that if the identity assertion can't be verified, you should call {{ domxref("navigator.id.logout()") }}: this has the effect of telling Persona that no one is currently logged in. If you don't do this, then Persona may immediately call onlogin again with the same assertion, and this can lead to an endless loop of failed logins.

- -

You can, of course, use AJAX to implement this without reloading or redirecting, but that’s beyond the scope of this tutorial.

- -

Here is another example, this time not using jQuery.

- -
function simpleXhrSentinel(xhr) {
-    return function() {
-        if (xhr.readyState == 4) {
-            if (xhr.status == 200){
-                // reload page to reflect new login state
-                window.location.reload();
-              }
-            else {
-                navigator.id.logout();
-                alert("XMLHttpRequest error: " + xhr.status);
-              }
-            }
-          }
-        }
-
-function verifyAssertion(assertion) {
-    // Your backend must return HTTP status code 200 to indicate successful
-    // verification of user's email address and it must arrange for the binding
-    // of currentUser to said address when the page is reloaded
-    var xhr = new XMLHttpRequest();
-    xhr.open("POST", "/xhr/sign-in", true);
-    // see http://www.openjs.com/articles/ajax_xmlhttp_using_post.php
-    var param = "assertion="+assertion;
-    xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
-    xhr.setRequestHeader("Content-length", param.length);
-    xhr.setRequestHeader("Connection", "close");
-    xhr.send(param); // for verification by your backend
-
-    xhr.onreadystatechange = simpleXhrSentinel(xhr); }
-
-function signoutUser() {
-    // Your backend must return HTTP status code 200 to indicate successful
-    // sign out (usually the resetting of one or more session variables) and
-    // it must arrange for the binding of currentUser to 'null' when the page
-    // is reloaded
-    var xhr = new XMLHttpRequest();
-    xhr.open("GET", "/xhr/sign-out", true);
-    xhr.send(null);
-    xhr.onreadystatechange = simpleXhrSentinel(xhr); }
-
-// Go!
-navigator.id.watch( {
-    loggedInUser: currentUser,
-         onlogin: verifyAssertion,
-        onlogout: signoutUser } );
-
- -

You must call navigator.id.watch() on every page with a login or logout button. To support Persona enhancements like automatic login and global logout for your users, you should call this function on every page of your site.

- -

Persona will compare the email address you've passed into loggedInUser with its own knowledge of whether a user is currently logged in, and who they are. If these don't match, it may automatically invoke onlogin or onlogout on page load.

- -

 

- -

Step 4: Verify the user’s credentials

- -

Instead of passwords, Persona uses “identity assertions,” which are kind of like single-use, single-site passwords combined with the user’s email address. When a user wants to log in, your onlogin callback will be invoked with an assertion from that user. Before you can log them in, you must verify that the assertion is valid.

- -

It’s extremely important that you verify the assertion on your server, and not in JavaScript running on the user’s browser, since that would be easy to forge. The example above handed off the assertion to the site’s backend by using jQuery’s $.ajax() helper to POST it to /auth/login.

- -

Once your server has an assertion, how do you verify it? The easiest way is to use a helper service provided by Mozilla. Simply POST the assertion to https://verifier.login.persona.org/verify with two parameters:

- -
    -
  1. assertion: The identity assertion provided by the user.
  2. -
  3. audience: The hostname and port of your website. You must hardcode this value in your backend; do not derive it from any data supplied by the user.
  4. -
- -

For example, if you’re example.com, you can use the command line to test an assertion with:

- -
$ curl -d "assertion=<ASSERTION>&audience=https://example.com:443" "https://verifier.login.persona.org/verify"
-
- -

If it’s valid, you’ll get a JSON response like this:

- -
{
-  "status": "okay",
-  "email": "bob@eyedee.me",
-  "audience": "https://example.com:443",
-  "expires": 1308859352261,
-  "issuer": "eyedee.me"
-}
-
- -

You can learn more about the verification service by reading The Verification Service API. An example /auth/login implementation, using Python, the Flask web framework, and the Requests HTTP library might look like this:

- -
@app.route('/auth/login', methods=['POST'])
-def login():
-    # The request has to have an assertion for us to verify
-    if 'assertion' not in request.form:
-        abort(400)
-
-    # Send the assertion to Mozilla's verifier service.
-    data = {'assertion': request.form['assertion'], 'audience': 'https://example.com:443'}
-    resp = requests.post('https://verifier.login.persona.org/verify', data=data, verify=True)
-
-    # Did the verifier respond?
-    if resp.ok:
-        # Parse the response
-        verification_data = resp.json()
-
-        # Check if the assertion was valid
-        if verification_data['status'] == 'okay':
-            # Log the user in by setting a secure session cookie
-            session.update({'email': verification_data['email']})
-            return 'You are logged in'
-
-    # Oops, something failed. Abort.
-    abort(500)
-
- -

For examples of how to use Persona in other languages, have a look at the cookbook.

- -

The session management is probably very similar to your existing login system. The first big change is in verifying the user’s identity by checking an assertion instead of checking a password. The other big change is ensuring that the user’s email address is available for use as the loggedInUser parameter to {{ domxref("navigator.id.watch()") }}.

- -

Logout is simple: you just need to remove the user’s session cookie.

- -

Step 5: Review best practices

- -

Once everything works and you’ve successfully logged into and out of your site, you should take a moment to review best practices for using Persona safely and securely.

- -

If you're making a production site, have a look at the implementor's guide, where we've collected tips for adding the kind of features often needed in real-world login systems.

- -

Lastly, don’t forget to sign up for the Persona notices mailing list so you’re notified of any security issues or backwards incompatible changes to the Persona API. The list is extremely low traffic: it’s only used to announce changes which may adversely impact your site.

diff --git a/files/ko/mozilla/persona/user_interface_guidelines/index.html b/files/ko/mozilla/persona/user_interface_guidelines/index.html deleted file mode 100644 index 4be5607bf0..0000000000 --- a/files/ko/mozilla/persona/user_interface_guidelines/index.html +++ /dev/null @@ -1,113 +0,0 @@ ---- -title: UI 가이드라인 -slug: Mozilla/Persona/User_interface_guidelines -tags: - - Persona -translation_of: Archive/Mozilla/Persona/User_interface_guidelines ---- -

Presenting sign-in options to users without confusing them can be difficult, especially if your site offers multiple sign-in options. This article aims to provide guidance about the best way to present Persona sign-in to your users. It covers four different possible approaches, depending on the different sign-in options the website supports:

- - - -

In each approach there are three user interface elements to consider:

- - - -

None of the recommendations here are mandatory.

- -

Persona 전용으로

- -

Persona가 유일한 로그인 옵션으로 제공된다면, 제공되는 경우의 수가 하나 뿐이기 때문에, 이용자의 혼란이 줄어들 것입니다., this offers the least confusing user experience, because the user has fewer choices to make.

- - - -

여러분은 그냥 "로그인 / 회원가입"이라고 표시된 링크 하나를 보여주면 됩니다. 사용자들이 어떠한 방법으로 로그인 하는 지 미리 알도록 하기 위해서, Persona 아이콘을 포함하는 것을 추천합니다.
-
-

- -

Sign up view

- -

You don't need to implement the sign up view at all, as Persona takes care of it for you.

- -

Sign in view

- -

Similarly, you don't need to implement the Sign in view, as Persona takes care of it.

- -

Persona + 일반적인 로그인 방법

- -

In this case you support Persona alongside traditional sign-in, where you ask users for a username and password which you then store yourself.

- - - -

You can show the text "Sign up/Sign in", with separate links for each choice:

- -

Sign up view

- -

When a user clicks "Sign up" you'll need to offer them the choice to sign up using Persona or to create a new username and password on your site.

- -

In this case it's recommended that the button for the Persona option includes the Persona icon and is labeled "Email" rather than "Persona". Users don't know what "Persona" means and won't see it as a valid sign-up option:

- -

- -

Sign in view

- -

When the user clicks "Sign in" you'll offer them the choice to sign in with Persona or the account they created on your site. This can be just like the "Sign up view", except you won't include the password confirmation field:

- -

- -

Persona + federated sign-in

- -

In this case you support Persona alongside one or more other federated sign-in options such as Facebook Connect or Google+.

- - - -

You can show the text "Sign up/Sign in", with separate links for each choice:

- -

Sign up view

- -

When a user clicks "Sign up" you'll need to offer them the choice to sign up using Persona or to sign up using one of the other federated identity options.

- -

In this case it's recommended that the button for the Persona option includes the Persona icon and is labeled "Email" rather than "Persona". Users don't know what "Persona" means and won't see it as a valid sign-up option:

- -

- -

Sign in view

- -

When the user clicks "Sign in" you'll offer them the choice to sign in with Persona or one of the other federated sign-in options. This can be just like the "Sign up view":

- -

- -

Persona + traditional sign-in + federated sign-in

- -

In this case you support everything: Persona, traditional sign-in, and one or more additional federated sign-in options.

- - - -

You can show the text "Sign up/Sign in", with separate links for each choice:

- -

Sign up view

- -

When a user clicks "Sign up" you'll need to offer them the choice to sign up using Persona, to create a new username and password on your site, or to sign up using one of the other federated identity options.

- -

In this case it's recommended that the button for the Persona option includes the Persona icon and is labeled "Email" rather than "Persona". Users don't know what "Persona" means and won't see it as a valid sign-up option:

- -

- -

Sign in view

- -

When the user clicks "Sign in" you'll offer them the choice to sign in with Persona, one of the other federated options, or the account they created on your site. This can be just like the "Sign up view", except you won't include the password confirmation field:

- -

- -

More Info

- -

You can find more information about Persona's visual design in Sean Martell's style primer.

diff --git a/files/ko/mozilla/persona/why_persona/index.html b/files/ko/mozilla/persona/why_persona/index.html deleted file mode 100644 index 7f3552c1b6..0000000000 --- a/files/ko/mozilla/persona/why_persona/index.html +++ /dev/null @@ -1,31 +0,0 @@ ---- -title: 왜 Persona를 사용해야 합니까? -slug: Mozilla/Persona/Why_Persona -translation_of: Archive/Mozilla/Persona/Why_Persona ---- -

 

-

아이디와 비밀번호로 사용자 인증을 제공하는 일반적인 시스템은 불안합니다. 왜냐하면 사용자는 새로운 사이트나 서비스에 가입할 때 마다 복잡한 비밀번호를 만들어서 사용하고 그것을 기억해야 하고, 모든 사이트는 저장된 비밀번호를 안전하게 보관해야 합니다. 그러나 최근 신뢰할만한 기업들 마저 사용자 정보를 위험으로부터 지켜내지 못하는 일이 눈에 띄게 증가하고 있습니다.

-

Persona는 오픈되고, 분산된 웹 규모의 식별 시스템으로써 각 사이트마다 제공하는 비밀번호 인증 시스템을 대체합니다. 이 시스템은 Facebook Connect와 같이 중앙 집중식 인프라에 의존하지 않고 가용성을 제공하고, 개인 정보 보호와 관련된 결점을 보완하는 OpenID와 같은 시스템입니다. 

-

Persona는 사이트별 비밀번호를 제거합니다

-

Persona는 사이트별 비밀번호를 입력하는 대신 사용자가 단지 두 번의 클릭으로 사이트에 로그인 할 수 있도록 간단한 방법을 제공합니다. 이것은 안전하고, 보안적이고, 공개 키 암호화 방식의 상위에서 구축되었습니다. 패스워드 대신에 사용자의 브라우져는 하나의 사이트에만 유효하고, 몇 분 후에 만료되는 "신원 증명" 암호를 생성합니다. Persona를 사용하는 웹 사이트는 개별 비밀번호를 사용하지 않기 때문에 더 이상 비밀번호 데이터베이스의 보안적인 저장이나 잠재적 위험으로부터 벗어날 수 있습니다.

-

이 빠른 로그인 절차는 사용자가 새로운 사이트에 방문 했을 때 불편함을 덜어줍니다.

-

Persona의 ID는 E-Mail 주소입니다

-

Persona는 각종 형태의 사용자명 보다 E-Mail 주소를 ID로 사용합니다. 이것은 사용자와 개발자 모두에게 몇 가지 장점을 제공합니다.

-

사용자 입장에서의 장점

- -

개발자 입장에서의 장점

- -

E-Mail은 이미 셀 수 없는 공급자들로부터 수십억 개의 계정 갖추어진 완전한 분산 시스템이라는 것은 말할 필요도 없을 것입니다.

-

Persona는 다른 싱글-사인-온(SSO) 공급자와 어떻게 다른가?

-

Persona는 안전하고, 보안적이고, 쉽습니다. 사용자의 개인 정보, 권한, 선택을 다른 공급자가 하지 않거나, 하지 못하는 방법으로 보호합니다.

-

Facebook이나 Google+와 같은 대부분의 소셜 네트워크는 사용자에게 실명 사용을 요구하고, 하나의 계정만을 사용하도록 제한합니다. Persona는 E-Mail 주소 위에서 만들어 짐으로써 사용자가 자신의 직장, 집 그리고 학교와 같은 각기 다른 정체성을 구분할 수 있도록 허용합니다.

-

Persona는 오픈되고, 분산된 시스템입니다. E-Mail 주소를 가진 누구나 Persona를 이용해 사이트에 로그인 할 수 있습니다. 뿐만 아니라 누구나 E-Mail과 같이 자신의 ID 공급자를 호스팅하거나 다른 기관에 양도할 수 있습니다. 이것이 단일 계정을 요구하는 중앙 집중식 소셜 로그인 서비스와 다른 부분입니다.

-

Persona는 사용자의 개인 정보를 보호하기 위해 인증 과정 중간에 사용자의 브라우저를 넣은 새로운 접근 방식을 가집니다. 브라우저는 사용자의 E-Mail 공급자로부터 자격 증명을 획득한 이후, 다시 돌아와서 웹사이트에게 자격 증명을 제공합니다. E-Mail 공급자는 사용자를 추적하지 못하지만 웹사이트는 여전히 암호화 된 자격 증명을 확인해 사용자를 식별할 수 있습니다. OpenID를 포함한 대부분의 다른 시스템은 사용자의 로그인을 허용하기 전에 사이트에 "phone home"(역주: OAuth와 같은 시스템에서 콘텐츠 공급자가 사용자 식별 정보를 서비스 공급자에게 확인하여 식별을 확인하는 방식)을 요구합니다.

diff --git a/files/ko/mozilla/projects/emscripten/index.html b/files/ko/mozilla/projects/emscripten/index.html deleted file mode 100644 index 9ce63c51cc..0000000000 --- a/files/ko/mozilla/projects/emscripten/index.html +++ /dev/null @@ -1,37 +0,0 @@ ---- -title: Emscripten -slug: Mozilla/Projects/Emscripten -translation_of: Mozilla/Projects/Emscripten ---- -

엠스크립튼은 자바스크립트 컴파일러의 LLVM입니다. 엠스크립튼은 LLVM 바이트 코드를 받아 웹에서 동작할 수 있는 자바스크립트로 컴파일해줍니다. (예를 들어, Clang을 이용한 C/C++ 코드나 그 외의 언어로부터 생성된 LLVM 바이트 코드)

- -
-

중요: 이 페이지는 엠스크립튼에 대한 굉장히 간략한 설명만을 다루고 있습니다. 엠스크립튼에 대해 더욱 자세히 알고 싶다면, 공식 홈페이지의 엠스크립튼 Wiki에서 정보를 찾아보세요.

-
- -

엠스크립튼을 사용하면, 당신은

- - - -

엠스크립튼은 네이티브 코드를 웹에서 사용 가능하게 만들어줍니다. 아시다시피 웹은 표준 기반이면서, 독립적인 서로 호환 가능한 수많은 구현체들이 존재하며, PC부터 아이패드까지 모든 곳에서 동작하는 플랫폼이지요!

- -

엠스크립튼을 이용하면 C나 C++ 개발자들은 일일히 코드를 자바스크립트로 포팅하는 고된 작업을 할 필요가 없습니다. 아니, 아예 자바스크립트를 배울 필요도 없습니다. 웹 개발자들에게도 또한 이점이 있는데, 이미 존재하는 수많은 네이티브 유틸리티나 라이브러리들을 그들의 사이트에 사용할 수 있기 때문입니다.

- -

사실상 거의 모든 포팅 가능한 C나 C++ 코드베이스가 엠스크립튼을 이용하여 자바스크립트로 컴파일 될 수 있으며, 그 범위는 그래픽 렌더링이나 소리 재생, 파일 처리 등을 요구하는 고성능 게임에서부터 Qt와 같은 어플리케이션 프레임워크까지 다양합니다.

- -

엠스크립튼은 빠른 코드를 생성해내며, 기본적인 컴파일 결과 값은 네이티브 속도에 가까운 성능을 낼 수 있도록 고성능으로 최적화 된 자바스크립트의 서브셋인 asm.js 포맷입니다.

- -
-

주의: 꽤 재미있을 것 같지요? 엠스크립튼에 대해 좀 더 읽어보고, 한번 직접 데모를 실행시켜본 다음에, 어떻게 사용하는지 시작해보세요.

-
- -

비슷한 주제의 다른 MDN 글

- - diff --git a/files/ko/mozilla/projects/index.html b/files/ko/mozilla/projects/index.html deleted file mode 100644 index c1e43934a2..0000000000 --- a/files/ko/mozilla/projects/index.html +++ /dev/null @@ -1,14 +0,0 @@ ---- -title: Projects -slug: Mozilla/Projects -tags: - - Mozilla - - NeedsContent - - NeedsTranslation - - Projects - - TopicStub -translation_of: Mozilla/Projects ---- -

{{ draft() }}

-

Below you'll find links to documentation about various Mozilla projects; these are often parts of Firefox or other products, but may also be used in other projects as well.

-

{{ LandingPageListSubpages() }}

diff --git a/files/ko/mozilla/projects/l20n/index.html b/files/ko/mozilla/projects/l20n/index.html deleted file mode 100644 index 9f4a8dcbfb..0000000000 --- a/files/ko/mozilla/projects/l20n/index.html +++ /dev/null @@ -1,126 +0,0 @@ ---- -title: L20n -slug: Mozilla/Projects/L20n -translation_of: Mozilla/Projects/L20n ---- -
-

일러두기: 이 문서는 아직 드래프트 단계이거나 최신 버전이 아닐 수 있습니다. 가장 최근 문서는 깃헙 문서를 확인하세요.

-
- -
L20n은 아주 간단한 코드로 여러분이 사용하는 언어의 힘을 더욱 끌어올릴 수 있는 JavaScript 지역화 프레임워크입니다.
- -
-
-

L20n 소개

- -

L20n reinvents software localization. Users should be able to benefit from the entire expressive power of the natural language. L20n keeps simple things simple, and at the same time makes complex things possible.

- -

Through L20n, Mozilla is creating a new generation of technology that places more power in localizers' hands. L20n lets localizers reach higher levels of free linguistic expression by sharpening the divide between localization and application logic. It allows to adapt your web application not only to languages and cultures, but also contextual data, user gender and screen dimensions.

-
- -
-

What L20n looks like

- -

Here is a simple, straightforward example showing an English string being provided:

- -
<brandName "Firefox">
-<about "About \{{ brandName }}">
- -

Here is the same string being provided in Slovenian:

- -
<brandName {
-  nominative: "Firefox",
-  genitive: "Firefoxa",
-  dative: "Firefoxu",
-  accusative: "Firefox",
-  locative: "Firefoxu",
-  instrumental: "Firefoxom"
-}>
-<about "O \{{ brandName.locative }}">
-
-
- -

 

- -
-
-

For Developers

- -

Documentation for developers wanting to implement localization functionality on their web apps using L20n.

- -
-
Internationalization for your web app
-
First read for developers looking to use the L20n infrastructure.
-
L20n's HTML bindings
-
Tutorial on implementing L20n in your HTML code.
-
L20n JavaScript API
-
An API for l20n.js.
-
L20n syntax cheatsheet for developers
-
A simple cheatsheet to help developers as they add L20n to their localization infrastructure.
-
-
- -
-

For Localizers

- -

Documentation for Localizers creating localized content for a project that uses L20n.

- -
-
Learn the L20n syntax
-
How to naturally localize applications using L20n. Complete with use cases and examples of L20n in action.
-
Localization use-cases
-
How to naturally localize applications using L20n. Complete with use cases and examples of L20n in action.
-
L20n and Translation Memory eXchange (TMX)
-
How L20n impacts the Translation Memory eXchange standard for translation memory data.
-
L20n syntax cheatsheet for localizers
-
A simple cheatsheet to help localizers as they localize projects with L20n.
-
-
- -
- - -

Some additional resources for developers and localizers involved with L20n.

- -
-
L20n.org
-
You can try L20n live in your browser on the project page.
-
L20n Tinker
-
Test out your own L20n code in L20n Tinker.
-
GitHub
-
Where the main code for the L20n infrastructure and design spec lives.
-
Wiki page
-
Info about the project to develop L20n.
-
-
-
- - - -
    -
  1. For Developers - -
      -
    1. Internationalization for your web app
    2. -
    3. L20n's HTML bindings
    4. -
    5. .lol file format
    6. -
    7. L20n syntax cheatsheet for developers
    8. -
    -
  2. -
  3. For Localizers -
      -
    1. Learn the L20n syntax
    2. -
    3. Localization use cases
    4. -
    5. L20n and Translation Memory eXchange (TMX)
    6. -
    7. L20n syntax cheatsheet for localizers
    8. -
    -
  4. -
  5. Additional resources -
      -
    1. L20n.org
    2. -
    3. L20n Tinker
    4. -
    5. L20n GitHub repo
    6. -
    7. Mozilla Wiki
    8. -
    -
  6. -
diff --git a/files/ko/mozilla/projects/psm/index.html b/files/ko/mozilla/projects/psm/index.html deleted file mode 100644 index 962da69c8f..0000000000 --- a/files/ko/mozilla/projects/psm/index.html +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: Personal Security Manager (PSM) -slug: Mozilla/Projects/PSM -translation_of: Mozilla/Projects/PSM ---- -

Personal Security Manager (PSM)는 클라이언트 어플리케이션을 대신하여 암호화 동작을 수행하는 라이브러리 셋으로 구성되어 있습니다. 이 암호화 동작에는 SSL 연결 설정, 오브젝트 사이닝(object signing), 서명 확인(signature verification), 증명 관리(certificate management - issuance 및 revocation 포함) 및 기타 일반적인 PKI 기능이 포함됩니다.

- -

주 :

- - - -

 

diff --git a/files/ko/mozilla/qa/bug_writing_guidelines/index.html b/files/ko/mozilla/qa/bug_writing_guidelines/index.html deleted file mode 100644 index 886539d894..0000000000 --- a/files/ko/mozilla/qa/bug_writing_guidelines/index.html +++ /dev/null @@ -1,177 +0,0 @@ ---- -title: 버그 작성 지침 -slug: Mozilla/QA/Bug_writing_guidelines -tags: - - Bugzilla - - QA - - 버그 -translation_of: Mozilla/QA/Bug_writing_guidelines ---- -
-

이 페이지는 2014년 4분기에 모질라 QA팀의  테크니컬 리뷰를 받아야합니다.(Ioana Chiorean님이 담당합니다) QMO의 How to write a proper bug페이지 글이 이 글로 병합되었습니다.

- -

모질라 소프트웨어를 사용하는데 도움이 필요하다면  지원 페이지에서 해당 소프트웨어를 선택하시기 바랍니다. 이 페이지는 수정하면 안됩니다. 모질라의 버그 추적 시스템인 Bugzilla를 사용하는 방법을 배우는데에 사용해주시기 바랍니다.

- -

버그 리포팅이 처음이라면 유경험자에게 도움을 받아야할 수도 있습니다. QA페이지의 커뮤니티 섹션을 참고하시기 바랍니다. 파이어폭스의 버그를 리포팅하려면 irc.mozilla.org 의 #firefox 채널에서 도움을 받을 수도 있습니다.

-
- -

효과적인 버그 리프트는 수정될 수 있을것 같이 작성한 것입니다. 이 가이드 라인은 그런 보고서를 작성하기 위한 방법을 설명합니다.

- -

선행준비

- -
    -
  1. 당신의 소프트웨어가 최신버전인지 확인하십시오. -
      -
    • 이상적으로는 개발중인 버전을 테스트하여 버그가 이미 수정되었는지 확인하십시오. (예 : Firefox Beta, Aurora, or bleeding-edge Nightly).
    • -
    -
  2. -
  3. Bugzilla 에서 해당 버그가 발견되었는지 확인하십시오. (예제).
  4. -
  5. 새로운 버그리포트를 작성할때에는 대부분 버그 리포팅 방법을 안내합니다. -
      -
    • 여러 가지 이슈사항을 가지고 있다면, 버그리포트를 각각 분리해서 제출하십시오.
    • -
    -
  6. -
- -

재현가능한 정확한 단계 작성

- -

어떻게 개발자는 자신의 컴퓨터에서 버그를 재현할 수 있을까요?

- -

재현 단계는 버그 보고서 전체에서 가장 중요한 부분입니다.  개발자가 버그를 재현 가능한 경우에 고쳐질 가능성이 매우 높습니다. 만약 이 과정이 명확하지 않은 경우에는, 버그가 수정되었는지조차 모를 수도 있습니다.

- -

각 단계의 의도와 더불어 Firefox와의 상호작용을 개연성있게 설명하십시오.

- - - -

당신이 지시한 단계를 진행한 후, 예상했던 결과와 관찰력롸를 명확하게 설명하십시오. 추측에서 명확하게 관찰결과를 분리하십시오.

- - - -

버그가 심각해보이는 경우, 버그를 재현하는 중요 단계중에 당신이 설정한 일반적이지 않은 설정이 있을 수 있습니다. 만약 당신이 작성한 버그가 새 Firefox 프로필에서 재현되는지 확인하십시오. 만약 당신의 기존 프로필에서만 버그가 발생한다면, 어떤 설정이나 확장도구, 혹은 당신의 프로필 파일이 버그를 재현하는데 필요합니다.

- - - -

명확한 요약문 작성

- -

어떻게하면 간략하게 버그를 설명할 수 있을까요? 이것은 버그 관리자(Triager)나 개발자가 볼 문서의 첫 부분입니다.

- -

좋은 요약문은 짧고 명확하게 구분가능하게 작성되어야 합니다. 그리고 해결책이 아닌 문제에 집중하여 설명해야합니다.

- - - - - -

Finding the correct product and component

- -

You will be asked to categorize your bug into a "product" and a "component" within that product, in order to direct your report to the correct developers.

- -

If you're using Firefox, the bug is most likely in "Firefox", "Toolkit", or "Core".

- - - -

When in doubt, search for similar bugs and see what component they are in.

- -

If none of the components seem appropriate, look for a "General" component in the most appropriate product.

- -

Specific types of bugs

- -

If you are reporting a crash bug, please include a Breakpad ID or attach stack trace, and include the crash signature in the bug summary.

- -

If you are reporting a memory use or leak bug, please attach the output of about:memory (Firefox 6+). Ideally, find steps to reproduce an increase in what is shown in about:memory (even after clicking the "Minimize memory usage" button at the bottom). If you have trouble finding steps to reproduce, try the Firefox Support page titled High Memory Usage. If you are a C++ developer, more precise tools are available.

- -

If you are reporting a bug involving a specific web page, please try to make a reduced testcase and attach it to the bug report.

- -

If the bug was recently introduced, finding a regression window can help identify the cause of the bug.

- -
-

Original document information

- - -
- -
-
-

The following article has been merged into this page from QMO: How to write a proper bug

-
- -

Bug Validity Checklist

- -

Verify the problem you found is a New Bug

- -

To verify if what you've found is indeed a new software bug in one of Mozilla's products, go through the following checklist to make sure it's something worth creating a new bug report for.

- - - -

If you're lost and not sure what to do always check out the IRC channel, #qa, at irc.mozilla.org and ask there. If no one answers, try posting to our Bugzilla forums. Otherwise if you haven't found your software bug, its time to write a bug report!

- -

The Bug Report

- -

Where do I go to create a bug?

- - - -

What does the community want to see in a bug report?

- -

There are a couple of generally-held principles that should be taken into account when creating a bug. They would be the following:

- - - -

General Outline of a Bug Report

- - - -

Continue reading How to Write a Proper Bug Report Part 2

- -
-

Original document information

- - -
- -

Triager 라는 직업군을 처음봤으나 구글 검색결과 가장 의미에 부합하는 단어로 번역해봤습니다.

diff --git a/files/ko/mozilla/qa/index.html b/files/ko/mozilla/qa/index.html deleted file mode 100644 index 87214803b6..0000000000 --- a/files/ko/mozilla/qa/index.html +++ /dev/null @@ -1,65 +0,0 @@ ---- -title: 'QA: Quality assurance at Mozilla' -slug: Mozilla/QA -translation_of: Mozilla/QA ---- -

QA부서에서 Mozilla 프로젝트를 함께 도울 수 있는 많은 것들이 있으며, 모두 코드를 필요로 하는건 아닙니다. 일부는 심지어 HTML이나 기타 웹 기술을 배우고, 필요로 하지도 않습니다. 테스트와 기타 QA활동으로 우리를 도우는데 관심이 있으시다면,  quality.mozilla.org를 먼저 볼 수 있을겁니다..

- - - - - - - - -
-

문서

- -
-
버그 작성 지침
-
보다 효과적으로 엔지니어가 버그를 고칠 수 있다는 가능성을 보고할 수 있습니다. 다음 지침을 통해, 버그를 모질라 엔지니어의 heep의 상단에 머물고, 고정되는것을 보장할 수 있습니다.
-
확인되지 않은 버그 확인
-
최종 사용자의 유용한 버그 리포트만 식별하고 나머지는 닫습니다.
-
중복 버그 심사
-
이미 나온 중복 보고서를 피하거나, 보고서를 수신함으로서 더 빠르게 버그를 수정하는데 도움을 얻릉 수 있습니다.
-
testcases 감소
-
개발자는 버그를 이해하고, 자동화 된 테스트를 만드는데 사용할 수 있어, 도움이 되는 간단한 테스트 케이스로 깨진 웹 페이지를 만들어 버그 리포트를 향상시킬 수 있습니다.
-
Robocop
-
로보캅. Firefox for Android에 사용되는 자동화 된 테스트 시스템에 대한 설명서를 참조하십시오.
-
Mozilla에서 자동화 된 테스트
-
모질라 코드에 대한 자동화된 테스트를 생성하시고 사용하는 방법에 대한 설명서를 참조하십시오.
-
개발 테스트
-
미래의 변화가 모질라에서 현재 제대로 작동되는 일들을 방해하지 않는지 확인하기 위함.
-
간혈적인 oranges 방지
-
검사 결과가 더 신뢰할 수 있도록 하는 방법에 대한 제한으로, 임의의 간혈적인 검사가 오류를 방지하는데 도움이 됩니다.
-
- -

모두보기...

-
-

커뮤니티

- - - -

도구

- - - -

모두보기...

- - - - -
diff --git a/files/ko/mozilla/tech/index.html b/files/ko/mozilla/tech/index.html deleted file mode 100644 index b891a01cb4..0000000000 --- a/files/ko/mozilla/tech/index.html +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: Mozilla technologies -slug: Mozilla/Tech -tags: - - XUL - - 모질라 - - 시작하기 - - 참조 -translation_of: Mozilla/Tech ---- -

모질라 프로젝트의 컴포넌트로 사용되는 몇가지 기술이 있습니다. 이 문서는 이를 기술합니다. (현재 모든 하위문서가 번역되진 않았습니다.)

- -

{{LandingPageListSubpages}}

diff --git a/files/ko/mozilla/tech/xpcom/guide/index.html b/files/ko/mozilla/tech/xpcom/guide/index.html deleted file mode 100644 index 898a1f2b20..0000000000 --- a/files/ko/mozilla/tech/xpcom/guide/index.html +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: XPCOM guide -slug: Mozilla/Tech/XPCOM/Guide -tags: - - Landing - - Mozilla - - NeedsTranslation - - TopicStub - - XPCOM -translation_of: Mozilla/Tech/XPCOM/Guide ---- -

These articles provide tutorials and usage documentation for XPCOM, including how to use it in your own projects and how to build XPCOM components for your Firefox add-ons and the like.

-

-
- -

diff --git a/files/ko/mozilla/tech/xpcom/language_bindings/index.html b/files/ko/mozilla/tech/xpcom/language_bindings/index.html deleted file mode 100644 index 3bdc969de3..0000000000 --- a/files/ko/mozilla/tech/xpcom/language_bindings/index.html +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: Language bindings -slug: Mozilla/Tech/XPCOM/Language_Bindings -tags: - - Embedding - - Landing - - Mozilla - - NeedsTranslation - - TopicStub - - XPCOM - - 'XPCOM:Language Bindings' -translation_of: Mozilla/Tech/XPCOM/Language_Bindings ---- -

An XPCOM Language Binding is a bridge between a particular language and XPCOM to provide access to XPCOM objects from that language, and to let modules written in that language be used as XPCOM objects by all other languages for which there are XPCOM bindings.

-

More specifically, an XPCOM language binding:

- -

Since the XPCOM layer itself is written in C/C++, its API can be accessed out-of-the-box using C or C++. In order to allow any other language to use the XPCOM API, a bridging layer is required.

-

The following bridging layers are currently available:

-

-
- -

diff --git a/files/ko/mozilla/tech/xpcom/reference/index.html b/files/ko/mozilla/tech/xpcom/reference/index.html deleted file mode 100644 index 5a7636ec04..0000000000 --- a/files/ko/mozilla/tech/xpcom/reference/index.html +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: XPCOM reference -slug: Mozilla/Tech/XPCOM/Reference -tags: - - Add-ons - - Extensions - - Landing - - Mozilla - - NeedsTranslation - - Reference - - TopicStub - - XPCOM -translation_of: Mozilla/Tech/XPCOM/Reference ---- -

This reference describes the interfaces and functions provided by the XPCOM library. In addition, it details the various helper classes and functions, as well as the components, provided by the XPCOM glue library. The contents herein are oriented primarily toward extension developers and people embedding XPCOM in other projects.

- -
-

WebExtensions are becoming the new standard for creating add-ons. Eventually support for XPCOM add-ons will be deprecated, so you should begin to investigate porting your add-ons to use the WebExtensions API, and report any missing functionality so we can be sure to address your concerns. Work is ongoing on WebExtension capabilities, so your input will help prioritize and plan the work. To learn more about the kinds of changes that will be needed, see Comparison with XUL/XPCOM extensions. In addition, any binaries you use will then need to be converted for use with the WebExtensions native messaging API, or compiled using WebAssembly or Emscripten.

-
- -
-

If you're working on a module in the Mozilla codebase that's compiled with the MOZILLA_INTERNAL_API flag set, some of these APIs -- the string functions and classes in particular -- are not the ones you should be using. See the XPCOM internal string guide for documentation of the internal string API used within the Mozilla codebase.

-
- -

-
-
XPCOM Interface Reference
This is a reference to the XPCOM interfaces provided by the Mozilla platform.
-

- -

Many XPCOM pages return an nsresult. Prior to Gecko 19 (Firefox 19 / Thunderbird 19 / SeaMonkey 2.16), this was an integer that simply returned an error code. It is now a strongly typed enum when XPCOM is built using a C++11 compiler. This causes compile-time errors to occur when improper values are returned as nsresult values, thereby making it easier to catch many bugs.

diff --git a/files/ko/mozilla/tech/xpcom/reference/interface/about_scriptable_interfaces/index.html b/files/ko/mozilla/tech/xpcom/reference/interface/about_scriptable_interfaces/index.html deleted file mode 100644 index d282b17f13..0000000000 --- a/files/ko/mozilla/tech/xpcom/reference/interface/about_scriptable_interfaces/index.html +++ /dev/null @@ -1,26 +0,0 @@ ---- -title: About Scriptable Interfaces -slug: Mozilla/Tech/XPCOM/Reference/Interface/About_Scriptable_Interfaces -tags: - - 'Interfaces:Scriptable' -translation_of: Interfaces/About_Scriptable_Interfaces ---- -

 

- -

문서의 상태

- -

이 문서는 시작단계이고 문서를 완성할 생각이 없을 지도 모릅니다. 이 문서에 있는 정보들은 http://www.mozilla.org/scriptable/XPCOM 컴포넌트 만들기에 있는 내용을 기반으로 합니다.

- -

스크립터블 인터페이스(Scriptable Interface)

- -

인터페이스는 XPCOM 컴포넌트의 자세한 세부 구현을 감추면서 기능을 외부 세계로 노출할 수 있도록 해 줍니다. 인터페이스IDL(인터페이스 기술 언어)로 작성됩니다.

- -

interface에 scriptable 라벨링 한다는 것은, 스크립트 언어(예: JavaScript)를 이용하여 인터페이스를 통해 컴포넌트를 참조할 수 있으며 또한 인터페이스를 구현한 새로운 컴포넌트를 작성할 수 있다는 것을 의미합니다.

- -

XPConnect

- -

XPConnectJavaScript 언어로 스크립터블 인터페이스를 사용하거나 구현할 수 있게 해 주는 기술입니다. 다른 스크립트 언어들에서는 XPConnect을 지원하지 않습니다.

- -

Python

- -

Python 스크립트에서 스크립터블 인터페이스를 사용하거나 구현할 수 있게 해주는 XPCOM와 Python을 연결하는 확장 기능 {{ Source("extensions/python") }} 이 있습니다.

diff --git a/files/ko/mozilla/tech/xpcom/reference/interface/nsiloginmanager/index.html b/files/ko/mozilla/tech/xpcom/reference/interface/nsiloginmanager/index.html deleted file mode 100644 index c417f645f5..0000000000 --- a/files/ko/mozilla/tech/xpcom/reference/interface/nsiloginmanager/index.html +++ /dev/null @@ -1,372 +0,0 @@ ---- -title: nsILoginManager -slug: Mozilla/Tech/XPCOM/Reference/Interface/nsILoginManager -tags: - - Firefox 3 - - Interfaces - - 'Interfaces:Scriptable' - - Login Manager - - NeedsTranslation - - Thunderbird 3 - - TopicStub - - XPCOM - - XPCOM API Reference - - thunderbird -translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsILoginManager ---- -

-
toolkit/components/passwordmgr/public/nsILoginManager.idl스크립트에서 사용 가능
- - -Used to interface with the built-in Password Manager - - -
- -
1.0
- -
66
- -
- -
- -
Introduced
-
Gecko 1.9
- -
- -
- -
-Inherits from: nsISupports -Last changed in Gecko 1.9.2 (Firefox 3.6 / Thunderbird 3.1 / Fennec 1.0)
-

-

Replaces nsIPasswordManager which was used in older versions of Gecko.

-

Implemented by: @mozilla.org/login-manager;1. To create an instance, use:

-
var loginManager = Components.classes["@mozilla.org/login-manager;1"]
-                   .getService(Components.interfaces.nsILoginManager);
-
-

Method overview

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void addLogin(in nsILoginInfo aLogin);
nsIAutoCompleteResult autoCompleteSearch(in AString aSearchString, in nsIAutoCompleteResult aPreviousResult, in nsIDOMHTMLInputElement aElement);
unsigned long countLogins(in AString aHostname, in AString aActionURL, in AString aHttpRealm);
boolean fillForm(in nsIDOMHTMLFormElement aForm);
void findLogins(out unsigned long count, in AString aHostname, in AString aActionURL, in AString aHttpRealm, [retval, array, size_is(count)] out nsILoginInfo logins);
void getAllDisabledHosts([optional] out unsigned long count, [retval, array, size_is(count)] out wstring hostnames);
void getAllLogins([optional] out unsigned long count, [retval, array, size_is(count)] out nsILoginInfo logins);
boolean getLoginSavingEnabled(in AString aHost);
void modifyLogin(in nsILoginInfo oldLogin, in nsISupports newLoginData);
void removeAllLogins();
void removeLogin(in nsILoginInfo aLogin);
void searchLogins(out unsigned long count, in nsIPropertyBag matchData, [retval, array, size_is(count)] out nsILoginInfo logins);
void setLoginSavingEnabled(in AString aHost, in boolean isEnabled);
-

Methods

-

addLogin()

-

Stores a new login in the Login Manager.

-

주의: Default values for the nsILoginMetaInfo properties are created if the specified login doesn't explicitly specify them.

-
void addLogin(
-  in nsILoginInfo aLogin
-);
-
-
Parameters
-
-
- aLogin
-
- The login to store.
-
-
Exceptions thrown
-
-
-  
-
- An exception is thrown if the login information is already stored in the Login Manager. To change a login, you have to use modifyLogin().
-
-

autoCompleteSearch()

-

Generates results for a user field autocomplete menu.

-

주의: This method is provided for use only by the FormFillController, which calls it directly. It should not be used for any other purpose.

-
nsIAutoCompleteResult autoCompleteSearch(
-  in AString aSearchString,
-  in nsIAutoCompleteResult aPreviousResult,
-  in nsIDOMHTMLInputElement aElement
-);
-
-
Parameters
-
-
- aSearchString
-
- Missing Description
-
- aPreviousResult
-
- Missing Description
-
- aElement
-
- Missing Description
-
-
Return value
-

Missing Description

-

countLogins()

-

Returns the number of logins matching the specified criteria. Called when only the number of logins is needed, and not the actual logins (which avoids prompting the user for a Master Password, as the logins don't need to be decrypted).

-
unsigned long countLogins(
-  in AString aHostname,
-  in AString aActionURL,
-  in AString aHttpRealm
-);
-
-
Parameters
-
-
- aHostname
-
- The hostname to which to restrict searches, formatted as a URL. For example, "http://www.bar.com". To match all hostnames, specify "" (empty string). A value of null will cause countLogins() to not match any logins.
-
- aActionURL
-
- For form logins, this parameter should specify the URL to which the form will be submitted. To match any form login, specify "" (empty string). To not match any form logins (For example when interested in protocol logins only), specify null.
-
- aHttpRealm
-
- For protocol logins, specify the HTTP Realm for which the login applies; this is obtained from the WWW-Authenticate header (see RFC 2617). To match any protocol login, specify "" (empty string). To not match any protocol logins (For example when interested in form logins only), specify null.
-
-
Return value
-

The number of logins matching the parameters passed.

-

fillForm()

-

Fills out a form with login information, if appropriate information is available.

-

주의: This method will attempt to fill out the form regardless of the setting of the signon.autofillForms preference.

-
boolean fillForm(
-  in nsIDOMHTMLFormElement aForm
-);
-
-
Parameters
-
-
- aForm
-
- The HTMLform to attempt to fill out.
-
-
Return value
-

true if the form was successfully filled out; otherwise false.

-

findLogins()

-

Searches for logins matching the specified criteria. Called when looking for logins that might be applicable to a given form or authentication request.

-
void findLogins(
-  out unsigned long count,
-  in AString aHostname,
-  in AString aActionURL,
-  in AString aHttpRealm,
-  [retval, array, size_is(count)] out nsILoginInfo logins
-);
-
-
Parameters
-
-
- count
-
- The number of elements in the returned array. JavaScript callers can simply use the array's length property and supply a dummy argument for this parameter.
-
- aHostname
-
- The hostname to restrict searches to, formatted as a URL. For example, "http://www.bar.com".
-
- aActionURL
-
- For form logins, this parameter should specify the URL to which the form will be submitted. For protocol logins, specify null. An empty string ("") will match any value (except null).
-
- aHttpRealm
-
- For protocol logins, specify the HTTP Realm for which the login applies; this is obtained from the WWW-Authenticate header (see RFC 2617). For form logins, this parameter should be null. An empty string ("") will match any value (except null).
-
- logins
-
- An array of nsILoginInfo objects.
-
-
Example
-

This method can be called from JavaScript like this:

-
 var logins = myLoginMgr.findLogins({}, hostname, ...);
-
-

getAllDisabledHosts()

-

Returns a list of all hosts for which login saving is disabled.

-
void getAllDisabledHosts(
-  [optional] out unsigned long count,
-  [retval, array, size_is(count)] out wstring hostnames
-);
-
-
Parameters
-
-
- count
-
- The number of elements in the returned array. JavaScript callers can simply use the array's length property and supply a dummy argument for this parameter.
-
- hostnames
-
- An array of hostname strings in URL format without a pathname. For example: "https://www.site.com".
-
-
Example
-

You can call this method from JavaScript like this:

-
 var disabledHosts = myLoginMgr.getAllDisabledHosts({});
-
-

getAllLogins()

-

Returns an array containing all logins recorded by the Login Manager.

-

If you just want to see if any logins are stored, use countLogins() instead. It's more efficient, and avoids the possibility of the user being prompted for their master password.

-
void getAllLogins(
-  [optional] out unsigned long count,
-  [retval, array, size_is(count)] out nsILoginInfo logins
-);
-
-
Parameters
-
-
- count
-
- The number of elements in the returned array. JavaScript callers can simply use the array's length property and supply a dummy argument for this parameter.
-
- logins
-
- An array of nsILoginInfo objects containing all the logins the Login Manager has on record.
-
-
Example
-

You can call this method from JavaScript like this:

-
 var logins = myLoginMgr.getAllLogins({});
-
-

getLoginSavingEnabled()

-

Reports whether or not saving login information is enabled for a host.

-
boolean getLoginSavingEnabled(
-  in AString aHost
-);
-
-
Parameters
-
-
- aHost
-
- The hostname to check. This argument should be in the origin URL format, with no pathname. For example: "https://www.site.com".
-
-
Return value
-

true if login saving is enabled for the host, otherwise false.

-

modifyLogin()

-

Modifies an existing login by replacing it with a new one.

-

If newLoginData is a nsILoginInfo, all of the old login's nsILoginInfo properties are changed to the values from newLoginData (but the old login's nsILoginMetaInfo properties are unmodified).

-

If newLoginData is a nsIPropertyBag, only the specified properties will be changed. The nsILoginMetaInfo properties of oldLogin can be changed in this manner.

-

If the propertybag contains an item named "timesUsedIncrement", the login's timesUsed property will be incremented by the item's value.

-
void modifyLogin(
-  in nsILoginInfo oldLogin,
-  in nsISupports newLoginData
-);
-
-
Parameters
-
-
- oldLogin
-
- The login to be modified.
-
- newLoginData
-
- The login information to replace the oldLogin with. This may be specified as either an nsILoginInfo or an nsIPropertyBag2 object.
-
-

removeAllLogins()

-

Removes all logins known by the Login Manager. This works without a need for the master password, if one is set.

-
void removeAllLogins();
-
-
Parameters
-

None.

-

removeLogin()

-

Removes a login from the Login Manager.

-

주의: The specified login must exactly match a stored login. However, the values of any nsILoginMetaInfo properties are ignored.

-
void removeLogin(
-  in nsILoginInfo aLogin
-);
-
-
Parameters
-
-
- aLogin
-
- The login to remove from the Login Manager. Only a login that is an exact match is deleted.
-
-

searchLogins()

-

Searches for logins in the login manager's data store, returning an array of matching logins. If there are no matching logins, an empty array is returned.

-
void searchLogins(
-  out unsigned long count,
-  in nsIPropertyBag matchData,
-  [retval, array, size_is(count)] out nsILoginInfo logins
-);
-
-
Parameters
-
-
- count
-
- The number of elements in the returned array.
-
- matchData
-
- The data used for the search. This does not follow the same requirements as findLogins() for those fields; wildcard matches are not specified.
-
- logins
-
- An array of matching nsILoginInfo objects.
-
-
Example
-

This method can be called from JavaScript like this:

-
 var logins = myLoginMgr.searchLogins({}, matchData);
- var numLogins = logins.length;
-
-

setLoginSavingEnabled()

-

Enables or disables storing logins for a specified host. When login storing is disabled, the Login Manager won't prompt the user to store logins for that host. Existing logins are not affected.

-
void setLoginSavingEnabled(
-  in AString aHost,
-  in boolean isEnabled
-);
-
-
Parameters
-
-
- aHost
-
- The hostname to adjust the setting for. This argument should be in the origin URL format, with no pathname. For example: "https://www.site.com".
-
- isEnabled
-
- If true, login saving is enabled for the specified host. If false, login saving is disabled.
-
-

See also

- -

diff --git a/files/ko/mozilla/tech/xul/attribute/accesskey/index.html b/files/ko/mozilla/tech/xul/attribute/accesskey/index.html deleted file mode 100644 index 611ef87975..0000000000 --- a/files/ko/mozilla/tech/xul/attribute/accesskey/index.html +++ /dev/null @@ -1,44 +0,0 @@ ---- -title: accesskey -slug: Mozilla/Tech/XUL/Attribute/accesskey -tags: - - XUL Attributes -translation_of: Archive/Mozilla/XUL/Attribute/accesskey ---- -
- « XUL Reference home
-
-
-
- 사용요소: button, checkbox, caption, description, label, listitem, menu, menuitem, menulist, tab, radio, toolbarbutton, textbox (Firefox autocomplete)
-
-
-
-
- accesskey
-
- 타입: - - character -
-
- 이 속성에는 단축키로 사용될 문자를 지정합니다. 문자는 대상 요소의 label 속성값인 텍스트에 포함된 문자 중 하나를 사용하는 것이 좋습니다. -
- 문자는 보통 밑줄이 그어져 출력되며, 이는 플랫폼과 테마에 따라 다를 수 있습니다. 사용자가 Alt(또는 플랫폼에 따라 다른 키)와 단축키를 같이 누르면 창의 어디에 있든 해당 요소가 활성화 됩니다. 속성값은 대소문자를 구분하지 않지만 라벨에 대문자와 소문자가 같이 있다면 accesskey 속성과 동일한 문자가 사용됩니다.
-
-
-

예제

-
- Image:XUL_ref_accesskey_attr.png
-
<vbox>
-  <label value="Enter Name" accesskey="e" control="myName"/>
-  <textbox id="myName"/>
-  <button label="Cancel" accesskey="n"/>
-  <button label="Ok" accesskey="O"/>
-</vbox>
-
-

또 볼 곳

-

label attribute, acceltext attribute

-
-  
-

diff --git a/files/ko/mozilla/tech/xul/attribute/currentset/index.html b/files/ko/mozilla/tech/xul/attribute/currentset/index.html deleted file mode 100644 index 2f597090c5..0000000000 --- a/files/ko/mozilla/tech/xul/attribute/currentset/index.html +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: currentset -slug: Mozilla/Tech/XUL/Attribute/currentset -tags: - - MDC Project - - NeedsTechnicalReview - - XUL Attributes -translation_of: Archive/Mozilla/XUL/Attribute/currentset ---- -
- « XUL Reference home
-
-
- currentset
-
- Firefox only
-
- 타입: - - comma-separated string -
-
- 현재 toolbar에 출력되는 항목의 집합입니다. 이 집합은 사용자가 툴바를 커스터마이징(사용자 지정) 할 경우 변경될 수 있습니다. 속성값은 쉼표(,)로 분리된 toolbarpalette에 있는 항목들의 ID 목록이어야 하며, 추가적으로 "separator", "spring", "spacer"의 문자열을 포함할 수 있습니다.
-
-

this isn't necessary the *current* set, i.e. it might not be equal the value of the currentSet property which is computed from the actual DOM

diff --git a/files/ko/mozilla/tech/xul/attribute/image.onload/index.html b/files/ko/mozilla/tech/xul/attribute/image.onload/index.html deleted file mode 100644 index a8b0c5020a..0000000000 --- a/files/ko/mozilla/tech/xul/attribute/image.onload/index.html +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: image.onload -slug: Mozilla/Tech/XUL/Attribute/image.onload -translation_of: Archive/Mozilla/XUL/Attribute/image.onload ---- -
« XUL Reference home
- -
-
image.onload
-
Type: script code
-
이 이벤트 핸들러는 이미지 로딩이 완료 되었을때 image element에서 호출됩니다. This applies whether the image is applied via the src attribute or the list-style-image style property. If you change the image, the event will fire again when the new image loads. This event will not bubble up the element tree.
-
diff --git a/files/ko/mozilla/tech/xul/attribute/index.html b/files/ko/mozilla/tech/xul/attribute/index.html deleted file mode 100644 index 6091401093..0000000000 --- a/files/ko/mozilla/tech/xul/attribute/index.html +++ /dev/null @@ -1,270 +0,0 @@ ---- -title: Attributes -slug: Mozilla/Tech/XUL/Attribute -tags: - - XUL Attributes -translation_of: Archive/Mozilla/XUL/Attribute ---- -

« XUL Reference home

- -

diff --git a/files/ko/mozilla/tech/xul/index.html b/files/ko/mozilla/tech/xul/index.html deleted file mode 100644 index d2517521b3..0000000000 --- a/files/ko/mozilla/tech/xul/index.html +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: XUL -slug: Mozilla/Tech/XUL -tags: - - XUL -translation_of: Archive/Mozilla/XUL ---- -
XUL 입문서
-처음 XUL을 시작하는 사람을 위한 안내서입니다. 원문은 XULPlanet 에 있습니다.
-
XUL (XML User Interface Language)은 Mozilla의 XML 기반 언어로 인터넷과 연결되거나 또는 연결되지 않은 채로 동작하는 풍부한 기능을 제공하는 크로스 플랫폼 응용프로그램을 만들 수 있게 해줍니다. 이렇게 만들어진 응용프로그램은 텍스트나 그래픽, 배치 등을 쉽게 바꿀 수 있기 때문에 여러가지 요구에 맞게 즉시 상품화나 지역화 해 내어놓을 수 있습니다. 다이나믹 HTML (DHTML)에 친숙한 웹 개발자들은 XUL을 금방 배워서 바로 응용프로그램을 만들어 볼 수 있을 것입니다. XUL 데모(demo)를 조금 보려면 Firefox나 다른 Gecko 기반 브라우저에서 XUL 주기표를 여세요.
- -

문서

XUL 레퍼런스
MDC에 있는 prefwindow 관련 문서도 보시기 바랍니다.
XUL 컨트롤
XUL에서 사용할 수 있는 컨트롤들의 목록입니다.
XUL 개요
XUL의 주요 특징과 구성요소들을 설명합니다.
메뉴와 팝업 가이드
메뉴와 팝업 판넬 사용 가이드
템플릿 안내
데이터소스로 부터 컨텐츠를 만드는 방법인 XUL 템플릿에 대한 자세한 안내.
오버레이
XUL 오버레이에 대한 글. 오버레이는 UI에 대한 추가적인 내용을 기술하기 위해서 사용됩니다. 그럼으로써 기존의 XUL 애플리케이션을 확장하고 커스터마이징하는 강력한 수단을 제공합니다.
XUL 애플리케이션을 Firefox 3.0에 맞게 개조하기
XUL 개발자에 영향을 미치는 Firefox 3.0에서 바뀐 점.
XUL 애플리케이션을 Firefox 2.0에 맞게 개조하기
XUL 개발자에 영향을 미치는 Firefox 2.0에서 바뀐 점.
XUL 애플리케이션을 Firefox 1.5에 맞게 개조하기
XUL 개발자에 영향을 미치는 Firefox 1.5에서 바뀐 점.

모두 보기...

커뮤니티

  • Mozilla 포럼 보기...

도구

- -

모두 보기...

관련 주제

JavaScript, XBL, CSS, RDF, 확장 기능, XULRunner
-

Categories

-

Interwiki Language Links

-

 

-

diff --git a/files/ko/mozilla/tech/xul/menu/index.html b/files/ko/mozilla/tech/xul/menu/index.html deleted file mode 100644 index fa3a01a593..0000000000 --- a/files/ko/mozilla/tech/xul/menu/index.html +++ /dev/null @@ -1,338 +0,0 @@ ---- -title: menu -slug: Mozilla/Tech/XUL/menu -translation_of: Archive/Mozilla/XUL/menu ---- -
- - « XUL Reference home [ - 예제 | - Attributes | - Properties | - Methods | - 관련 항목 ] -
-

이 엘리먼트는 menubar에 위치한 button과 비슷합니다. 사용자가 menu 엘리먼트를 클릭하면 menupopup의 자식 메뉴를 표시해 줍니다.  menupopup엘리먼트는 서브메뉴를 만듭니다.

-

더자세한 정보는 XUL tutorial를 참고하세요.

-
-
- Attributes
-
- acceltext, accesskey, allowevents, command, crop, disabled, image, label, menuactive, open, sizetopopup, tabindex, value
-
-
-
- Properties
-
- accessibleType, accessKey, command, control, crop, disabled, image, itemCount, label, labelElement, menupopup, open, parentContainer, selected, tabIndex, value
-
-
-
- Methods
-
- appendItem, getIndexOfItem, getItemAtIndex, insertItemAt, removeItemAt
-
- Style classes
-
- menu-iconic
-
-

Example

-
<menubar id="sample-menubar">
-  <menu id="file-menu" label="File">
-    <menupopup id="file-popup">
-      <menuitem label="New"/>
-      <menuitem label="Open"/>
-      <menuitem label="Save"/>
-      <menuseparator/>
-      <menuitem label="Exit"/>
-    </menupopup>
-  </menu>
-  <menu id="edit-menu" label="Edit">
-    <menupopup id="edit-popup">
-      <menuitem label="Undo"/>
-      <menuitem label="Redo"/>
-    </menupopup>
-  </menu>
-</menubar>
-
-

Attributes

-

- -
-
- acceltext
-
- Type: string
-
- Text that appears beside the menu label to indicate the shortcut key (accelerator key) to use to invoke the command. If this value is set, it overrides an assigned key set in the key attribute. This attribute does not apply to menus directly on the menubar.
-
-
- - -
-
- accesskey
-
- 타입: - - character -
-
- 이 속성에는 단축키로 사용될 문자를 지정합니다. 문자는 대상 요소의 label 속성값인 텍스트에 포함된 문자 중 하나를 사용하는 것이 좋습니다. - -
-
-

예제

-
- Image:XUL_ref_accesskey_attr.png
-
<vbox>
-  <label value="Enter Name" accesskey="e" control="myName"/>
-  <textbox id="myName"/>
-  <button label="Cancel" accesskey="n"/>
-  <button label="Ok" accesskey="O"/>
-</vbox>
-
-

또 볼 곳

-

label attribute, acceltext attribute

- -

-
- -
-
allowevents
-
Type: boolean
-
If true, events are passed to children of the element. Otherwise, events are passed to the element only.
-
- - - - -
- -
-
- crop
-
- Type: one of the values below
-
- If the label of the element is too big to fit in its given space, the text will be cropped on the side specified by the crop attribute. An ellipsis will be used in place of the cropped text. If the box direction is reversed, the cropping is reversed.
-
-
-
- start
-
- The text will be cropped on its left side in left-to-right text locales, and the right side in right-to-left locales.
-
- end
-
- The text will be cropped on its right side in left-to-right text locales, and the right side in right-to-left locales.
-
- left
-
- The text will be cropped on its left side.
-
- right
-
- The text will be cropped on its right side.
-
- center
-
- The text will be cropped in the middle, showing both the start and end of the text normally.
-
- none
-
- The text will be not be cropped using an ellipsis. However, the text will simply be cut off if it is too large. The side depends on the CSS text alignment.
-
-
-
- Depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped. If you wish to use the value none and the displayed text is larger than this maximum width, you may be able to use the max-width CSS property (or the maxwidth attribute) to override this size. For example, for a menuitem in a menu you can add the following CSS rule when you want to use the value none:
-
-
menupopup > menuitem, menupopup > menu { max-width: none; }
-
-
-
-
- - -
-
disabled
-
Type: boolean
-
Indicates whether the element is disabled or not. If this attribute is set, the element is disabled. Disabled elements are usually drawn with grayed-out text. If the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire. In the case of form elements, it will not be submitted. Do not set the attribute to true, as this will suggest you can set it to false to enable the element again, which is not the case. - -
The disabled attribute is allowed only for form controls. Using it with an anchor tag (an <a> link) will have no effect.
- -
- The element will, however, still respond to mouse events. To enable the element, leave this attribute out entirely.
-
-
Visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.
-
- - -
- - -
-
label
-
Type: string
-
The label that will appear on the element. If this is left out, no text appears. For an editable menuitem element the value of this attribute is copied to the menulist.value property upon user selection of the menuitem.
-
- - -
- - -
-
menuactive
-
Type: boolean
-
This attribute is set on an item in a menu when it is being hovered over. Typcially, the theme will use this to highlight the item. A DOMMenuItemActive event will be sent to the item when the item is hovered over, and a DOMMenuItemInactive event will be sent to the item when the selection moves away.
-
-
- - -
-
open
-
Type: boolean
-
For the menu type buttons, the open attribute is set to true when the menu is open. The open attribute is not present if the menu is closed.
-
-
- - -
-
sizetopopup
-
Type: one of the values below
-
Indicates how the menu width and the menupopup width are determined. If the sizetopopup attribute is left out or set to none, the menu will be its preferred width and the popup may extend outside of this width, unaffected by the maximum width of the menu itself. Otherwise, the menu will size itself to at least the size of the popup. If the menu has a maximum width, the popup will also be this width.
-
-
-
none
-
The width of the popup will not be constrained to the size of the menu.
-
pref
-
The preferred width of the menu label or button will be the size needed for the popup contents. This is the default value for menulists.
-
always
-
Both the preferred and minimum width of the menu label or button will be the same as that necessary for the menupopup.
-
-
-
-
- - -
-
value
-
Type: string
-
The string attribute allows you to associate a data value with an element. It is not used for any specific purpose, but you can access it with a script for your own use. Be aware, however, that some elements, such as textbox will display the value visually, so in order to merely associate data with an element, you could 1) Use another attribute like "value2" or "data-myAtt" (as in the HTML5 draft), as XUL does not require validation (less future-proof); 2) Use setAttributeNS() to put custom attributes in a non-XUL namespace (serializable and future-proof); 3) Use setUserData() (future-proof and clean, but not easily serializable). For user editable menulist elements, the contents, as visible to the user, are read and set using the Menulist.value syntax. For those elements, setAttribute("value", myValue) and getAttribute("value") do not access or affect the contents displayed to the user.
-
- - - -

 

-

-

Properties

-

-
-
- accessibleType
-
- Type: integer
-
- A value indicating the type of accessibility object for the element.
-
-
- -
-
control
-
Type: menu element
-
Returns the enclosing menu that the item is inside, if any, or null if there is no enclosing menu.
-
-
-
itemCount
-
Type: integer
-
Read only property holding the number of child items.
-
-
- -
-
menupopup
-
Type: menupopup element
-
A reference to the menupopup used by the menu or menulist. This property is read-only.
-
-
-
- open
-
- Type: boolean
-
- This property will be set to true when the menu is open. The menu may be opened by setting the open property to true and closed by setting it to false.
-
- -
-
parentContainer
-
Type: menu element
-
Read only property that returns the containing menu element, or null if there isn't a containing menu.
-
-
-
- value
-
- Type: string
-
- Gets and sets the value of the value attribute. For textbox and user editable menulist elements, the contents, as visible to the user, are read and set using the Textbox.value and Menulist.value syntax.
-
- -

 

-

Methods

-

- - - - - -
-

Inherited Methods
-addEventListener(), appendChild(), blur, click, cloneNode(), compareDocumentPosition, dispatchEvent(), doCommand, focus, getAttribute(), getAttributeNode(), getAttributeNodeNS(), getAttributeNS(), getBoundingClientRect(), getClientRects(), getElementsByAttribute, getElementsByAttributeNS, getElementsByClassName(), getElementsByTagName(), getElementsByTagNameNS(), getFeature(), getUserData, hasAttribute(), hasAttributeNS(), hasAttributes(), hasChildNodes(), insertBefore(), isDefaultNamespace(), isEqualNode, isSameNode, isSupported(), lookupNamespaceURI, lookupPrefix, normalize(), querySelector(), querySelectorAll(), removeAttribute(), removeAttributeNode(), removeAttributeNS(), removeChild(), removeEventListener(), replaceChild(), setAttribute(), setAttributeNode(), setAttributeNodeNS(), setAttributeNS(), setUserData

- -
-
- appendItem( label, value )
-
- Return type: element
-
- Creates a new item and adds it to the end of the existing list of items. You may optionally set a value. The function returns the newly created element.
-
-
getIndexOfItem( item )
-
Return type: integer
-
Returns the zero-based position of the specified item. Items are numbered starting at the first item displayed in the list.
-
-
getItemAtIndex( index )
-
Return type: element
-
Returns the element that is at the specified index.
-
-
- insertItemAt( index, label, value )
-
- Return type: element
-
- This method creates a new item and inserts it at the specified position. You may optionally set a value. The new item element is returned.
-
-
- removeItemAt( index )
-
- Return type: element
-
- Removes the child item in the element at the specified index. The method returns the removed item.
-

-

Style classes

-

menu-iconic
Use this class to have an image appear on the menu. Specify the image using the image attribute.
-

- -
-
- Elements
-
- menubar, menuitem, menulist, menupopup, menuseparator
-
-
-
- Interfaces
-
- nsIAccessibleProvider, nsIDOMXULContainerElement, nsIDOMXULContainerItemElement, nsIDOMXULSelectControlItemElement
-
-

diff --git a/files/ko/mozilla/tech/xul/property/index.html b/files/ko/mozilla/tech/xul/property/index.html deleted file mode 100644 index f9c5eb52b4..0000000000 --- a/files/ko/mozilla/tech/xul/property/index.html +++ /dev/null @@ -1,219 +0,0 @@ ---- -title: Property -slug: Mozilla/Tech/XUL/Property -tags: - - XUL Properties -translation_of: Archive/Mozilla/XUL/Property ---- -

« XUL Reference

- -

관련 DOM 요소 properties

- -

diff --git a/files/ko/mozilla/tech/xul/splitter/index.html b/files/ko/mozilla/tech/xul/splitter/index.html deleted file mode 100644 index 863f3c76db..0000000000 --- a/files/ko/mozilla/tech/xul/splitter/index.html +++ /dev/null @@ -1,79 +0,0 @@ ---- -title: splitter -slug: Mozilla/Tech/XUL/splitter -translation_of: Archive/Mozilla/XUL/splitter ---- -

<?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin" type="text/css"?>

-

<window title="XUL Splitters"

-
       xmlns:html="http://www.w3.org/1999/xhtml"
-       xmlns="http://www.mozilla.org/keymaster/gat...re.is.only.xul">
-
-

<script> <![CDATA[

-

]]> </script>

-

<description><html:h1>XUL Splitters</html:h1></description>

-
<vbox flex="1" style="overflow: auto">
-
-
   <groupbox orient="horizontal" flex="1">
-   <caption label="collapse before" />
-     <groupbox flex="1"><label flex="1" value="Left side" /></groupbox>
-     <splitter collapse="before" ><grippy /></splitter>
-     <groupbox flex="1"><label flex="1" value="Right side" /></groupbox>
-   </groupbox>
-
-
   <groupbox orient="horizontal" flex="1">
-   <caption label="collapse after" />
-     <groupbox flex="1"><label flex="1" value="Left side" /></groupbox>
-     <splitter collapse="after" ><grippy /></splitter>
-     <groupbox flex="1"><label flex="1" value="Right side" /></groupbox>
-   </groupbox>
-
-
   <groupbox orient="horizontal" flex="1">
-   <caption label="no collapse" />
-     <groupbox flex="1"><label flex="1" value="Left side" /></groupbox>
-     <splitter collapse="none" />
-     <groupbox flex="1"><label flex="1" value="Right side" /></groupbox>
-  </groupbox>
-
-
 <groupbox  orient="horizontal" flex="1">
- <caption label="resize the closest widgets on both sides" />
-   <groupbox flex="1"><description>Left most side</description></groupbox>
-   <groupbox flex="1"><description>Middle Left side</description></groupbox>
-   <groupbox flex="1"><description>Closest Left side</description></groupbox>
-   <splitter collapse="none" resizebefore="closest" resizeafter="closest" />
-   <groupbox flex="1"><description>Closest Right side</description></groupbox>
-   <groupbox flex="1"><description>Middle Right side</description></groupbox>
-   <groupbox flex="1"><description>Right most side</description></groupbox>
- </groupbox>
-
-
 <groupbox  orient="horizontal" flex="1">
- <caption label="resize the farthest widgets on both sides" />
-   <groupbox flex="1"><description>Left most side</description></groupbox>
-   <groupbox flex="1"><description>Middle Left side</description></groupbox>
-   <groupbox flex="1"><description>Closest Left side</description></groupbox>
-   <splitter collapse="none" resizebefore="farthest" resizeafter="farthest" />
-   <groupbox flex="1"><description>Closest Right side</description></groupbox>
-   <groupbox flex="1"><description>Middle Right side</description></groupbox>
-   <groupbox flex="1"><description>Right most side</description></groupbox>
- </groupbox>
-
-

 

-
 <groupbox orient="horizontal" flex="1">
- <caption label="grow the widgets on the right side" />
-   <groupbox flex="1"><description>Left side</description></groupbox>
-   <splitter collapse="none" resizebefore="grow" resizeafter="grow" />
-   <groupbox flex="1"><description>Closest Right side</description></groupbox>
-   <groupbox flex="1"><description>Middle Right side</description></groupbox>
-   <groupbox flex="1"><description>Right most side</description></groupbox>
- </groupbox>
-
-
 <groupbox orient="horizontal" flex="1">
- <caption label="double splitters" />
-     <groupbox flex="1"><label flex="1" value="Left side" /></groupbox>
-     <splitter collapse="before" ><grippy /></splitter>
-     <groupbox flex="1"><label flex="1" value="Middle" /></groupbox>
-     <splitter collapse="after" ><grippy /></splitter>
-     <groupbox flex="1"><label flex="1" value="Right side" /></groupbox>
- </groupbox>
-
-

</vbox>

-

</window>

diff --git a/files/ko/mozilla/tech/xul/template_guide/index.html b/files/ko/mozilla/tech/xul/template_guide/index.html deleted file mode 100644 index 0d769a66de..0000000000 --- a/files/ko/mozilla/tech/xul/template_guide/index.html +++ /dev/null @@ -1,52 +0,0 @@ ---- -title: Template Guide -slug: Mozilla/Tech/XUL/Template_Guide -tags: - - XUL - - XUL_Template_Guide -translation_of: Archive/Mozilla/XUL/Template_Guide ---- -

 

-
XUL 템플릿 개요
- -
템플릿 문법
- -
다중 규칙
- -
템플릿 수정 방법
- -
관련 주제
- -

Interwiki Language Links

-

diff --git a/files/ko/mozilla/tech/xul/toolbar/index.html b/files/ko/mozilla/tech/xul/toolbar/index.html deleted file mode 100644 index 3efda02e8c..0000000000 --- a/files/ko/mozilla/tech/xul/toolbar/index.html +++ /dev/null @@ -1,218 +0,0 @@ ---- -title: toolbar -slug: Mozilla/Tech/XUL/toolbar -tags: - - MDC Project - - NeedsTechnicalReview - - XUL Elements - - XUL Reference -translation_of: Archive/Mozilla/XUL/toolbar ---- -
- - « XUL Reference home [ - 예제 | - Attributes | - Properties | - Methods | - 관련 항목 ] -
-

보통 한 줄로 된 버튼들을 포함하는 컨테이너로 기본적으로 내부 요소가 수평으로 나열되는 상자의 한 유형입니다. toolbartoolbox 내에 위치할 경우 grippy를 이용하여 접혀질 수 있습니다. 툴바는 항상 id 속성을 가져야 합니다. Firefox에서는 사용자 지정 툴바(도구 모음)를 지원하지만, Mozilla 브라우저는 지원하지 않습니다.

-

좀 더 자세한 사항은 XUL tutorial를 참조하세요.

-
-
- Attributes
-
- currentset, customindex, customizable, defaultset, grippyhidden, grippytooltiptext, mode, toolbarname
-
-
-
- Properties
-
- accesible, currentSet, firstPermanentChild, lastPermanentChild, toolbarName
-
-
-
- Methods
-
- insertItem
-
-

예제

-
- Image:XUL_ref_toolbar.png
-
<toolbox>
-  <toolbar id="nav-toolbar">
-    <toolbarbutton id="nav-users"  accesskey="U" label="Users"/>
-    <toolbarbutton id="nav-groups" accesskey="p" label="Groups"/>
-    <toolbarbutton id="nav-events" accesskey="E" label="Events" disabled="true"/>
-  </toolbar>
-</toolbox>
-
-

Attributes

-

- -
-
- currentset
-
- Firefox only
-
- 타입: - - comma-separated string -
-
- 현재 toolbar에 출력되는 항목의 집합입니다. 이 집합은 사용자가 툴바를 커스터마이징(사용자 지정) 할 경우 변경될 수 있습니다. 속성값은 쉼표(,)로 분리된 toolbarpalette에 있는 항목들의 ID 목록이어야 하며, 추가적으로 "separator", "spring", "spacer"의 문자열을 포함할 수 있습니다.
-
-

this isn't necessary the *current* set, i.e. it might not be equal the value of the currentSet property which is computed from the actual DOM

-
- - -
-
customindex
-
Not in SeaMonkey 1.x
-
Type: integer
-
This value is the index of the toolbar in the list of the custom toolbars. The value is updated automatically by the toolbar customization dialog.
-
-
- - -
-
customizable
-
Not in SeaMonkey 1.x
-
Type: boolean
-
Set this attribute to true on toolbars that can be customized. This causes the set of buttons to be persisted across sessions.
-
-
- - -
-
defaultset
-
Not in SeaMonkey 1.x
-
Type: comma-separated list of item ids
-
The default set of displayed items on the toolbar. This should be set to a comma-separated list of item IDs from the toolbarpalette. For example, back-button,forward-button,print-button.
-
-
- - -
-
grippyhidden
-
SeaMonkey only
-
Type: boolean
-
When set to true, the grippy will be hidden. When set to false, the default, the grippy will be shown.
-
-
- - -
-
grippytooltiptext
-
SeaMonkey only
-
Type: string
-
The text to appear on the tooltip for the toolbar's grippy when the toolbar is collapsed. This would be used to label the grippy so that the user knows which toolbar it represents.
-
-
- - -
-
mode
-
Not in SeaMonkey 1.x
-
Type: one of the values below
-
How the toolbarbuttons on the toolbar are displayed.
-
-
-
icons
-
Show only icons.
-
text
-
Show only text.
-
full
-
Show both.
-
-
-
-
- - -
-
toolbarname
-
Not in SeaMonkey 1.x
-
Type: string
-
The name of the toolbar, which is listed on the Show/Hide toolbars menu.
-
-

-

Properties

-

-
-
- accessible
-
- Type: nsIAccessible
-
- Returns the accessibility object for the element.
-
- -
-
currentSet
-
Not in SeaMonkey 1.x
-
Type: comma-separated list of strings
-
Holds a comma-separated list of the IDs of the items currently on the toolbar. For spacers, separators, and flexible spacers the following strings are used instead of IDs: "spacer", "separator", "spring". An empty toolbar has a currentSet value of "__empty".
-
- -
-
You may change the current set of items by setting this property. Be careful, as setting this property doesn't automatically update the currentset attribute.
-
- -
-
firstPermanentChild
-
Not in SeaMonkey 1.x
-
Type: element
-
The first permanent child of the toolbar. A permanent child is one that is not customizable and remains on the toolbar. Items that are placed directly inside the toolbar without being in the toolbarpalette are permanent.
-
- -
-
lastPermanentChild
-
Not in SeaMonkey 1.x
-
Type: element
-
The last permanent child of the toolbar. A permanent child is one that is not customizable and remains on the toolbar. Items that are placed directly inside the toolbar without being in the toolbarpalette are permanent.
-
-
-
- toolbarName
-
- Not in SeaMonkey 1.x
-
- Type: string
-
- The name of the toolbar.
-

-

Methods

-

-
insertItem( id, beforeNode, wrapper, beforePermanent )
-
Not in SeaMonkey 1.x
-
Return type: element
-
Add an item with the given id to the toolbar. The new item is added just before the item given by the second argument. If the second argument is null, but the beforePermanent argument is true, the item is added to the beginning of the toolbar before the first permanent item. Otherwise, if the beforePermanent argument is false, the new item is added to the end of the toolbar. The third argument can be used to wrap the new item in another element. Usually, the last argument will be null as it is mainly for the use of the customize dialog.
-
- -

The id should match an element in the toolbar's toolbarpalette. Some special ids may also be used to create special spacing items:

- - - -

The method returns the DOM element for the created item.

-

XUL 요소에서 상속됨
blur, click, doCommand, focus, getElementsByAttribute

DOM 요소에서 상속됨
addEventListener(), appendChild(), dispatchEvent(), getAttribute(), getAttributeNode(), getAttributeNodeNS(), getAttributeNS(), getElementsByTagName(), getElementsByTagNameNS(), hasAttribute(), hasAttributeNS(), hasAttributes(), hasChildNodes(), insertBefore(), isSupported(), normalize(), removeAttribute(), removeAttributeNode(), removeAttributeNS(), removeChild(), removeEventListener(), replaceChild(), setAttribute(), setAttributeNode(), setAttributeNodeNS(), setAttributeNS()

- -
-
- Elements
-
- toolbarbutton, toolbargrippy, toolbaritem, toolbarpalette, toolbarseparator, toolbarset, toolbarspacer, toolbarspring, toolbox
-
-
-
- Interfaces
-
- nsIAccessibleProvider
-
-

diff --git a/files/ko/mozilla/tech/xul/toolbarbutton/index.html b/files/ko/mozilla/tech/xul/toolbarbutton/index.html deleted file mode 100644 index b494ade76e..0000000000 --- a/files/ko/mozilla/tech/xul/toolbarbutton/index.html +++ /dev/null @@ -1,477 +0,0 @@ ---- -title: toolbarbutton -slug: Mozilla/Tech/XUL/toolbarbutton -translation_of: Archive/Mozilla/XUL/toolbarbutton ---- -
- - « XUL Reference home [ - 예제 | - Attributes | - Properties | - Methods | - 관련 항목 ] -
-

toolbar에 올라가는 버튼입니다. 일반 button과 유사하지만 조금 다르게 출력됩니다. 보통 이미지를 포함합니다.

-

자세한 사항은 XUL tutorial를 참조하세요.

-
-
- Attributes
-
- accesskey, autoCheck, checkState, checked, command, crop, dir, disabled, dlgType, group, image, label, open, orient, tabindex, type, validate
-
-
-
- Properties
-
- accessKey, accessible, autoCheck, checkState, checked, command, crop, dir, disabled, dlgType, group, image, label, open, orient, tabIndex, type
-
-

예제

-

(example needed)

-

Attributes

-

- - -
-
- accesskey
-
- 타입: - - character -
-
- 이 속성에는 단축키로 사용될 문자를 지정합니다. 문자는 대상 요소의 label 속성값인 텍스트에 포함된 문자 중 하나를 사용하는 것이 좋습니다. - -
-
-

예제

-
- Image:XUL_ref_accesskey_attr.png
-
<vbox>
-  <label value="Enter Name" accesskey="e" control="myName"/>
-  <textbox id="myName"/>
-  <button label="Cancel" accesskey="n"/>
-  <button label="Ok" accesskey="O"/>
-</vbox>
-
-

또 볼 곳

-

label attribute, acceltext attribute

- -

-
- - -
-
autocheck
-
Type: boolean
-
If this attribute is true or left out, the checked state of the button will be switched each time the button is pressed. If this attribute is false, the checked state must be adjusted manually. When autocheck is true, the button type should be "checkbox" or "radio".
-
-
- - -
-
checkState
-
Type: integer, values 0, 1, or 2
-
This attribute may be used to create three state buttons, numbered 0, 1 and 2. When in state 0 or 1, pressing the button will switch to the opposite state. When in state 2, pressing the button will switch to state 0. This means that the button acts like a checkbox except that there is a third state which must be set manually by adjusting the check state. If you wish to have different behavior for how the states are adjusted, set the autoCheck attribute to false and adjust the state with a script. The type attribute must be set to checkbox for buttons with a check state. Constants for the possible values for this attribute are in the nsIDOMXULButtonElement interface.
-
-
- - -
-
checked
-
Type: boolean
-
Indicates whether the element is checked or not.
-
Use hasAttribute() to determine whether this attribute is set instead of getAttribute().
-
For buttons, the type attribute must be set to checkbox or radio for this attribute to have any effect.
-
-
- - -
-
command
-
Type: id
-
Set to the id of a command element that is being observed by the element.
-
- - -
- -
-
- crop
-
- Type: one of the values below
-
- If the label of the element is too big to fit in its given space, the text will be cropped on the side specified by the crop attribute. An ellipsis will be used in place of the cropped text. If the box direction is reversed, the cropping is reversed.
-
-
-
- start
-
- The text will be cropped on its left side in left-to-right text locales, and the right side in right-to-left locales.
-
- end
-
- The text will be cropped on its right side in left-to-right text locales, and the right side in right-to-left locales.
-
- left
-
- The text will be cropped on its left side.
-
- right
-
- The text will be cropped on its right side.
-
- center
-
- The text will be cropped in the middle, showing both the start and end of the text normally.
-
- none
-
- The text will be not be cropped using an ellipsis. However, the text will simply be cut off if it is too large. The side depends on the CSS text alignment.
-
-
-
- Depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped. If you wish to use the value none and the displayed text is larger than this maximum width, you may be able to use the max-width CSS property (or the maxwidth attribute) to override this size. For example, for a menuitem in a menu you can add the following CSS rule when you want to use the value none:
-
-
menupopup > menuitem, menupopup > menu { max-width: none; }
-
-
-
-
- - -
-
dir
-
Type: one of the values below
-
The direction in which the child elements of the element are placed. -
-
normal
-
For scales, the scale's values are ordered from left to right (for horizontal scales) or from top to bottom (for vertical scales)  For other elements, the elements are placed left to right or top to bottom in the order they appear in the XUL code.
-
reverse
-
For scales, the scale's values are ordered from right to left (for horizontal scales) or from bottom to top (for vertical scales). For other elements, they are placed right to left or bottom to top. This is reverse of the order in which they appear in the XUL code.
-
-
-
- - -
- - -
-
disabled
-
Type: boolean
-
Indicates whether the element is disabled or not. If this attribute is set, the element is disabled. Disabled elements are usually drawn with grayed-out text. If the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire. In the case of form elements, it will not be submitted. Do not set the attribute to true, as this will suggest you can set it to false to enable the element again, which is not the case. - -
The disabled attribute is allowed only for form controls. Using it with an anchor tag (an <a> link) will have no effect.
- -
- The element will, however, still respond to mouse events. To enable the element, leave this attribute out entirely.
-
-
Visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.
-
- - -
- - -
-
dlgtype
-
Type: one of the values below
-
The dialog type of the button, used only when the button is in a dialog box. You can use this feature to replace the standard dialog box buttons with custom buttons, yet the dialog event methods will still function. For example, if the dlgType is set to accept, the button will replace the dialog box's accept button, which is usually labeled OK. Using this attribute on a button that is not in a dialog box has no effect. The following values can be used as the dialog type:
-
-
-
accept
-
The OK button, which will accept the changes when pressed.
-
cancel
-
The cancel button which will cancel the operation.
-
help
-
A help button for displaying help about the dialog.
-
disclosure
-
A button to show more information. This might be a button or a disclosure triangle.
-
extra1
-
An optional additional button.
-
extra2
-
A second optional additional button.
-
-
-
-
- - -
-
group
-
Type: string group name
-
Buttons with type="radio" and the same value for their group attribute are put into the same group. Only one button from each group can be checked at a time. If the user selects one the buttons, the others in the group are unchecked.
-
-
- -
-
image
-
Type: URI
-
The URI of the image to appear on the element. If this attribute is empty or left out, no image appears. The position of the image is determined by the dir and orient attributes.
-
- - - -
- - -
-
label
-
Type: string
-
The label that will appear on the element. If this is left out, no text appears. For an editable menuitem element the value of this attribute is copied to the menulist.value property upon user selection of the menuitem.
-
- - -
- - -
-
open
-
Type: boolean
-
For the menu type buttons, the open attribute is set to true when the menu is open. The open attribute is not present if the menu is closed.
-
-
- - -
-
orient
-
Type: one of the values below
-
Used to specify whether the children of the element are oriented horizontally or vertically. The default value depends on the element. You can also use the -moz-box-orient style property. -
-
horizontal
-
Child elements of the element are placed next to each other in a row in the order that they appear in the XUL source.
-
vertical
-
Child elements of the element are placed under each other in a column in the order that they appear in the XUL source.
-
-
-
- - -
- - -
-
tabindex
-
Type: integer
-
The tab order of the element. The tab order is the order in which the focus is moved when the user presses the "tab" key. Elements with a higher tabindex are later in the tab sequence.
-
-
- - -
-
type
-
Type: string
-
The type of button. If this attribute is not present, a normal button is created. You can set this attribute to the value menu to create a button with a menu popup. This will typically cause the button to be displayed differently.
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Examples:
type value<toolbarbutton >
 Toolbarbutton without a type attribute
menuToolbarbutton with type attribute equals "menu"
menu-buttonToolbarbutton with type attribute equals "menu-button"
checkboxToolbarbutton with type attribute equals "checkbox"
radioToolbarbutton with type attribute equals "radio"
- - -
- - -
-
validate
-
Type: one of the values below
-
This attribute indicates whether to load the image from the cache or not. This would be useful if the images are stored remotely or you plan on swapping the image frequently. The following values are accepted, or leave out the attribute entirely for default handling:
-
-
-
always
-
The image is always checked to see whether it should be reloaded.
-
never
-
The image will be loaded from the cache if possible.
-
-
-
-

-

Properties

-

-
-
- accessKey
-
- Type: character
-
- Gets and sets the value of the accesskey attribute.
-
-
-
- accessible
-
- Type: nsIAccessible
-
- Returns the accessibility object for the element.
-
- -
-
autoCheck
-
Type: boolean
-
Gets and sets the value of the autoCheck attribute.
-
-
-
- checkState
-
- Type: integer, values 0, 1, or 2
-
- Gets and sets the value of the checkState attribute.
-
-
-
- checked
-
- Type: boolean
-
- Gets and sets the value of the checked attribute.
-
- -
-
command
-
Type: element id
-
Gets and sets the value of the command attribute.
-
-
-
- crop
-
- Type: string
-
- Gets and sets the value of the crop attribute.
-
-
-
- dir
-
- Type: string
-
- Gets and sets the value of the dir attribute.
-
-
-
- disabled
-
- Type: boolean
-
- Gets and sets the value of the disabled attribute.
-
-
- -
-
dlgType
-
Type: string
-
Gets and sets the value of the dlgType attribute.
-
- -
-
group
-
Type: string group name
-
Gets and sets the value of the group attribute.
-
-
-
- image
-
- Type: image URL
-
- Gets and sets the value of the image attribute.
-
-
-
- label
-
- Type: string
-
- Gets and sets the value of the label attribute.
-
-
-
-
- open
-
- Type: boolean
-
- Gets and sets the value of the open attribute.
-
-
-
-
- orient
-
- Type: string
-
- Gets and sets the value of the orient attribute.
-
-
-
- tabIndex
-
- Type: integer
-
- Gets and sets the value of the tabindex attribute.
-
-
-
- type
-
- Type: string
-
- Gets and sets the value of the type attribute.
-
-

-

Methods

-

-

XUL 요소에서 상속됨
blur, click, doCommand, focus, getElementsByAttribute

DOM 요소에서 상속됨
addEventListener(), appendChild(), dispatchEvent(), getAttribute(), getAttributeNode(), getAttributeNodeNS(), getAttributeNS(), getElementsByTagName(), getElementsByTagNameNS(), hasAttribute(), hasAttributeNS(), hasAttributes(), hasChildNodes(), insertBefore(), isSupported(), normalize(), removeAttribute(), removeAttributeNode(), removeAttributeNS(), removeChild(), removeEventListener(), replaceChild(), setAttribute(), setAttributeNode(), setAttributeNodeNS(), setAttributeNS()

-

관련 항목

-
-
- 요소
-
- toolbar, toolbargrippy, toolbaritem, toolbarpalette, toolbarseparator, toolbarset, toolbarspacer, toolbarspring, toolbox
-
-
-
- 인터페이스
-
- nsIAccessibleProvider, nsIDOMXULButtonElement
-
-

diff --git a/files/ko/mozilla/tech/xul/toolbarpalette/index.html b/files/ko/mozilla/tech/xul/toolbarpalette/index.html deleted file mode 100644 index d2f9a2abd6..0000000000 --- a/files/ko/mozilla/tech/xul/toolbarpalette/index.html +++ /dev/null @@ -1,98 +0,0 @@ ---- -title: toolbarpalette -slug: Mozilla/Tech/XUL/toolbarpalette -tags: - - MDC Project - - NeedsTechnicalReview - - XUL Elements - - XUL Reference -translation_of: Archive/Mozilla/XUL/toolbarpalette ---- -
- - « XUL Reference home [ - 예제 | - Attributes | - Properties | - Methods | - 관련 항목 ] -
-

Firefox only

-

toolbar에 넣을 수 있는 항목들의 팔레트입니다. 이 요소는 직접 출력되지 않으며, 대신 도구 모음 설정 대화창의 항목들로 출력됩니다. toolbarpalette의 자식 요소들은 툴바에 포함될 수 있는 toolbarbuttontoolbaritem 이어야 합니다. 여백 항목은 자동적으로 포함되기 때문에 직접 추가하면 안됩니다.

-

idBrowserToolbarPalettetoolbarpaletteoverlay내에 포함하여 Firefox 브라우저에 사용자 정의 버튼을 추가할 수 있습니다.

-

예제

-

(example needed)

-

Attributes

-

- - - - - -

Inherited from XUL element
-align, -allowevents, -allownegativeassertions, -class, -coalesceduplicatearcs, -collapsed, -container, -containment, -context, -contextmenu, -datasources, -dir, -empty, -equalsize, -flags, -flex, -height, -hidden, -id, -insertafter, -insertbefore, -left, -maxheight, -maxwidth, -menu, -minheight, -minwidth, -mousethrough, -observes, -ordinal, -orient, -pack, -persist, -popup, -position, -preference-editable, -querytype, -ref, -removeelement, -sortDirection, -sortResource, -sortResource2, -statustext, -style, -template, -tooltip, -tooltiptext, -top, -uri, -wait-cursor, -width

-

-

Properties

-

-

XUL 요소에서 상속됨
align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxHeight, maxWidth, menu, minHeight, minWidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statusText, style, ,, tooltip, tooltipText, top, width

-

Methods

-

-

XUL 요소에서 상속됨
blur, click, doCommand, focus, getElementsByAttribute

DOM 요소에서 상속됨
addEventListener(), appendChild(), dispatchEvent(), getAttribute(), getAttributeNode(), getAttributeNodeNS(), getAttributeNS(), getElementsByTagName(), getElementsByTagNameNS(), hasAttribute(), hasAttributeNS(), hasAttributes(), hasChildNodes(), insertBefore(), isSupported(), normalize(), removeAttribute(), removeAttributeNode(), removeAttributeNS(), removeChild(), removeEventListener(), replaceChild(), setAttribute(), setAttributeNode(), setAttributeNodeNS(), setAttributeNS()

-

관련 항목

-
-
- Elements
-
- toolbar, toolbarbutton, toolbargrippy, toolbaritem, toolbarseparator, toolbarset, toolbarspacer, toolbarspring, toolbox
-
-

diff --git a/files/ko/mozilla/tech/xul/xul_controls/index.html b/files/ko/mozilla/tech/xul/xul_controls/index.html deleted file mode 100644 index fbafdfac68..0000000000 --- a/files/ko/mozilla/tech/xul/xul_controls/index.html +++ /dev/null @@ -1,548 +0,0 @@ ---- -title: XUL controls -slug: Mozilla/Tech/XUL/XUL_controls -tags: - - XUL -translation_of: Archive/Mozilla/XUL/XUL_controls ---- -

아래의 표는 XUL에서 제공하는 사용자 인터페이스 컨트롤들의 목록입니다. 컨트롤들의 단계별 사용 방법은 XUL Tutorial을, 레퍼런스 정보는 XUL Reference를 참고하세요.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
<button> - -

사용자가 누를 수 있는 버튼.

- -
-<button label="Save" accesskey="S"/>
-
- - -
<button type="menu"> -

드롭다운 메뉴가 붙은 버튼. 버튼을 누르면 메뉴가 열립니다.

- -
-<button type="menu" label="View">
-  <menupopup>
-    <menuitem label="List"/>
-    <menuitem label="Details"/>
-  </menupopup>
-</button>
-
- - -
<button type="menu-button"> -

메뉴가 붙은 별도의 화살표 버튼이 있는 버튼. 'menu' 유형과 달리 버튼의 메인 부분을 눌렀을 때 다른 행위를 수행할 수 있습니다.

- -
-<button type="menu-button" label="New">
-  <menupopup>
-    <menuitem label="New Document"/>
-    <menuitem label="New Image"/>
-  </menupopup>
-</button>
-
- - -
Image:Controlsguide-button-menubutton.png
<checkbox> -

켜거나 끌 수 있는 컨트롤로, 일반적으로 가능 혹은 불가능할 수 있는 옵션을 만드는데 사용됩니다.

- -
-<checkbox label="Show Toolbar Labels" checked="true"/>
-
- - -
<colorpicker> -

색을 선택하는데 사용하는 컨트롤.

- -
-<colorpicker color="#FF0000"/>
-
- - -
Image:Controlsguide-colorpicker.png
<colorpicker type="button"> -

버튼만 있는 특수한 색 선택기로, 버튼이 눌려지면 색을 선택할 수 있는 팝업이 출력됩니다.

- -
-<colorpicker type="button" color="#CC0080"/>
-
- - -
<datepicker> - - -

날짜 입력에 사용할 수 있는 텍스트박스 집합.

- -
-<datepicker value="2007/03/26"/>
-
- - -
<datepicker type="grid"> - - -

날짜를 선택할 수 있는 달력이 출력되는 형태의 날짜선택기(datepicker).

- -
-<datepicker type="grid" value="2007/02/20"/>
-
- - -
<datepicker type="popup" > - - -

날짜를 입력할 수 있는 텍스트박스와 함께 달력 팝업을 출력할 수 있는 버튼이 같이 있는 날짜 선택기.

- -
-<datepicker type="popup" value="2008/08/24"/>
-
- - -
<description> -

긴 문장의 텍스트를 출력하는데 사용되는 요소

- -
-<description>
-  Select a time for the event to start
-</description>
-
- - -
<groupbox> -

다른 사용자 인터페이스 컨트롤들을 포함하는 제목이 있는 상자 요소

- -
-<groupbox>
-  <caption label="Network"/>
-</groupbox>
-
- - -
<image> -

URL로 지정한 이미지

- -
-<image src="start.png"/>
-
- - -
<label> -

label은 특정 컨트롤의 제목을 출력하기 위해 사용됩니다.

- -
-<label control="volume" value="Volume:"/>
-
- - -
<listbox> -

listbox는 라벨이 달린 항목 중 하나를 선택하는데 사용됩니다.

- -
-<listbox>
-  <listitem label="Chocolate"/>
-  <listitem label="Jelly Beans"/>
-</listbox>
-
- - -
<menulist> -

A menulist (or combobox) is used to create a control with a drop down to select a value.

- -
-<menulist>
-  <menupopup>
-    <menulist label="Lions" value="l"/>
-    <menuitem label="Tigers" value="t"/>
-    <menuitem label="Bears" value="b"/>
-  </menupopup>
-</menulist>
-
- - -
<menulist editable="true"> -

An editable menulist is like a standard menulist except that the selected value is displayed in a textbox where it may be modified directly or values not in the popup list may be entered.

- -
-<menulist editable="true">
-  <menupopup>
-    <menuitem label="Elephants" value="Elephants"/>
-    <menuitem label="Kangaroos" value="Kangaroos"/>
-    <menuitem label="Bats" value="Bats"/>
-  </menupopup>
-</menulist>
-
- - -
<progressmeter> -

A progress meter is used to display the progress of a lengthy task.

- -
-<progressmeter value="40"/>
-
- - -
<radio> -

A radio button is used when only one of a set of options may be selected at a time.

- -
-<radiogroup>
-  <radio label="Light" value="light"/>
-  <radio label="Heavy" value="heavy"/>
-</radiogroup>
-
- - -
<richlistbox> -

The richlistbox displays a list of items where one or more may selected. Unlike the listbox which is designed to display only text, the richlistbox may display any type of content.

- -
-<richlistbox>
-  <richlistitem>
-    <image src="happy.png"/>
-  </richlistitem>
-  <richlistitem>
-    <image src="sad.png"/>
-  </richlistitem>
-  <richlistitem>
-    <image src="angry.png"/>
-  </richlistitem>
-</richlistbox>
-
- - -
<scale> - - -

A scale displays a bar with a thumb that may be slid across the bar to select between a range of values.

- -
-<scale min="1" max="10"/>
-
- - -
<textbox> -

A textbox which allows a single line of text to be entered.

- -
-<textbox value="firefox"/>
-
- - -
<textbox multiline="true"> -

A textbox which allows multiple lines of text to be entered.

- -
-<textbox multiline="true"/>
-
- - -
<textbox type="autocomplete"> -

A textbox which provides a dropdown showing matches that would complete what the user types. The user can select one to have it filled into the textbox.

- -
-<textbox type="autocomplete" autocompletesearch="history"/>
-
- - -
<textbox type="number"> - - -

A textbox for entering numbers. Two arrow buttons are displayed for cycling through values.

- -
-<textbox type="number" min="1" max="20"/>
-
- - -
<textbox type="password"> -

A textbox that hides the characters typed, used for entering passwords.

- -
-<textbox type="password"/>
-
- - -
<timepicker> - - -

A timepicker displays a set of textboxes for entering a time.

- -
-<timepicker value="12:05"/>
-
- - -
<toolbarbutton> -

A button that is displayed on a toolbar.

- -
-<toolbarbutton label="Reload"/>
-
- - -
<toolbarbutton type="menu"> -

A button that is displayed on a toolbar with a drop down menu attached to it.

- -
-<toolbarbutton type="menu" label="Show">
-  <menupopup>
-    <menuitem label="Toolbars"/>
-    <menuitem label="Status Bar"/>
-  </menupopup>
-</toolbarbutton>
-
- - -
<toolbarbutton type="menu-button"> -

A button on a toolbar that that has a separate arrow button with a menu attached to it. Unlike with the 'menu' type, a separate action may be performed when the main part of the button is pressed.

- -
-<toolbarbutton type="menu-button" label="Open">
-  <menupopup>
-    <menuitem label="Open Changed Files"/>
-    <menuitem label="Open All"/>
-  </menupopup>
-</toolbarbutton>
-
- - -
<tree> -

A tree displays a hierarchy of items in multiple columns.

- -
-<tree>
-  <treecols>
-    <treecol label="Name" flex="1"/>
-    <treecol label="Size" flex="1"/>
-  </treecols>
-  <treechildren>
-    <treeitem>
-      <treerow>
-        <treecell label="Popcorn"/>
-        <treecell label="Large"/>
-      </treerow>
-    </treeitem>
-    <treeitem>
-      <treerow>
-        <treecell label="Root Beer"/>
-        <treecell label="Small"/>
-      </treerow>
-    </treeitem>
-  </treechildren>
-</tree>
-
- - -
diff --git a/files/ko/mozilla/tech/xul/xul_reference/index.html b/files/ko/mozilla/tech/xul/xul_reference/index.html deleted file mode 100644 index 11d5570ccf..0000000000 --- a/files/ko/mozilla/tech/xul/xul_reference/index.html +++ /dev/null @@ -1,148 +0,0 @@ ---- -title: XUL Reference -slug: Mozilla/Tech/XUL/XUL_Reference -tags: - - XUL - - XUL Reference -translation_of: Archive/Mozilla/XUL/XUL_Reference ---- -

« XUL Reference « -

- - - - - - - - - -
전체 XUL 요소
-

action
-arrowscrollbox
-bbox
-binding
-bindings
-box
-broadcaster
-broadcasterset
-button
-browser
-checkbox
-caption
-colorpicker
-column
-columns
-commandset
-command
-conditions
-content
-deck
-description
-dialog
-dialogheader
-editor
-grid
-grippy
-groupbox
-hbox
-iframe
-image
-key
-keyset
-label
-listbox
-listcell
-listcol
-listcols
-listhead
-listheader
-

-
-

listitem
-member
-menu
-menubar
-menuitem
-menulist
-menupopup
-menuseparator
-notification
-notificationbox
-observes
-overlay
-page
-popup
-popupset
-preference
-preferences
-prefpane
-prefwindow
-progressmeter
-radio
-radiogroup
-resizer
-richlistbox
-richlistitem
-row
-rows
-rule
-script
-scrollbar
-scrollbox
-scrollcorner
-separator
-spacer
-splitter
-stack
-statusbar
-statusbarpanel
-

-
-

stringbundle
-stringbundleset
-tab
-tabbrowser
-tabbox
-tabpanel
-tabpanels
-tabs
-template
-textnode
-textbox
-textbox (Firefox autocomplete)
-textbox (Mozilla autocomplete)
-titlebar
-toolbar
-toolbarbutton
-toolbargrippy
-toolbaritem
-toolbarpalette
-toolbarseparator
-toolbarset
-toolbarspacer
-toolbarspring
-toolbox
-tooltip
-tree
-treecell
-treechildren
-treecol
-treecols
-treeitem
-treerow
-treeseparator
-triple
-vbox
-window
-wizard
-wizardpage
-

-
-

다른 XUL 목록

- diff --git a/files/ko/mozilla/tech/xul/xul_tutorial/adding_buttons/index.html b/files/ko/mozilla/tech/xul/xul_tutorial/adding_buttons/index.html deleted file mode 100644 index 7547d91ba9..0000000000 --- a/files/ko/mozilla/tech/xul/xul_tutorial/adding_buttons/index.html +++ /dev/null @@ -1,102 +0,0 @@ ---- -title: Adding Buttons -slug: Mozilla/Tech/XUL/XUL_Tutorial/Adding_Buttons -tags: - - XUL - - XUL_Tutorial -translation_of: Archive/Mozilla/XUL/Tutorial/Adding_Buttons ---- -

-

« 이전다음 »

-

-

이 절에서, 우리는 창에 간단한 버튼 몇 개를 추가하는 법을 살펴보겠습니다.

-

창에 버튼 추가하기

-

우리가 지금까지 만든 창은 안에 아무것도 없습니다, 그래서 아직까지는 재미있지 않습니다. 이 절에서, 우리는 찾기(Find)와 취소(Cancel) 버튼 둘을 추가합니다. 또한 창에 버튼을 두는 간단한 방법을 배웁니다.

-

HTML처럼, XUL은 UI 요소를 만드는 데 쓸 수 있는 태그가 다수 있습니다. 이 가운데 가장 기본은 button 태그입니다. 이 요소는 간단한 버튼을 만드는 데 씁니다.

-

button 요소에는 요소와 관련된 두 주요 프로퍼티 labelimage가 있습니다. 여러분은 하나나 둘 다 필요합니다. 이와 같이, button은 label, image만이나 label과 image 둘 다 있을 수 있습니다. 예를 들어, button은 보통 대화상자에서 확인(OK)과 취소(Cancel) 버튼에 씁니다.

-

button 구문

-

button 태그의 구문은 다음과 같습니다.

-
<button
-    id="identifier"
-    class="dialog"
-    label="OK"
-    image="images/image.jpg"
-    disabled="true"
-    accesskey="t"/>
-
-

속성은 다음과 같고, 모두 선택 속성입니다.

-
-
- id 
-
- 여러분이 식별할 수 있도록 버튼에 붙이는 유일한 식별자. 여러분은 모든 요소에서 이 속성을 봅니다. 여러분이 스타일시트나 스크립트에서 버튼을 참조하고 싶다면 이를 쓰고 싶을 겁니다. 그러나, 여러분은 거의 모든 요소에 이 속성을 추가해야 합니다. 단순함을 위해 항상 이 입문서의 요소에 두지는 않습니다.
-
- class 
-
- 버튼의 스타일 클래스. 이는 HTML에서와 같이 작동합니다. 버튼이 안에 보이는 스타일을 나타내는 데 씁니다. 이 경우에는 dialog값이 쓰입니다. 대개의 경우, 여러분은 버튼에 클래스를 쓰지 않습니다.
-
- label 
-
- 버튼에 보이는 label. 예를 들어, 확인( - - OK - )이나 취소( - - Cancel - ). 이 속성을 빼면, 텍스트가 보이지 않습니다.
-
- image 
-
- 버튼에 보이는 image의 URL. 이 속성을 빼면, image가 보이지 않습니다. 여러분은 또한 list-style-image 프로퍼티를 써서 스타일시트에 image를 지정할 수 있습니다.
-
- disabled 
-
- 이 속성을 true로 설정하면, button이 기능하지 않습니다. 이는 보통 회색으로 텍스트를 그립니다. 버튼이 기능하지 않으면, 버튼의 기능이 수행될 수 없습니다. 이 속성을 아주 빼면, 버튼이 작동합니다. 여러분은 JavaScript를 써서 버튼의 기능 상태를 엇바꿀(switch) 수 있습니다.
-
- accesskey 
-
- 이는 단축키(shortcut key)로 쓸 문자로 설정돼야 합니다. 이 문자는 label 텍스트에 보여야 하고 대체로 밑줄이 그려집니다. 사용자가 ALT(나 각 플랫폼마다 다른 비슷한 키)와 access key를 눌렀을 때, 버튼은 창의 어디에서나 focus를 받습니다.
-
-

button은 위에 나열된 것보다 더 많은 속성을 지원함을 유념하세요. 그 밖의 속성은 나중에 논의합니다.

-

버튼 예제

-

Example 1 : Source View

-
- Image:buttons1.png
-
<button label="Normal"/>
-<button label="Disabled" disabled="true"/>
-
-

위 예제는 그림(image)처럼 버튼을 생성합니다. 첫째 버튼은 보통 버튼입니다. 둘째 버튼은 기능하지 않으므로 회색으로 나옵니다.

-

파일 찾기(find files) 유틸리티를 위한 간단한 찾기(Find) 버튼을 만들면서 시작합니다. 아래 예제 코드는 그 방법을 보입니다.

-
<button id="find-button" label="Find"/>
-
-
- Firefox는 웹 페이지에서 chrome 창 열기를 허용하지 않으므로, 입문서의 View 링크는 보통 브라우저 창에 열림을 유념하세요. 이 때문에, button은 창을 가로질러 늘어나 보입니다. 여러분은 늘어남을 막기 위해 window 태그에 align="start"를 추가할 수 있습니다.
-
-
findfile.xul 예제
-

우리가 이전 절에서 만든 findfile.xul 파일에 이 코드를 추가합시다. 코드는 window 태그 사이에 삽입이 필요합니다. 추가한 코드는 아래에 빨간 색으로 보입니다.

-
<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<window
-    id="findfile-window"
-    title="Find Files"
-    orient="horizontal"
-     xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-  <button id="find-button" label="Find"/>
-  <button id="cancel-button" label="Cancel"/>
-
-</window>
-
-
- Image:buttons2.png
-

여러분은 취소(Cancel) 버튼 또한 추가됐음을 알아챌 겁니다. 창은 두 버튼이 서로 곁에 보이도록 horizontal 방향을 주었습니다. 혹시 여러분이 Mozilla에서 그 파일을 열면, 여기 보이는 그림 같은 것을 얻습니다.

-
-

 

-
- 우리가 XUL 파일에 직접 텍스트 label을 넣지 않았음을 유념하세요. 우리는 텍스트가 쉽게 번역될 수 있도록 대신 엔티티를 쓸 겁니다.
-

다음 절에서, 우리는 XUL 창에 label과 image를 추가하는 법을 알아보겠습니다.

-

같이 보기 more button fetaures

-

-

« 이전다음 »

-

-

diff --git a/files/ko/mozilla/tech/xul/xul_tutorial/adding_event_handlers/index.html b/files/ko/mozilla/tech/xul/xul_tutorial/adding_event_handlers/index.html deleted file mode 100644 index ca1cc19642..0000000000 --- a/files/ko/mozilla/tech/xul/xul_tutorial/adding_event_handlers/index.html +++ /dev/null @@ -1,137 +0,0 @@ ---- -title: Adding Event Handlers -slug: Mozilla/Tech/XUL/XUL_Tutorial/Adding_Event_Handlers -tags: - - XUL - - XUL_Tutorial -translation_of: Archive/Mozilla/XUL/Tutorial/Adding_Event_Handlers ---- -

 

- -

-

« 이전다음 »

-

- -

지금까지의 파일 찾기 대화창은 꽤 괜찮은 모양세를 갖추고 있습니다. 다 끝나지는 않았지만 손쉽게 간단한 사용자 인터페이스를 만들었습니다. 다음으로는 스크립트를 추가하는 방법에 대해 알아보겠습니다.

- -

스크립트 사용하기

- -

파일 찾기 대화창이 제대로 동작하려면 대화창과 사용자의 상호작용시 실행해야하는 스크립트를 추가해야 합니다. 우리는 Find 및 Cancel 버튼과 각 메뉴 명령을 처리할 스크립트를 추가하려고 합니다. 이를 위해 HTML에서와 거의 동일한 방법으로 JavaScript 함수를 이용해서 작성할 것입니다.

- -

script 요소를 사용해서 XUL 파일에 스크립트를 포함할 수 있습니다. XUL 파일에서 script 태그 내에 직접 코드를 넣을수도 있지만 별도의 파일에 코드를 포함하는게 더 좋으며, 이렇게 하면 XUL창의 로딩 속도가 약간 빨라집니다. 외부 스크립트 파일과 연결하기 위해서는 src 속성을 사용합니다.

- -
-
파일 찾기 예제
- -

파일 찾기 대화창에 스크립트를 넣어보도록 하겠습니다. 스크립트 파일의 이름을 무엇으로 하든 상관없지만, 보통 XUL 파일과 이름은 같으면서 확장자만 .js로 하여 작성합니다. 이 경우 findfile.js가 사용될 것입니다. 여는 window 태그 아래 그리고 다른 요소들 앞에 아래 줄을 추가하세요.

- -
<script src="findfile.js"/>
-
- -

우리는 스크립트 파일에 무엇을 써야하는지를 안 후에 이 파일을 생성할것 입니다. 스크립트 파일에는 이벤트 핸들러에서 호출할 수 있도록 몇 개의 함수를 정의할 것입니다.

-
- -

여러분은 하나의 XUL 파일에 여러개의 스크립트를 포함할 수 있습니다. 이를 위해서는 각각 다른 스크립트를 가리키는 여러개의 script 태그를 사용하면 됩니다. src 속성에는 상대 혹은 절대 URL을 사용할 수 있습니다. 예를 들어 다음과 같은 형식으로 URL을 사용할 수 있습니다.

- -
<script src="findfile.js"/>
-<script src="chrome://findfiles/content/help.js"/>
-<script src="http://www.example.com/js/items.js"/>
-
- -

본 자습서에서는 JavaScript의 사용법과 관련된 내용에 대해서는 다루지 않겠습니다. 이는 아주 넓은 주제이며 이를 위한 다양한 리소스들이 있습니다.

- -
-

기본적으로 JavaScript 콘솔은 웹 페이지에서 발생하는 오류만 보여줍니다. Chrome JavaScript에서 발생하는 오류를 출력하려면 설정에서 javascript.options.showInConsole 값을 true로 변경해야 합니다. 또한 디버깅을 위해 javascript.options.strict 설정값을 바꿀 수 있습니다. 이 값을 true로 설정하면, 표준에 맞지 않고 잘못 쓰여졌거나 구문에 맞지 않아서 로직 오류를 발생시킬 수 있는 것들이 JavaScript 콘솔에 기록될 것입니다.

-
- -

이벤트에 응답하기

- -

스크립트는 사용자 혹은 다른 상황에 의해 발생하는 다양한 이벤트에 응답하는 코드를 포함합니다. 대략 30개 이상의 서로 다른 이벤트가 존재하며 이것들은 각각 서로 다른 방식으로 처리됩니다. 사용자가 마우스 버튼이나 키를 누르는 것과 같은 것들이 일반적인 이벤트입니다. 각각의 XUL 요소는 서로 다른 상황에서 특정 이벤트를 발생시킬 수 있는 능력이 있습니다. 어떤 이벤트는 특정 요소에 의해서만 발생됩니다.

- -

각 이벤트는 이름을 가지고 있으며, 'mousemove' 이벤트의 경우는 사용자가 UI 요소 위에서 마우스를 움직일 경우에 발생하는 이벤트 이름입니다. XUL은 DOM Events에서 정의한 것과 동일한 이벤트 메카니즘을 사용합니다. 사용자가 마우스를 움직이는 것과 같이, 이벤트를 발생시킬 수 있는 어떤 행위가 발생하면 해당 이벤트 유형에 해당하는 이벤트 객체가 생성됩니다. 이벤트 객체에는 마우스 위치나 눌러진 키와 같은 다양한 속성이 설정됩니다.

- -

그리고 나면 이벤트는 다음의 단계에 따라 XUL로 전송됩니다.

- - - -

여러분은 캡쳐나 버블링 단계에서 이벤트에 응답할 수 있습니다. 이벤트의 전파가 모두 끝난 후에 대상 요소에 미리 정의된 기본 행위가 발생합니다.

- -

예를 들어, 마우스가 상자안에 있는 버튼위에서 움직였다면 'mousemove' 이벤트가 발생되고, 창, 문서, 상자 순으로 전송됩니다. 여기까지오면 캡쳐 단계가 끝이 납니다. 다음으로는 버튼으로 'mousemove' 이벤트가 전달됩니다. 최종 버블링 단계에서는 다시 상자, 문서, 창으로 이벤트가 전송됩니다. 버블링 단계는 당연히 캡처 단계의 역순으로 진행됩니다. 어떤 이벤트는 버블링 단계를 수행하지 않는다는 것을 알아 두십시요.

- -

여러분은 이벤트 전파 단계별로 각 요소가 이벤트에 응답하도록 리스너를 부착할 수 있습니다. 하나의 이벤트는 대상 요소의 모든 부모 요소들에게도 전달되기 때문에 특정 요소나 계층 구조상 상위에 있는 요소에도 리스너를 부착할 수 있습니다. 당연히 더 높은 위치에 있는 요소에 부착된 이벤트는 이 요소 내부에 있는 모든 요소의 알림을 받게 됩니다. 반대로 버튼에 부착된 이벤트는 해당 버튼과 관련된 이벤트만 받게 됩니다. 이것은 동일하거나 유사한 코드를 사용해서 여러개의 요소의 이벤트를 처리하고자 할 때 유용합니다.

- -

가장 일반적으로 사용되는 이벤트는 'command' 이벤트입니다. command 이벤트는 사용자가 어떤 요소를 활성화할 때 발생합니다. 예를 들어 버튼을 누르거나, 체크박스를 변경한다던지, 메뉴의 한 항목을 선택하는 것들이 이에 해당됩니다. command 이벤트는 해당 요소를 활성화하는 여러가지 방법을 자동으로 처리하기 때문에 유용하게 사용됩니다. 예를 들어 command 이벤트는 사용자가 버튼을 클릭하기 위해 마우스를 이용하던지 Enter 키를 누르던지 상관없이 발생됩니다.

- -

이벤트 리스너를 요소에 부착하는데는 2가지 방법이 있습니다. 첫 번째는 속성값에 스크립트를 사용하는 것입니다. 두 번째는 대상 요소의 addEventListener 메소드를 호출하는 것입니다. 전자는 버블링 단계에서 발생하는 이벤트만을 처리할 수 있긴 하지만, 사용하기 쉽다는 장점이 있습니다. 후자는 어떠한 단계의 이벤트도 처리할 수 있으며 한 요소의 특정 이벤트에 대해 여러개의 리스너를 부착할 수도 있습니다. 보통 대부분의 이벤트에 대해 속성을 이용하여 처리하는 형식이 더 많이 사용됩니다.

- -

속성 이벤트 리스너

- -

속성 형태를 사용하기 위해서는 이벤트에 반응해야 할 요소에 이벤트 이름 앞에 'on'이 붙은 이름의 속성을 위치시키면 됩니다. 예를 들어, 'command' 이벤트에 해당하는 속성은 'oncommand'입니다. 속성 값은 어떤 이벤트가 발생할 때 실행될 스크립트이어야 합니다. 일반적으로 이 코드는 짧은 내용이거나 별도의 스크립트에서 정의된 함수를 호출할 것입니다. 다음은 버튼이 눌러졌을때 응답하는 예제입니다.

- -

예제 1 : Source View

- -
<button label="OK" oncommand="alert('Button was pressed!');"/>
-
- -

command 이벤트는 버블링 단계를 거치기 때문에 해당 요소를 감싸는 요소(부모 요소)에도 이벤트 리스너를 부착시킬 수 있습니다. 아래의 예제에서 상자는 이벤트 리스너가 부착되어 있으며, 이 상자의 자식 요소들 모두에서 발생하는 이벤트에 응답하게 됩니다.

- -

예제 2 : Source View

- -
<vbox oncommand="alert(event.target.tagName);">
-  <button label="OK"/>
-  <checkbox label="Show images"/>
-</vbox>
-
- -

예제에서 command 이벤트는 버튼이나 체크박스에서 vbox로의 버블링 단계를 거칩니다. 만일 또 다른 리스너가 버튼에 위치해 있었다면, 이 코드가 먼저 호출되고 다음에 vbox의 핸들러가 실행될 것입니다. 이벤트 핸들러는 이벤트 객체인 'event'라는 미리 정의된 인자를 전달 받습니다. 이것은 이벤트에 관한 특정 정보를 얻기 위해 사용됩니다. 이벤트 객체에서 자주 사용되는 속성은 이벤트의 'target' 속성으로 이것은 실제로 이벤트가 발생한 대상 요소를 포함하고 있습니다. 예제에서는 대상 요소의 태그 이름이 포함된 경고창을 출력하였습니다. 버블링 단계에서 'target' 속성은 유용하게 사용할 수 있는데, 여러분은 하나의 스크립트로 여러개의 버튼들을 처리할 수 있습니다.

- -

여러분은 속성 구문이 HTML 문서에서 이벤트에 사용된것과 비슷하다는 것을 발견하였을 것입니다. 사실 HTML과 XUL 모두 동일한 이벤트 메카니즘을 공유합니다. 한 가지 중요한 차이는 HTML에서는 버튼의 응답에 'click' 이벤트(onclick 속성)가 사용되는 반면, XUL에서는 command 이벤트가 사용된다는 것입니다. XUL에서도 click 이벤트가 존재하지만 키보드가 아닌 마우스 클릭에만 응답합니다. 따라서, XUL에서는 특정 요소가 꼭 마우스에 의해서만 처리되어야만 하는 이유가 없다면 click 이벤트를 사용하지 않는게 좋습니다. 또한, command 이벤트는 요소가 사용할 수 없는 상태(disabled)일때는 전송되지 않지만 click 이벤트는 대상 요소의 상태와 상관없이 전송됩니다.

- -
-
우리의 파일 찾기 예제
- -

파일 찾기 대화창에 있는 Find와 Cancel 버튼에는 command 이벤트 핸들러를 부착할 수 있습니다. Find 버튼을 누르면 검색을 시작해야 할 것입니다. 이 부분은 아직 구현되지 않았기 때문에 지금은 그냥 두겠습니다. 그러나 Cancel 버튼을 눌렀을때는 창이 닫히게 하는 것이 좋을것 같습니다. 아래의 코드는 이것을 어떻게 하는지 보여줍니다. 동일한 코드를 Close 메뉴 항목에도 넣어 보겠습니다.

- -
<menuitem label="Close" accesskey="c" oncommand="window.close();"/>
-...
-
-<button id="cancel-button" label="Cancel"
-     oncommand="window.close();"/>
-
- -

두 개의 핸들러가 추가되었습니다. oncommand 속성이 Close 메뉴 항목에 추가되었습니다. 이 핸들러를 사용해서 사용자는 마우스로 메뉴 항목을 클릭하거나 키보드로 선택함으로서 창을 닫을 수 있습니다. Cancel 버튼에도 oncommand 핸들러가 추가되었습니다.

-
- -

DOM 이벤트 리스너

- -

이벤트 핸들러를 추가하는 두 번째 방법은 해당 요소의 addEventListener 메소드를 호출하는 것입니다. 이 방법은 동적으로 이벤트 리스너를 부착할 수 있게 해주며 캡처 단계에서 이벤트에 응답하게 해 줍니다. 구문은 다음과 같습니다.

- -

예제 3 : Source View

- -
<button id="okbutton" label="OK"/>
-
-<script>
-function buttonPressed(event){
-  alert('Button was pressed!');
-}
-
-var button = document.getElementById("okbutton");
-button.addEventListener('command', buttonPressed, true);
-</script>
-
- -

getElementById() 함수는 주어진 id에 해당하는 요소를 반환하며, 이 경우에는 버튼 요소입니다. addEventListener() 함수는 새로운 캡처 단계의 이벤트 리스너를 추가하기 위해 호출되었습니다. 첫 번째 인자는 응답할 대상 이벤트 이름입니다. 두 번째 인자는 이벤트가 발생했을 때 호출될 이벤트 리스너 함수입니다. 마지막 인자는 캡처 단계에서 사용하기 위해 true이어야 합니다. 여러분은 마지막 인자를 false로 설정하면 캡쳐 단계가 아닌 버블링 단계에서 응답하도록 합니다. 두 번째 인자로 주어진 이벤트 리스너 함수는 위의 buttonPressed 함수에서 선언된 것과 같이 인자로 event 객체 하나만 받아야 합니다.

- -
지금까지의 파일 찾기 예제 : Source View
- -

다음에는 이벤트 객체에 대해 좀 더 자세히 알아보겠습니다.

- -

-

« 이전다음 »

-

- -

diff --git a/files/ko/mozilla/tech/xul/xul_tutorial/adding_html_elements/index.html b/files/ko/mozilla/tech/xul/xul_tutorial/adding_html_elements/index.html deleted file mode 100644 index 6c3e3921ee..0000000000 --- a/files/ko/mozilla/tech/xul/xul_tutorial/adding_html_elements/index.html +++ /dev/null @@ -1,114 +0,0 @@ ---- -title: Adding HTML Elements -slug: Mozilla/Tech/XUL/XUL_Tutorial/Adding_HTML_Elements -tags: - - XUL - - XUL_Tutorial -translation_of: Archive/Mozilla/XUL/Tutorial/Adding_HTML_Elements ---- -

-

« 이전다음 »

-

-

버튼을 넣었으니 이제 다른 요소들을 더 넣어 보도록 하겠습니다.

-

창에 HTML 요소 추가하기

-

XUL 파일에는 XUL 요소뿐만 아니라 HTML 요소들도 바로 넣을 수 있습니다. 모든 HTML 요소를 XUL 파일에서 사용할 수 있기 때문에 자바 애플릿이나 테이블을 창에 표시하는 것도 가능합니다. 될 수 있으면 HTML 요소를 사용하지 않는 것이 바람직하지만(몇 가지 이유가 있지만 가장 중요한 것은 다음에 설명할 컨트롤의 배치와 관련된 것입니다.), 그래도 이번 단원에서는 XUL에서 HTML 요소를 사용하는 방법을 알아 보도록 하겠습니다. XML은 대소문자를 구별하기 때문에 모든 태그와 속성은 소문자로 입력해야 한다는 점에 유의하세요.

-

XHTML 이름공간

-

HTML 요소를 XUL 파일에서 사용하려면 먼저 XHTML 이름공간을 사용한다는 것을 선언해야 합니다. 이렇게 함으로써, Mozilla는 HTML 태그와 XUL 태그를 구별할 수 있습니다. 아래 속성이 XUL 파일의 window 태그나 제일 바깥 HTML 요소에 추가되어야 합니다.

-
xmlns:html="http://www.w3.org/1999/xhtml"
-
-

이것은 XUL 을 선언하기 위해 사용했던 것과 비슷한 것으로, HTML을 선언하는 것입니다. 이것은 위와 정확히 일치하도록 입력되어야 하며, 그렇지 않아면 제대로 작동하지 않을 것입니다. 실제로는 Mozilla가 위의 URL을 다운로드하는 것은 아니며, 그냥 HTML이라는 것을 인식하기 위한 것입니다.

-

다음은 파일 찾기 창에 추가한 예제입니다.

-
 <?xml version="1.0"?>
- <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
- <window
-   id="findfile-window"
-   title="Find Files"
-   orient="horizontal"
-   xmlns:html="http://www.w3.org/1999/xhtml"
-   xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-

이제 다음 내용만 잘 세겨두고 있으면, HTML 태그를 사용하실 수 있습니다.

- -

HTML 요소 사용하기

-

여러분은 어떠한 HTML 태그도 사용하실 수 있습니다(사실 headbody같은 것들은 쓸데가 없습니다). HTML 요소를 사용하는 몇 가지 예제를 아래에서 보실 수 있습니다.

-
<html:img src="banner.jpg"/>
-
-<html:input type="checkbox" value="true"/>
-
-<html:table>
-  <html:tr>
-    <html:td>
-      A simple table
-    </html:td>
-  </html:tr>
-</html:table>
-
-

위의 예제는 banner.jpg 이미지와 체크 박스, 단일 셀 테이블을 생성합니다. 여러분은 가능하면 XUL의 기능을 사용하는 것이 좋고, 레이아웃을 위해 테이블을 사용하지 않는게 좋습니다(레이아웃을 위한 XUL 요소가 존재합니다). 각 태그 앞에 html: 접두어가 추가되어 있는 것을 보실 수 있습니다. 이것은 Mozilla에게 이러한 태그가 XUL이 아닌 HTML 태그라는 것을 알려 줍니다. 만일 html: 부분이 빠지면 브라우저는 해당 요소가 XUL 요소인 것으로 생각할 것이며, img, input, table들은 유효한 XUL 태그가 아니기 때문에 출력되지 않을 것입니다.

-

XUL에서는 descriptionlabel 요소를 이용해서 라벨을 넣을 수 있습니다. 가능하면 이런 요소들을 사용하세요. 여러분은 컨트롤에 라벨을 넣기 위해 HTML의 label 요소를 사용하거나, 아래의 예제와 같이 다른 블럭 요소(pdiv 같은 것들)내에 직접 텍스트를 넣어서 사용할 수 있습니다.

-

예제 1 : Source View

-
<html:p>
-  Search for:
-  <html:input id="find-text"/>
-  <button id="okbutton" label="OK"/>
-</html:p>
-
-

위의 코드에서는 'Search for:'라는 텍스트가 출력되고, 다음에는 input 요소와 OK 버튼이 출력됩니다. 위에서와 같이 XUL 버튼이 HTML 요소 내에 나타날 수 있다는 점에 유의하세요. 텍스트는 보통 출력을 위해 사용되는 HTML 요소 내에 위치해야지만 출력됩니다. 바깥쪽에 있는 텍스트는 description와 같이 텍스트를 포함할 수 있는 XUL 요소외에서는 출력되지 않습니다. 아래의 예제가 도움이 될것입니다.

-

HTML 요소 예제

-

다음은 HTML 요소를 창에 추가하는 몇 가지 예제입니다. 단순하게 하기 위해 창과 다른 중복된 내용은 생략하였습니다.

-

체크 박스가 있는 대화상자

-

예제 2 : Source View

-
- Image:htmlelem-ex1.png
-
<html:p>
-  Click the box below to remember this decision.
-  <html:p>
-    <html:input id="rtd" type="checkbox"/>
-    <html:label for="rtd">Remember This Decision</html:label>
-  </html:p>
-</html:p>
-
-

위 예제에서는 하나의 p 태그는 텍스트를 감싸고 있고, 다른 p 태그는 여러 줄로 텍스트를 분리하기 위해 사용되고 있습니다.

-

HTML 블럭 바깥쪽에 있는 텍스트

-

예제 3 : Source View

-
- Image:htmlelem-ex2.png
-
<html:div>
-    Would you like to save the following documents?
-    <html:hr/>
-</html:div>
-Expense Report 1
-What I Did Last Summer
-<button id="yes" label="Yes"/>
-<button id="no" label="No"/>
-
-

그림에서 보듯이, div 태그 안에 있는 텍스트는 출력되지만 바깥쪽에 있는 텍스트(Expense Report 1과 What I Did Last Summer)는 출력되지 않습니다. 이것은 텍스트를 출력하기 위해 감싸고 있는 HTML 혹은 XUL 요소가 없기 때문입니다. 이 텍스트를 출력하기 위해서는 div 태그나 description 태그 내로 들어가야 합니다.

-

잘못된 HTML 요소

-
<html:po>Case 1</html:po>
-<div>Case 2</div>
-<html:description value="Case 3"/>
-
-

위의 세 가지 경우는 모두, 서로 다른 이유 때문에 출력되지 않습니다.

-
-
- Case 1 
-
- po는 유효한 HTML 태그가 아니며, Mozilla는 어떻게 처리해야 할지에 대해 알지 못합니다.
-
- Case 2 
-
- div는 HTML에서만 유효합니다. 제대로 동작하려면 html:한정사를 추가해야 합니다.
-
- Case 3 
-
- A description는 XUL에서만 유효한 요소입니다. html: 한정사가 없어야 합니다.
-
-

다음번에는 요소들 간에 공백(spacer) 주기에 대해 알아보겠습니다.

-

-

« 이전다음 »

-

-

diff --git a/files/ko/mozilla/tech/xul/xul_tutorial/adding_labels_and_images/index.html b/files/ko/mozilla/tech/xul/xul_tutorial/adding_labels_and_images/index.html deleted file mode 100644 index 0d4391877b..0000000000 --- a/files/ko/mozilla/tech/xul/xul_tutorial/adding_labels_and_images/index.html +++ /dev/null @@ -1,65 +0,0 @@ ---- -title: Adding Labels and Images -slug: Mozilla/Tech/XUL/XUL_Tutorial/Adding_Labels_and_Images -tags: - - XUL - - XUL_Tutorial -translation_of: Archive/Mozilla/XUL/Tutorial/Adding_Labels_and_Images ---- -

-

« 이전다음 »

-

-

이 절은 창에 label과 image를 추가하는 법을 기술합니다. 게다가, 그룹에 요소를 포함하는 법을 살펴봅니다.

-

Text 요소

-

여러분은 태그 없이는 XUL 파일에 바로 텍스트를 끼워 넣고 표시되기를 기대할 수 없습니다. 여러분을 이런 목적을 위해 XUL 요소 둘을 쓸 수 있습니다.

-

Label 요소

-

창에 텍스트를 포함하는 가장 기본 방법은 label 요소를 쓰는 겁니다. 예제를 아래에 보입니다.

-

Example 1 : Source View

-
<label value="This is some text"/>
-
-

value 속성(attribute)은 여러분이 표시되길 바라는 텍스트를 지정하는 데 쓸 수 있습니다. 텍스트는 넘겨지지(wrap) 않아서 오직 한 줄에 보입니다. 이는 짧은 텍스트 절에 어울립니다.

-

Description 요소

-

더 긴 텍스트를 위해, 여러분은 열고 닫는 description 태그 안에 content를 둘 수 있습니다. label 요소와 value 속성으로 지정된 텍스트와는 달리, child 텍스트는 필요하다면 여러 줄로 넘겨집니다. 넘겨짐(wrapping)을 보기 위해 창 크기를 조정해 보세요. HTML처럼, 줄바꿈(line break)과 여분 공백(whitespace)은 space 하나로 축약됩니다. 우리가 더 쉽게 넘겨짐을 볼 수 있도록 나중에 요소의 너비를 강제하는 법을 알아봅니다.

-

Example 2 : Source View

-
<description>
-  This longer section of text is displayed.
-</description>
-
-

내부에서, label 요소와 description 요소 둘은 같습니다. 이는 label은 여러분이 태그 안에 둔 텍스트가 넘겨질 수 있고 description은 value 속성이 있을 수 있음을 뜻합니다. label 요소 text field와 같은 컨트롤(control)의 label을 위한 목적입니다. description 요소는 dialog 상자의 상단에 informative text와 같은 other descriptive text를 위한 목적입니다. 관례에 따라, 여러분은 이 지침을 따르면 좋습니다.

-

Control 속성

-

여러분은 to set which control the label is associated with control 속성을 쓸 수 있습니다. 사용자가 label을 클릭할 때, 그 컨트롤이 focus를 받습니다. control 속성값을 focus 받을 요소의 id로 설정하세요.

-

Example 3 : Source View

-
<label value="Click here:" control="open-button"/>
-<button id="open-button" label="Open"/>
-
-

위 예제에서, label을 클릭하면 button이 focus를 받게 됩니다.

-

Image

-

HTML처럼, XUL은 창 안에 image를 표시하는 요소가 있습니다. 이 요소는 어울리게 image로 이름 지었습니다. 태그 이름이 HTML( - - img - 대신 - - image - )과 다름을 유념하세요. 여러분은 image 파일의 URL을 지정하기 위해 src 속성을 쓸 수 있습니다. 아래 예제는 이를 보입니다.

-
<image src="images/banner.jpg"/>
-
-

비록 여러분이 이 구문을 쓸 수 있을지라도, image URL을 설정하기 위해 스타일시트를 쓰는 것이 더 낫습니다. 더 나중 절에서 스타일시트 쓰는 법을 설명하지만 예제는 완결함을 위해 여기에 보입니다. 여러분은 image URL을 설정하기 위해 list-style-image CSS 프로퍼티를 쓸 수 있습니다. 여기 예제가 있습니다.

-
XUL:
- <image id="image1"/>
- <image id="search"/>
-
-
Style Sheet:
- #image1 {
-   list-style-image: url("chrome://findfile/skin/banner.jpg");
- }
-
- #search {
-   list-style-image: url("http://example.com/images/search.png");
- }
-
-

이 이미지들은 findfile 꾸러미(package)용 skin의 chrome 디렉토리에서 났습니다. image가 skin에 따라 바뀌기 때문에, 여러분은 보통 skin 디렉토리에 image를 둘 겁니다.

-

다음 절에서, 우리는 창에 입력 컨트롤을 추가하는 법을 배웁니다.

-

-

« 이전다음 »

-

-

diff --git a/files/ko/mozilla/tech/xul/xul_tutorial/adding_more_elements/index.html b/files/ko/mozilla/tech/xul/xul_tutorial/adding_more_elements/index.html deleted file mode 100644 index c801fbfbba..0000000000 --- a/files/ko/mozilla/tech/xul/xul_tutorial/adding_more_elements/index.html +++ /dev/null @@ -1,87 +0,0 @@ ---- -title: Adding More Elements -slug: Mozilla/Tech/XUL/XUL_Tutorial/Adding_More_Elements -tags: - - XUL - - XUL_Tutorial -translation_of: Archive/Mozilla/XUL/Tutorial/Adding_More_Elements ---- -

 

-

-

« 이전다음 »

-

-

파일 찾기 대화창에 몇 가지 상자를 추가하면서 상자에 대한 논의를 마무리 하겠습니다.

-
-

우리의 파일 찾기 예제에 몇가지 요소 추가하기

-

이제 파일 찾기 대화창에 몇 가지 요소를 추가하겠습니다. 먼저 파일크기 및 날짜와 같은 정보를 검색할 수 있는 기능을 추가할 것입니다.

-
<hbox>
-  <menulist id="searchtype">
-    <menupopup>
-      <menuitem label="Name"/>
-      <menuitem label="Size"/>
-      <menuitem label="Date Modified"/>
-    </menupopup>
-  </menulist>
-  <spacer style="width: 10px;"/>
-  <menulist id="searchmode">
-    <menupopup>
-      <menuitem label="Is"/>
-      <menuitem label="Is Not"/>
-    </menupopup>
-  </menulist>
-  <spacer style="width: 10px;"/>
-  <textbox id="find-text" flex="1" style="min-width: 15em;"/>
-</hbox>
-
-
- Image:boxfinal1.png
-

2 개의 드롭 다운 상자가 대화창에 추가되었습니다. 이들을 구분짓기 위해서 각 요소 사이에 spacer가 추가되어 있습니다. 이들 spacer는 각각 10픽셀 너비가 주어졌습니다. 창 크기가 바뀌면, 글상자는 커지지만 다른 구성요소는 그대로 있는 것을 보실 수 있습니다. 또한 라벨이 제거된 것을 보실 수 있습니다.

-

세로 방향의 창 크기를 바꾸더라도, 해당 요소들의 크기는 변하지 않습니다. 이것은 해당 요소가 가로상자 내부에 있기 때문입니다. 만일 찾기(Find)와 취소(Cancel) 버튼이 항상 창 하단에 있게되면 보기가 더 좋을 것입니다. 이것은 2개의 가로상자 사이에 spacer를 추가해서 간단하게 처리할 수 있습니다.

-
<spacer style="height: 10px"/>
-<hbox>
-  <menulist id="searchtype">
-    <menupopup>
-      <menuitem label="Name"/>
-      <menuitem label="Size"/>
-      <menuitem label="Date Modified"/>
-    </menupopup>
-  </menulist>
-  <spacer style="width: 10px;"/>
-  <menulist id="searchmode">
-    <menupopup>
-      <menuitem label="Is"/>
-      <menuitem label="Is Not"/>
-    </menupopup>
-  </menulist>
-  <spacer style="width: 10px;"/>
-  <textbox id="find-text" flex="1" style="min-width: 15em;"/>
-</hbox>
-
-<spacer style="height: 10px" flex="1"/>
-
-<hbox>
-
-

이제 대화창 크기가 바뀌면, 2개의 버튼은 항상 대화창 하단에 있도록 움직이게 됩니다. 첫번째 spacer는 제목 라벨과 검색 기준 요소 사이에 여백을 추가한 것입니다.

-

검색 기준 둘레에 선이 있다면 더 보기 좋을 것입니다. 이를 처리할 수 있는 방법에는 두 가지가 있습니다. CSS의 border 속성을 사용하거나 groupbox 요소를 사용할 수 있습니다. 첫 번째 방식은 상자 자체에 스타일 속성을 사용하면 됩니다. 우리는 후자의 방식을 사용할 것입니다. groupbox는 현재의 테마에 어울리는 보기 좋은 둥근 테두리를 가진 상자를 그려주는 장점이 있습니다.

-

groupbox로 상자를 변경해 보겠습니다.

-
<groupbox orient="horizontal">
-  <caption label="Search Criteria"/>
-  <menulist id="searchtype">
-  .
-  .
-  .
-  <spacer style="width: 10px;"/>
-  <textbox id="find-text" flex="1" style="min-width: 15em;"/>
-</groupbox>
-
-
- Image:boxfinal2.png
-

마찬가지로 다른 표면적인 문제가 있습니다. groupbox가 상자 하단 세로방향으로 확장되도록 groupbox를 늘릴 수도 있습니다. 또한 해당 요소가 잘 위치되도록 여백의 일부를 수정할 수도 있습니다.

-

본 자습서를 통해 요소들을 추가하면서 상자 모델과 그것들의 몇 가지 기능들에 대한 기능들에 대한 더 많은 예제를 보게 될 것입니다..

-

지금까지의 파일 찾기 예제 Source View

-
-

다음에는 스택을 작성하는 방법에 대해 알아 보겠습니다.

-

-

« 이전다음 »

-

-

diff --git a/files/ko/mozilla/tech/xul/xul_tutorial/box_model_details/index.html b/files/ko/mozilla/tech/xul/xul_tutorial/box_model_details/index.html deleted file mode 100644 index 64633c5d1d..0000000000 --- a/files/ko/mozilla/tech/xul/xul_tutorial/box_model_details/index.html +++ /dev/null @@ -1,99 +0,0 @@ ---- -title: Box Model Details -slug: Mozilla/Tech/XUL/XUL_Tutorial/Box_Model_Details -tags: - - XUL - - XUL_Tutorial -translation_of: Archive/Mozilla/XUL/Tutorial/Box_Model_Details ---- -

-

« 이전다음 »

-

-

지금까지 우리는 상자모델의 많은 기능을 살펴 보았습니다. 여기서는 몇 가지 예제를 가지고 좀 더 세부적인 내용을 알아보겠습니다.

-

레이아웃에 대한 추가 내용

-

min-widthmax-height같은 스타일 속성은 어떤 요소에든 적용할 수 있습니다. 지금까지는 이 속성들을 버튼과 글상자에만 적용했지만, 여백이나 상자 요소에도 적용할 수 있습니다. 게다가, flex 속성은 어떤 요소에든 적용할 수 있습니다.

-

예제 1 : Source View

-
<hbox flex="1">
-  <button label="Left" style="min-width: 100px;" flex="1"/>
-  <spacer flex="1"/>
-  <button label="Right" style="min-width: 100px;" flex="1"/>
-</hbox>
-
-

위의 예제에서, 3개 요소는 유연하기 때문에 스스로 크기가 조절됩니다. 2개의 버튼은 최소 넓이를 100픽셀로 하고 있습니다. 버튼은 이 크기 이하로 절대 작아지지 않지만 더 늘어날 수는 있습니다. 여기서 해당 창은 대략 200픽셀 정도의 넓이가 될 것입니다. 이는 두개의 버튼이 들어가기에 충분한 공간입니다. 3개 요소 모두가 유연하기 때문에, 더 많은 공간을 필요로 하지 않으며 flex 속성에 의해 빈 공간이 생기지 않습니다.

-
- Image:boxdet1.png
-

그림에서처럼, 두 개의 버튼은 이들을 포함하는 hbox에 맞도록 수직 방향으로도 늘어나는 것을 볼 수 있습니다. align 속성은 가로상자에서 이러한 동작을 제어하는데 사용됩니다. 또한 여러분은 요소나 상자에 최대 높이를 지정해서 늘어나지 못하게도 할 수 있습니다. 어떤 상자가 최대 높이값을 가지면, 상자내에 있는 요소들은 이것에 의해 제약을 받게 된다. 그러나 여기에도 문제가 있는데, 사전에 해당 요소가 얼마나 커야 할지 알아야 한다는 것입니다.

-

예제 2 : Source View

-
<hbox flex="1" align="top">
-  <button label="Left" style="min-width: 100px;" flex="1"/>
-  <spacer flex="1"/>
-  <button label="Right" style="min-width: 100px;" flex="1"/>
-</hbox>
-
-

상자 모델 정리

-

복잡한 레이아웃을 만드려면, 일반적으로 중첩된 상자를 추가하고 일부 요소에 최대 최소 크기를 지정해주고, 어떤 요소가 flex 속성을 가지도록 해야 합니다. 가장 좋은 인터페이스는 다양한 크기에서도 문제없이 표시될 수 있는 것입니다. 여러분 스스로 여러 경우를 시험해 보지 않으면 상자 모델을 이해하기 어려우실 겁니다.

-

다음은 두 가지 상자 형식의 기본적인 내용을 설명하고 있습니다.

-

가로상자

-
    -
  1. 서로 이웃하는 요소를 가로 방향으로 배치합니다.
  2. -
  3. 유연한 요소(flex 속성을 가진 요소)는 가로로 크기를 조절합니다.
  4. -
  5. pack 속성은 자식 요소의 가로 방향 위치를 제어합니다.
  6. -
  7. align 속성은 요소의 행이 어떻게 세로로 정렬될 지를 제어합니다.
  8. -
-

세로상자

-
    -
  1. 세로 방향으로 요소들을 배치합니다.
  2. -
  3. 유연한 요소(flex 속성을 가진 요소)는 세로로 크기를 조절합니다.
  4. -
  5. pack 속성은 자식 요소의 세로 방향 위치를 제어합니다.
  6. -
  7. align 속성은 자식 요소의 가로 정렬 방식을 제어합니다.
  8. -
-

상자는 테이블과 같은 HTML 요소 내부를 포함해서 XUL 어디에든 사용할 수 있습니다. 그러나 그러한 레이아웃은 일부 HTML 요소에 의해 제어되게 됩니다. 이는 flex 속성이 여러분이 원하는 대로 작동하지 않을 수도 있다는 것을 의미합니다. flex 속성은 상자 또는 상자 타입 요소 바로 안에 있는 요소들에 대해서만 적용된다는 점을 기억하세요.

-

레이아웃 예제

-

여백 사용하기

-

예제 3 : Source View

-
<hbox>
-  <button label="One"/>
-  <spacer style="width: 5px"/>
-  <button label="Two"/>
-</hbox>
-
-

여기서, spacer 요소는 두개의 버튼 사이의 구분자로 사용되고 있으며, 정확하게 5픽셀로 설정되어 있습니다. 여러분은 CSS의 margin 속성을 사용해서 여백을 설정할 수도 있습니다.

-

버튼 중앙정렬

-

예제 4 : Source View

-
<hbox pack="center" align="center" flex="1">
-  <button label="Look at Me!"/>
-  <button label="Push Me!"/>
-</hbox>
-
-

이 예제는 2개의 버튼을 포함하고 flex 속성이 지정된 가로 상자입니다. 해당 상자는 버튼들을 가로 중앙 정렬하기 위해 pack 속성을 사용합니다. align 속성은 버튼들을 세로로 정렬하고 있습니다. 결과적으로 상자 내 버튼들은 양방향에서 중앙에 위치하게 됩니다. 이 예제는 세로상자에도 마찬가지로 적용되는데, 다른점은 2번째 버튼이 우측이 아니라 아래에 놓이게 된다는 것입니다.

-

파일 찾기 대화창

-

예제 5 : Source View

-
<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-
-<window id="findtext" title="Find Text" orient="horizontal"
-        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-  <vbox flex="3">
-    <label control="t1" value="Search Text:"/>
-    <textbox id="t1" style="min-width: 100px;" flex="1"/>
-  </vbox>
-
-  <vbox style="min-width: 150px;" flex="1" align="start">
-    <checkbox id="c1" label="Ignore Case"/>
-    <spacer flex="1" style="max-height: 30px;"/>
-    <button label="Find"/>
-  </vbox>
-
-</window>
-
-
- Image:boxdet-ex3.jpg
-

여기서 2개의 세로상자가 만들어 지는데, 하나는 글상자를 포함하고 다른 하나는 체크상자와 버튼을 포함합니다. 좌측 상자는 우측보다 3배 큰 유연성을 가지고 있어(flex값이 3배 큼) 창의 크기가 커지면 추가 공간도 그만큼 커지게 된다. 오른쪽 상자는 최소 넓이를 150픽셀로 제한하고 있습니다.

-

글상자는 flex 속성을 가지고 있기 때문에 창 크기가 바뀌면 따라서 바뀌게 됩니다. 글상자 또한 최소넓이를 100픽셀로 제한하고 있습니다. 오른쪽 상자에는 라벨이 있는 체크상자가 있습니다. 체크상자 바로 아래에는 여백(spacer) 요소가 있습니다. 여백(spacer)은 커지거나 줄어들게 되지만 30픽셀보다 커지지는 않습니다. 결과적으로 체크상자와 찾기(Find) 버튼은 30픽셀 보다 크지는 않을 공간으로 서로 떨어져 나타나게 됩니다.

-

2번째 상자는 start라는 정렬 속성을 가지고 있습니다. 이 속성은 자식요소를 좌측 끝에 정렬시킵니다. 이를 지정하지 않았다면, 기본값은 stretch가 되는데, 자식요소를 가로으로 주욱 펼치게 되었을 것입니다. 찾기(Find) 버튼의 크기가 변하지 않게 하기 위해서는 정렬 속성을 지정해야 합니다.

-

다음에는 좀 더 특별한 유형의 상자인 the groupbox에 대해 알아보겠습니다.

-

-

« 이전다음 »

-

-

diff --git a/files/ko/mozilla/tech/xul/xul_tutorial/content_panels/index.html b/files/ko/mozilla/tech/xul/xul_tutorial/content_panels/index.html deleted file mode 100644 index d255a5fa4e..0000000000 --- a/files/ko/mozilla/tech/xul/xul_tutorial/content_panels/index.html +++ /dev/null @@ -1,55 +0,0 @@ ---- -title: Content Panels -slug: Mozilla/Tech/XUL/XUL_Tutorial/Content_Panels -tags: - - XUL - - XUL_Tutorial -translation_of: Archive/Mozilla/XUL/Tutorial/Content_Panels ---- -

 

-

-

« 이전다음 »

-

-

이번 단원에서는 HTML 페이지 혹은 외부 XUL 파일을 표시할 수 있는 패널을 추가하는 방법에 대해 알아보겠습니다.

-

자식 패널 추가하기

-

여러분은 다른 페이지의 문서 일부분을 가져오고자 할 때가 있을 것입니다. 때로는 창의 일부분만을 수정하고자 할 때도 있을 것입니다. 단계별로 진행되는 마법사 대화창이 좋은 예입니다. 마법사 대화창은 여러개의 화면을 통해 단계적으로 질문을 하고 답변을 하도록 안내해줍니다. 사용자가 다음 버튼을 클릭할 때마다 마법사의 다음 화면이 표시됩니다.

-

마법사를 만들 때 각 화면별로 다른 창이 열리도록 인터페이스를 구성할 수도 있을 것입니다. 하지만 이 방법에는 다음의 세 가지 문제점이 있습니다. 첫 번째는 각 창이 다른 위치에 나타날 수 있다는 점입니다(해결책이 있기는 합니다). 두 번째는 '뒤로'나 '다음' 버튼 등의 요소는 인터페이스 전반에 걸쳐 공통적으로 사용되기 때문에 마법사의 내용 영역만 바뀌도록 구성하는 것이 좋다는 점입니다. 세 번째는 여러 개의 창을 이용하면 스크립트를 효율적으로 사용할 수 없다는 점입니다.

-

XUL에는 마법사 인터페이스를 만들기 위한 wizard 요소가 존재한다는 점을 알고 계십시요. 이에 대해서는 이후 단원에서 설명할 것입니다.

-

또 다른 방법은 iframe 요소를 사용하는 것인데, 같은 이름의 HTML 요소와 아주 비슷하게 동작합니다. iframe은 하나의 창 내에 서로 다른 문서를 만들 수 있게 해 줍니다. 또한 iframe은 창의 어느 곳에나 위치할 수 있고 다른 파일에서 내용을 불러올 수 있다는 장점이 있습니다. iframe에서는 src 속성을 사용하여 프레임에 표시될 URL을 지정합니다. URL이 가리킬 수 있는 파일 종류에는 제한이 없지만, 보통 HTML이나 XUL 파일을 사용합니다. 스크립트를 사용하면 창에 영향을 주지 않고 iframe의 내용을 바꿀 수도 있습니다.

-

Mozilla 브라우저 창에서 웹 문서가 표시되는 영역이 바로 iframe으로 만들어진 것입니다. 사용자가 URL을 입력하거나 문서의 링크를 클릭하면 이 프레임의 소스가 변경되는 것입니다.

-
iframe 예제
-

예제 1 : Source View

-
<toolbox>
-  <toolbar id="nav-toolbar">
-    <toolbarbutton label="Back"/>
-    <toolbarbutton label="Forward"/>
-    <textbox id="urlfield"/>
-  </toolbar>
-</toolbox>
-
-<iframe id="content-body" src="http://www.mozilla.org/index.html" flex="1"/>
-
-

위 예제는 웹 브라우저로 사용할 수 있는 아주 간단한 인터페이스를 만들어 보았습니다. 상자에는 toolboxiframe 요소를 포함합니다. 툴바에는 "뒤로 가기" 버튼과 "앞으로 가기" 버튼, URL 입력란이 포함되어 있습니다(툴바에 대해서는 이후 단원에서 배울것입니다). 웹 문서는 iframe 안에 표시되는데, 예제에서는 기본적으로 welcome.html 파일이 표시됩니다.

-

이 예제는 완전한 기능을 제공하지는 않습니다. 나중에 사용자가 Enter 키를 누르는 것과 같은 특정 시점에 src 속성을 변경하는 스크립트를 추가할 것입니다.

-

브라우저

-

browser 태그를 사용하는 두 번째 유형의 내용 패널이 있습니다. 이 패널은 브라우저처럼 내용을 출력하는 프레임을 생성하고자 할 때 사용할 수 있습니다. 사실 iframe도 이러한 것을 할 수 있지만, 브라우저는 좀 더 다양한 기능을 제공합니다. 예를 들어, 브라우저는 '뒤로'나 '다음' 버튼을 사용할 수 있도록 페이지 기록을 관리합니다. browser 요소는 해당 내용의 참조자와 다른 플래그들을 가지고 페이지를 로드할 수 있습니다. 당연히, browser 태그는 브라우저와 같은 인터페이스를 만들고자 할 때 사용되어야 하지만, 간단한 패널이 필요할 때 iframe을 사용할 수도 있습니다.

-

이와 비슷한 요소인 tabbrowserbrowser의 모든 기능을 제공하면서 여러 페이지들간에 이동할 수 있는 탭바를 제공합니다. 이는 Mozilla 브라우저에서 탭브라우징 인터페이스를 제공하기 위해 사용되는 위젯입니다. 사실 tabbrowser 요소는 여러개의 browser를 포함하는 tabbox로 구현되어 있습니다. 두 가지 형태의 브라우저 모두 출력되는 페이지들을 제어하기 위한 비슷한 방법을 제공합니다.

-
browser 예제
-

예제 2 : Source View

-
<browser src="http://www.mozilla.org" flex="1"/>
-
-

iframe과 같이 src속성을 사용하여 브라우저에 url을 지정할 수 있습니다. tabbrowser에서는 위와 같이 직접 url을 지정할 수 없는데 이는 이 요소가 단지 하나의 url만 출력하는 것이 아니기 때문입니다. 대신 스크립트를 사용해서 loadURI 함수를 호출해야만 합니다.

-

브라우저는 출력하고자 하는 내용에 따라 3가지의 유형이 있습니다. 이 유형은 type 속성을 이용하여 지정합니다.

-

첫 번째 유형은 기본값이며 type 속성이 명시되지 않았을 때 사용됩니다. 이 경우 브라우저내에 로드되는 내용은 내용을 로드하는 응용 프로그램의 일부로 취급되어 외부 창에 접근할 수 있는 방법을 가지게 됩니다. 이것은 브라우저 내에 로드된 스크립트가 최상위 창을 얻으려고 시도하면, 그것은 외부의 XUL 창을 얻게 된다는 것을 의미합니다.

-

이러한 유형은 응용 프로그램의 일부인 자식 XUL 패널에서는 적당하지만, 웹 페이지를 로드하는 브라우저에서는 원치 않는 것입니다. 대신 여러분은 웹 페이지가 웹 페이지의 내용에만 접근할 수 있도록 제한하기를 원할 것입니다. 여러분은 Mozilla 브라우저 창이 메인 영역을 구성하는 tabbrowser와 함께 툴바와 상태바 등과 같은 XUL 콘텐츠를 가진다는 것을 알고 있을 것입니다. 이러한 내부 영역은 웹 페이지를 출력하지만, 웹 페이지는 이들 주위의 XUL에는 접근할 수 없습니다. 이것은 브라우저가 두 번째 유형을 사용하기 때문인데, 이 유형에서는 type 속성에 content값을 지정합니다. 이렇게 지정하면 내용이 XUL window에 접근하지 못하도록 막아줍니다. 다음은 이에 대한 예제입니다.

-
<browser src="http://www.mozilla.org" type="content" flex="1"/>
-
-
- 중요: 여러분은 browser 요소내에 원격지 웹사이트를 출력하기 위해서는 type 속성을 정확히 지정해야 합니다.
-

tabbrowser는 자기가 생성한 모든 탭 브라우저에 대해 자동으로 유형을 지정합니다. 그렇기 때문에 탭 브라우저의 경우 명시적으로 지정할 필요가 없습니다.

-

세 번째 유형은 다른 내용을 출력하기 위해 사이드바를 사용하는 것과 같이 창에 다중 브라우저 요소를 포함할때 사용됩니다. 메인 browser 요소의 type 속성을 content-primary로 지정하면 이것은 창에서 주 내용이라는 것을 나타냅니다. 이것은 창 내부의 내용이 XUL 창의 'content' 속성을 이용하여 접근할 수 있다는 점만 제외하면 content 값과 유사하게 동작합니다. 이것은 스크립트를 사용하여 주 브라우저의 내용에 접근하기 쉽게 해 줍니다. tabbrowser는 자동으로 현재 보이는 브라우저에 대해 type 속성을 content-primary로 지정하며, 이것은 여러분이 현재 보이는 내용에 대해 항상 접근할 수 있다는 것을 의미합니다.

-

다음에는 분할자(splitter)를 작성하는 방법에 대해 알아보겠습니다.

-

-

« 이전다음 »

-

-

diff --git a/files/ko/mozilla/tech/xul/xul_tutorial/creating_a_window/index.html b/files/ko/mozilla/tech/xul/xul_tutorial/creating_a_window/index.html deleted file mode 100644 index 3152f51638..0000000000 --- a/files/ko/mozilla/tech/xul/xul_tutorial/creating_a_window/index.html +++ /dev/null @@ -1,113 +0,0 @@ ---- -title: Creating a Window -slug: Mozilla/Tech/XUL/XUL_Tutorial/Creating_a_Window -tags: - - XUL - - XUL_Tutorial -translation_of: Archive/Mozilla/XUL/Tutorial/Creating_a_Window ---- -

-

« 이전다음 »

-

- -
-

우리는 이 입문서를 통해 간단한 파일 찾기(find files) 유틸리티를 만들어 볼 작정입니다.

-
- -

하지만, 먼저 XUL 파일의 기본 구문을 살펴보겠습니다.

- -

XUL 파일 만들기

- -

XUL 파일은 어떤 이름도 줄 수 있지만 사실 확장자는 .xul입니다. 가장 간단한 XUL 파일의 구조는 다음과 같습니다.

- -
<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-
-<window
-    id="findfile-window"
-    title="Find Files"
-    orient="horizontal"
-    xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-<!-- Other elements go here -->
-</window>
-
- -

이 창은 아무런 UI 요소를 담고 있지 않기 때문에 아무것도 하지 않습니다. UI 요소는 다음 절(section)에서 추가합니다. 여기서는 위 코드를 한줄한줄 설명합니다.

- -
    -
  1. <?xml version="1.0"?>
    - 이 줄은 이 파일이 XML 파일임을 간단히 선언합니다. 보통 HTML 파일 상단에 HTML 태그를 놓는 것과 같이 이 줄을 각 xul 파일 상단에 추가합니다.
  2. -
  3. <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
    - 이 줄은 파일에 쓸 스타일 시트를 지정하는 데 씁니다. 이는 XML 파일이 스타일 시트를 가져오는(import) 데 쓰는 구문입니다. 이 경우에, 우리는 스킨 꾸러미(package)의 전역(global) 부분에 있는 스타일을 가져옵니다. 우리가 특정 파일을 지정하지 않기에 Mozilla가 디렉토리에서 어떤 파일을 쓸 지 결정합니다. 위 경우에, 가장 중요한 global.css 파일이 선택됩니다. 이 파일은 모든 XUL 요소를 위한 기본 선언 전부를 담고 있습니다. XML은 요소가 표시되는 법에 관한 아무런 지식이 없기 때문에, 그 파일은 방법을 나타냅니다. 보통, 모든 XUL 파일 상단에 이 줄을 놓습니다. 또한 비슷한 구문을 써서 다른 스타일 시트를 가져오기도 합니다. 보통은 자신의 스타일 시트 파일 안에서 전역 스타일 시트를 가져옴을 유념하세요.
  4. -
  5. <window
    - 이 줄은 창(window)을 기술함을 선언합니다. 각 사용자 인터페이스 창은 개별 파일에서 기술합니다. 이 태그는 대체로 HTML에서 전체 내용(content)을 둘러싸는 BODY 태그와 같습니다. 여러 속성window 태그에 놓일 수 있습니다 -- 이 경우에는 넷입니다. 예제에서, 각 속성은 각 줄에 놓이지만 그래야만 하는 건 아닙니다.
  6. -
  7. id="findfile-window"
    - id 속성은 창이 스크립트에 의해 참조될 수 있도록 식별자(identifier)로 쓰입니다. 여러분은 보통 모든 요소에 id 속성을 놓습니다. 이름은 여러분이 원하는 아무거나 될 수 있지만 뭔가 관련이 있으면 좋습니다.
  8. -
  9. title="Find Files"
    - title 속성은 창이 표시될 때 제목 표시줄에 나타나는 텍스트를 기술합니다. 이번 경우에는 '파일 찾기' 텍스트가 나타납니다.
  10. -
  11. orient="horizontal"
    - orient 속성은 창의 항목 배열을 지정합니다. horizontal값은 항목이 창을 가로질러 가로로 놓임음 나타냅니다. 여러분은 또한 항목이 세로로 놓임을 뜻하는 vertical값을 써도 됩니다. 이 값이 기본값이므로, 혹시 여러분이 세로 방향이길 바라면 속성을 아주 빼도 됩니다.
  12. -
  13. xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
    - 이 줄은 여러분이 창 요소의 자식 모두가 XUL임을 나타내기 위해 창 요소에 놓는 XUL용 이름공간(namespace)을 선언합니다. 이 URL은 실제로 결코 내려받지 않음을 유념하세요. Mozilla는 이 URL을 내부로 인지합니다.
  14. -
  15. <!-- Other elements go here -->
    - 이 주석 블록을 창에 나타내기 위해 다른 요소(버튼, 메뉴, 다른 사용자 인터페이스 컴포넌트)로 바꾸세요. 우리는 이 가운데 일부를 다음 여러 절에서 추가합니다.
  16. -
  17. </window>
    - 그리고 끝으로, 파일 끝에서 window 태그를 닫을 필요가 있습니다.
  18. -
- -

창 열기

- -

XUL 창을 열기 위해, 쓸 수 있는 여러 방법이 있습니다. 혹시 여러분이 단지 개발 단계에 있다면, 그냥 Mozilla 브라우저 창 주소 표시줄에 URL(chrome:, file:이든 다른 URL 형이든)을 입력할 수 있습니다. 여러분은 또한 파일 관리자에서 Mozilla와 관련된 XUL 파일로 생각하는 파일을 두 번 클릭할 수 있습니다. XUL 창은 새 창이 아닌 브라우저 창에 나타나지만 이는 개발 초기 단계 동안은 대개 충분합니다.

- -

물론 옳은 방법은 JavaScript를 써서 창을 여는 겁니다. HTML 문서를 위해 할 수 있는 것처럼 window.open() 함수를 쓰는 것 같은 새 구문이 필요하지 않습니다. 그러나, 'chrome'으로 불리는 추가 flag 하나가 이것이 여는 chrome 문서임을 브라우저에 나타내기 위해 필요합니다. 이는 보통 브라우저 창에 있는 도구 표시줄, 메뉴 등이 없이 창을 엽니다. 구문은 아래에 기술합니다:

- -
window.open(url,windowname,flags);
-
-where the flags contains the flag "chrome" as in this example
-
-window.open("chrome://navigator/content/navigator.xul", "bmarks", "chrome,width=600,height=300");
-
- -
-
findfile.xul 예제
- -

파일 찾기 대화상자를 위한 기본 파일을 만들면서 시작하죠. findfile.xul 파일을 만들어 findfile.manifest 파일(우리가 이전 절에서 만들었슴)에 지정된 content 디렉토리에 넣으세요. 이 페이지 상단에 보이는 XUL 템플릿을 파일에 추가하고 저장하세요.

-
- -

여러분은 Mozilla가 시작할 때 XUL 파일을 지정하기 위해 명령줄 매개변수 '-chrome'을 쓸 수 있습니다. 지정하지 않으면, 기본 창 열기가 열립니다(보통은 브라우저 창). 예를 들어, 우리는 다음 가운데 어느 쪽으로도 파일 찾기 대화상자를 엽니다.

- -
mozilla -chrome chrome://findfile/content/findfile.xul
-
-mozilla -chrome resource:/chrome/findfile/content/findfile.xul
-
- -

여러분이 명령줄(여러분의 플랫폼에 있다고 가정)에서 이 명령을 실행하면, 파일 찾기 대화상자를 Mozilla 브라우저 창 대신에 기본값으로 엽니다. 물론, 우리가 창에 아무런 UI 요소도 넣지 않았기 때문에, 나타난 창을 볼 수 없습니다. 다음 절에서 일부 요소를 추가합니다.

- -

효과를 보기 위해, 다음은 북마크 관리자 창을 엽니다.

- -
mozilla -chrome chrome://communicator/content/bookma...rksManager.xul
-
-혹시 Firefox를 쓴다면, 아래로 해보세요.
-firefox -chrome chrome://browser/content/bookmarks/b...rksManager.xul
-
- -

'-chrome' 인수는 파일에 아무런 추가 특권(privilege)을 주지 않습니다. 대신, 주소 표시줄이나 메뉴와 같은 브라우저 chrome 없이 최상위 창으로 지정된 파일을 열게 합니다. 오직 chrome URL에 추가 특권이 있습니다.

- -
Extension Developer's Extension은 여러분이 XUL 코드를 쳐 넣고 Mozilla 안에서 실시간으로 결과를 보게 하는 XUL 편집기를 담고 있습니다!
- -

문제 해결하기

- - - -
 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-
- -

다음 절에서, 우리는 창에 버튼 몇 개를 추가합니다.

- -

-

« 이전다음 »

-

- -

diff --git a/files/ko/mozilla/tech/xul/xul_tutorial/cross_package_overlays/index.html b/files/ko/mozilla/tech/xul/xul_tutorial/cross_package_overlays/index.html deleted file mode 100644 index 18ae26938a..0000000000 --- a/files/ko/mozilla/tech/xul/xul_tutorial/cross_package_overlays/index.html +++ /dev/null @@ -1,79 +0,0 @@ ---- -title: Cross Package Overlays -slug: Mozilla/Tech/XUL/XUL_Tutorial/Cross_Package_Overlays -tags: - - XUL - - XUL_Tutorial -translation_of: Archive/Mozilla/XUL/Tutorial/Cross_Package_Overlays ---- -

 

-

-

« 이전다음 »

-

-

이번 단원에서는 오버레이를 임포트(import)하지 않는 파일에 오버레이를 적용하는 방법에 대해 알아보겠습니다.

-

다른 꾸러미에 오버레이 적용하기

-
- 알림: 이번 단원에서는 content.rdf를 통해 오버레이를 적용하는 방법에 대해 설명하며, Gecko 1.8 (Firefox 1.5) 부터는 선언 파일(manifest file)을 사용하는 것으로 변경되었습니다.
-

오버레이는 또 다른 유용한 기능을 제공합니다. 앞 단원 예제에서는 오버레이가 창에 의해 임포트(import)되었습니다. 여러분은 다른 방법으로 오버레이 스스로 적용할 대상 창을 명시하게도 할 수 있습니다. 여러분은 꾸러미 내에 있는 contents.rdf 파일을 수정해서 이를 지정할 수 있습니다. 이렇게 하면 오버레이를 적용하고자 하는 꾸러미를 수정하지 않고도 해당 꾸러미의 사용자 인터페이스를 변경할 수 있기 때문에 아주 유용합니다. 예를 들어 여러분은 Mozilla 브라우저 창에 메뉴 항목이나 툴바를 추가할 수 있습니다.

-

우리는 이 기능을 이용해서 Mozilla 브라우저 창에 툴바를 추가할 것입니다. Mozilla Mail 응용프로그램은 브라우저 창에 내용을 넣기 위해 오버레이를 사용합니다. 예를 들어 Mail이 설치되어 있지 않다면 새 메시지(New Message) 명령이 없지만, 설치되어 있다면 오버레이가 메뉴에 적용되어 새 메시지(New Message) 명령이 추가됩니다. 아래에서는 파일 찾기 툴바를 브라우저에 추가할 것입니다. 이 기능이 유용한 것은 아니지만 어쨌든 이렇게 하겠습니다.

-

Mozilla는 chrom 꾸러미, 스킨, 로케일 목록을 작성하는데 사용되는 contents.rdf 파일에 오버레이 목록을 추가할 수 있게 해 줍니다. 만일 오버레이를 작성하면 이것을 contents.rdf 파일에 추가할 수 있습니다. 그리고 오버레이를 적용하고자 하는 각 창 하나씩 항목을 추가합니다.

-
-

파일 찾기 예제

-

먼저 간단한 오버레이를 만들겠습니다. 여기에는 검색할 파일이름과 디렉토리를 입력할 수 있는 요소들만 들어 있습니다. 이 파일을 findfile.xul 파일이 있는 findfile 디렉토리에 foverlay.xul이라는 이름으로 저장하세요.

-

foverlay.xul 예제

-

Source

-
<?xml version="1.0"?>
-
-<overlay
-    xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-<toolbox id="navigator-toolbox">
-  <toolbar id="findfile_toolbar">
-    <label control="findfile_filename" value="Search for files named:"/>
-    <textbox id="findfile_filename"/>
-    <label control="findfile_dir" value="Directory:"/>
-    <textbox id="findfile_dir"/>
-    <button label="Browse..."/>
-  </toolbar>
-</toolbox>
-
-</overlay>
-
-

위 파일에서 overlay를 window로 바꾸면 내용을 볼 수 있습니다. 여기서 특별하다고 할만한 것은 toolbox에 사용된 id입니다. 이 값(navigator-toolbox)은 브라우저 창(navigator.xul)에 있는 toolbox의 id와 동일합니다. 이는 브라우저 창의 toolbox에 오버레이가 적용되고 별도의 툴바에 내용이 추가된다는 것을 의미합니다.

-

이 오버레이를 선언 파일에 적용하기 위해서는 두 가지 리소스(resource)를 추가해야 합니다. 먼저, 오버레이를 적용할 각각의 창을 하나씩 추가합니다. 아래의 코드는 contents.rdf 파일의 닫는 RDF 태그 앞에 들어가야 합니다.

-
<RDF:Seq about="urn:mozilla:overlays">
-  <RDF:li resource="chrome://navigator/content/navigator.xul"/>
-</RDF:Seq>
-
-

이 코드는 오버레이 창을 루트(root) 오버레이 노드(urn:mozilla:overlay)의 자식에 넣는다는 것을 선언합니다. 여러분은 오버레이를 적용하고자 하는 창에 해당하는 li 노드를 추가해서 다른 노드를 추가할 수 있습니다.

-

다음은 창에 적용할 각 오버레이를 위한 노드를 추가합니다. 이번 경우에는 하나만 있지만 다른것도 추가할 수 있습니다. 이 줄을 위의 코드 다음 줄에 추가하세요.

-
<RDF:Seq about="chrome://navigator/content/navigator.xul">
-  <RDF:li>chrome://findfile/content/foverlay.xul</RDF:li>
-</RDF:Seq>
-
-
-
- Image:crosspov1.jpg
-

Mozilla는 이 정보를 읽은 후 다른 창에 적용되는 오버레이 목록을 만듭니다. 이 정보는 chrome/overlayinfo 디렉토리에 저장됩니다. 이 디렉토리에 있는 파일들을 직접 수정할 필요는 없습니다. 이 파일들은 Mozilla가 처음 실행되거나 새로운 꾸러미가 설치되면 자동으로 생성되고 수정됩니다. 그러나 이 디렉토리와 chrome.rdf 파일을 삭제해서 강제로 이 데이터들이 재작성되도록 할 수 있습니다.

-

여러분은 이러한 기법을 추가 스타일시트를 적용하는데 사용할 수 있습니다. 다음 예는 이러한 것을 보여줍니다.

-
<RDF:Seq about="urn:mozilla:stylesheets">
-  <RDF:li resource="chrome://messenger/content/messenger.xul"/>
-</RDF:Seq>
-
-<RDF:Seq about="chrome://messenger/content/messenger.xul">
-  <RDF:li>chrome://blueswayedshoes/skin/myskinfile.css</RDF:li>
-</RDF:Seq>
-
-

 

-
- 여기서부터는 Gecko 1.8 (Firefox 1.5)에서부터 사용하는 선언 파일을 통해 오버레이를 적용하는 방법입니다.
-
-

Gecko 1.8 (Firefox 1.5) 이후부터는 선언 파일을 이용하여 다른 꾸러미에 오버레이를 적용합니다. 파일 찾기 대화창을 위한 선언 파일인 findfile.manifest에 다음을 추가하면 됩니다.

-
overlay chrome://browser/content/browser.xul chrome://findfile/content/foverlay.xul
-
-
-

다음 단원에서는 XUL 응용프로그램을 위한 인스톨러(installer) 작성 방법에 대해 알아보겠습니다.

-

-

« 이전다음 »

-

-

diff --git a/files/ko/mozilla/tech/xul/xul_tutorial/element_positioning/index.html b/files/ko/mozilla/tech/xul/xul_tutorial/element_positioning/index.html deleted file mode 100644 index ce1d1c2c83..0000000000 --- a/files/ko/mozilla/tech/xul/xul_tutorial/element_positioning/index.html +++ /dev/null @@ -1,259 +0,0 @@ ---- -title: Element Positioning -slug: Mozilla/Tech/XUL/XUL_Tutorial/Element_Positioning -tags: - - XUL - - XUL_Tutorial -translation_of: Archive/Mozilla/XUL/Tutorial/Element_Positioning ---- -

-

« 이전다음 »

-

- -

이번에는 XUL 요소의 크기와 위치를 지정하는 방법을 알아 보겠습니다.

- -

Box 요소의 위치 지정

- -

지금까지 상자 속의 요소들을 가로나 세로로 정렬하는 방법을 배웠습니다. 우리는 상자 속 요소의 크기와 위치를 제어할 필요가 있으며, 이를 위해 먼저 상자가 작동하는 원리에 대해 좀 더 알아볼 필요가 있습니다.

- -

XUL에서는 배치 방식(layout style)에 따라 내부 요소들의 위치가 결정됩니다. 예를 들어 가로 상자에 버튼을 추가하면 만약 추가된 버튼의 앞에 다른 요소가 있다면, 앞 버튼의 오른쪽에 위치하게 됩니다. 요소의 크기는 그 요소가 필요로 하는 크기와 사용자가 지시한 크기, 두 가지 요인에 의해 결정됩니다. 요소가 필요로 하는 크기는 그 요소 안에 무엇이 있느냐에 따라 달라집니다. 예를 들어 버튼의 너비는 버튼에 표시되는 문자열의 길이에 의해 결정됩니다.

- -

일반적으로 요소의 크기는 내부의 것들을 표시하기에 딱 알맞은 크기로 결정됩니다. 글상자(textbox) 같은 몇몇 요소들에는 기본 크기가 지정되어 있습니다. 일반 상자는 그 내부의 요소들을 모두 포함할 수 있을 만큼 충분한 크기를 가지게 됩니다. 예를 들어 세 개의 버튼을 포함하는 가로 상자의 너비는 세 개의 버튼과 약간의 여백을 포함할 정도의 넓어집니다.

- -
Image:boxstyle1n.png
- -

그림에서 앞의 두 버튼은 문자열을 표시하기에 알맞은 크기로 되어 있습니다. 세 번째 버튼은 글자가 더 많기 때문에 크기가 더 큽니다. 버튼을 포함하고 있는 상자의 너비는 세 버튼의 너비와 버튼들 간의 사이 공간을 더한 전체 너비가 됩니다. 버튼의 높이도 글씨의 크기에 맞춰져 있습니다.

- -

Width와 height 속성

- -

여러분은 아마 창 내의 요소 크기를 좀 더 세밀히 제어할 필요가 있을 것입니다. 그래서 XUL은 요소의 크기를 조정할 수 있는 다양한 기능을 제공합니다. 그 중에서 가장 쉬운 방법은, HTML의 img에 너비와 높이를 주는 방식과 아주 비슷하게, 해당 요소에 widthheight 속성을 사용하는 것입니다. 다음은 이러한 예를 보여주고 있습니다.

- -

예제 1 : Source View

- -
<button label="OK" width="100" height="40"/>
-
- -

하지만 이러한 방법은 사용 환경이나 테마에 따라 문제가 발생할 수 있기 때문에 그렇게 추천할 만한 방법이 아닙니다. 더 나은 방법은 style 속성을 이용하는 것인데, 이는 HTML의 스타일 시트와 유사하게 작동합니다. 이 때는 다음의 CSS 속성을 사용할 수 있습니다.

- -
-
width 
-
요소의 너비를 지정합니다.
-
height 
-
요소의 높이를 지정합니다.
-
- -

이 속성을 사용하면 지정된 너비와 높이를 가진 요소가 생성됩니다. 만약 하나의 값만 지정하면 나머지 값은자동으로 계산됩니다. 이러한 크기 스타일을 지정할 때는 수치와 단위를 함께 입력해야 합니다.

- -

유연한 요소들

- -

유연하지 않은(non-flexible) 요소의 크기는 쉽게 계산됩니다. 이런 요소들은 지정된 크기 그대로 화면에 나타나며, 만약 크기가 지정되지 않으면 내용을 표시하기에 알맞게 크기가 정해집니다. 하지만 유연한(flexible) 요소의 크기를 계산하는 것은 조금 까다롭습니다.

- -

유연한 요소란 flex 속성의 값이 0보다 큰 요소입니다. 이들은 사용 가능한 공간에 맞추어 크기가 커지거나 줄어든다는 것을 이전 섹션에서 말씀드렸습니다. 이들의 처음 크기는 유연하지 않은(inflexible) 요소와 똑같이 계산됩니다. 다음의 예제는 앞서 말한 내용에 대해 보여줍니다.

- -

예제 2 : Source View

- -
<window orient="horizontal"
-        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-<hbox>
-  <button label="Yes" flex="1"/>
-  <button label="No"/>
-  <button label="I really don't know one way or the other"/>
-</hbox>
-
-</window>
-
- -

이 창을 열면 처음에는 위에서 본 그림처럼 나타날 것입니다. 앞의 두 버튼은 너비가 기본값과 같을 것이고 세 번째 버튼은 글자가 더 많기 때문에 너비가 더 클 것입니다. 첫번째 버튼은 유연하도록 설정되었으며 세 버튼 모두 상자에 포함되어 있습니다. 상자의 너비는 세 버튼의 총 너비(그림에서는 약 430 픽셀)로 맞춰질 것입니다.

- -

만일 창의 크기를 늘리면 XUL은 빈 공간을 매꾸기 위해서 유연한 요소들이 있는지 검사합니다. 위 예제에서첫번째 버튼이 유연한 요소이지만, 창을 늘려도 버튼의 크기가 변하지 않을 것입니다. 이는 버튼을 포함하는 상자가 유연하지 않기 때문입니다. 유연하지 않은 요소는 사용 가능한 공간이 늘어나도 크기가 변하지 않으며 따라서 버튼도 더 커질 수가 없는 것입니다.

- -

상자도 유연 요소로 만들면 문제가 해결됩니다. 그리고 나서 창을 늘리면 빈 공간이 생기고 이 빈 공간을 채우기 위해 상자의 크기도 변경됩니다. 상자가 더 커지면 상자 내부에 빈 공간이 생기고 그러면 상자 내부의 유연 요소인 버튼이 늘어나 빈 공간을 채우게 됩니다. 이러한 과정은 중첩된 상자에 대해 반복되어 처리됩니다.

- -

최소 크기와 최대 크기 지정하기

- -

여러분은 어떤 요소가 유연하면서도 특정 크기보다는 더 커지지 않도록 크기를 제한해야 할 때도 있을 수 있습니다. 또 그 반대로 최소 크기를 지정하고 싶을 때도 있을 것입니다. 이러한 제한들은 다음의 네 가지 속성을 사용해서 설정할 수 있습니다.

- -
-
minwidth 
-
요소의 최소 너비를 지정한다.
-
minheight 
-
요소의 최소 높이를 지정한다.
-
maxwidth 
-
요소의 최대 너비를 지정한다.
-
maxheight 
-
요소의 최대 높이를 지정한다.
-
- -

위의 모든 값은 픽셀로 계산됩니다. 그리고 위의 속성 대신 CSS의 min-width, min-height, max-width, max-height를 이용해도 됩니다.

- -

이 속성들은 유연한 요소에만 적용됩니다. 예를 들어 최대 높이를 지정한 유연한 버튼은 지정된 높이만큼만 늘어날 수 있습니다. 최대 높이까지 늘어난 버튼은 창의 크기를 늘려도 더 이상 늘어나지 않습니다. 이 버튼을 포함하는 상자에 최대 높이를 지정하지 않으면 상자는 버튼과 상관 없이 계속해서 늘어날 것입니다.

- -

만약 두 버튼이 동일하게 유연하다면, 두 버튼이 빈 공간을 똑같이 나누어 가질 것이다. 이 때 한 버튼에 최대 너비가 지정되어 있다면 남은 하나의 버튼이 남은 공간을 차지하게 됩니다.

- -

만약 상자에 최대 너비나 높이가 지정되어 있다면 상자 내의 요소들은 그 이상 커질 수가 없습니다. 마찬가지로 상자에 최소 너비나 높이가 지정되어 있으면 상자 내의 요소들은 그 이하로 줄어들 수가 없습니다.

- -
너비와 높이를 지정한 예제들
- -
<button label="1" style="width: 100px;"/>
-<button label="2" style="width: 100em; height: 10px;"/>
-<button label="3" flex="1" style="min-width: 50px;"/>
-<button label="4" flex="1" style="min-height: 2ex; max-width: 100px"/>
-<textbox flex="1" style="max-width: 10em;"/>
-<description style="max-width: 50px">This is some boring but simple
-wrapping text.</description>
-
- -
-
예제 1
-
첫 번째 버튼은 너비가 100픽셀(px는 픽셀을 의미)이 될 것입니다. 만약 단위를 입력하지 않으면 너비가 적용되지 않을 것입니다.
-
예제 2
-
두 번째 버튼은 높이가 10px, 너비가 100em(em은 사용하고 있는 글꼴의 한 글자 크기)으로 표시될 것입니다.
-
예제 3
-
세 번째 버튼은 유연한 요소이므로 버튼을 포함하는 상자의 크기에 따라 크기가 변경될 것입니다. 하지만 이 버튼은 50px 이하로는 줄어들지 않을 것입니다. 이 때는 다른 유연한 요소들이 유동비(flex값의 비율)와 상관 없이 남은 공간을 채울 것입니다.
-
예제 4
-
네 번째 버튼은 유연하지만 높이가 2ex(ex는 사용하고 있는 글꼴의 x의 크기) 이하로 줄어들지 않고, 100px 이상으로 늘어나지도 않을 것입니다.
-
예제 5
-
글상자는 유연하지만 크기가 10em 이상으로 늘어나지 않을 것입니다. 글자와 관련된 크기를 정할 때는 주로 em을 사용합니다. 글꼴이 변경되면서 글자의 크기가 변할 수 있지만 글상자의 크기를 em으로 지정하면 언제나 글꼴에 맞추어서 크기가 정해지기 때문에 매우 유용합니다.
-
예제 6
-
description 요소의 최대 너비가 50픽셀로 지정되어 있습니다. 글자가 50픽셀을 넘으면 나머지 글자는 다음 줄에 표시될 것입니다.
-
- -
-
우리의 파일 찾기 대화창
- -

위에서 본 스타일들 중 몇 가지를 파일 찾기 대화창에 추가해 보도록 하겠습니다. 우리는 글상자의 크기가 창의 크기에 맞추어 변하도록 만들어 볼 것입니다.

- -
<textbox id="find-text" flex="1" style="min-width: 15em;"/>
-
- -
Image:boxstyle1.png
- -

위에서 글상자를 유연하게 만들었습니다. 이제 사용자가 대화창의 크기를 변경하면 글상자도 함께 늘어날 것입니다. 이는 사용자가 긴 문자열을 입력하고자 할 때 유용합니다. 또 최소 너비가 15em이기 때문에 글상자는 항상 적어도 15글자를 표시할 수 있게 되었습니다. 사용자가 창을 아주 작은 크기로 줄여도 글상자는 15em 이하로는 줄어들지 않을 것입니다. 이 때는 글상자가 마치 대화창의 경계를 벗어난 것처럼 그려질 것입니다. 그림에서와 같이 글상자가 창의 크기에 딱 맞추어져 있습니다.

-
- -

상자 묶기

- -

유연한 상자가 두 개의 자녀 요소를 갖고 있는데, 둘 다 유연하지 않다면 어떻게 될까요? 아래의 예를 보겠습니다.

- -

예제 3 : Source View

- -
<box flex="1">
-  <button label="Happy"/>
-  <button label="Sad"/>
-</box>
-
- -

창의 크기가 변경되면 상자의 크기도 이에 맞추어 변경됩니다. 하지만 두 개의 버튼은 크기가 고정되어 있기 때문에 변하지 않을 것입니다. 따라서 상자의 내부에 빈 공간이 생겨 창의 오른쪽 부분에 빈 공간이 생긴 것처럼 보이게 됩니다. 하지만 아마 여러분은 왼쪽에 빈 공간이 생기고, 창의 오른쪽으로 버튼이 정렬되게끔 하고 싶을 때도 있을 것입니다.

- -

상자 안에 여백(spacer)를 넣으면 되지만, 매번 그렇게 하는 것은 너무 성가실 것입니다. 더 좋은 방법은 boxpack 속성을 이용하는 것입니다. 이 속성은 상자내의 자식 속성을 어떻게 포장 할지를 나타내는 속성입니다. 수평 상자에서는 자식 요소들의 수평 위치를 제어하는데 사용되며, 수직 정렬 상자에서는 수직 위치를 제어하는데 사용됩니다. 이 속성에 사용할 수 있는 값은 다음의 세 가지입니다.

- -
-
start 
-
자식 요소를 수평 상자에서는 왼쪽에, 수직 상자에서는 위쪽에 위치시키며 이것이 기본값입니다.
-
center 
-
자식 요소를 상자의 중앙에 위치시킵니다.
-
end 
-
자식 요소를 수평 상자에서는 오른쪽에, 수직 상자에서는 아래쪽에 위치시킵니다.
-
- -

pack 속성은 자식 요소가 아니라 자식 요소를 포함하는 상자에 적용해야 합니다.

- -

앞의 예제를 자식 요소들이 중앙에 오도록 하려면 다음과 같이 수정할 수 있습니다.

- -

예제 4 : Source View

- -
<box flex="1" pack="center">
-  <button label="Happy"/>
-  <button label="Sad"/>
-</box>
-
- -

이제 창의 크기가 변경되면 버튼이 모두 가로 방향의 중앙에 위치합니다. 이를 앞의 예와 비교해 보세요.

- -

상자 정렬

- -

위의 Happy-Sad 예에서 창의 너비를 변경하면 상자의 너비도 함께 변경됩니다. 창의 높이를 변경하면 버튼의 높이도 변하는 것을 보실 것입니다. 이것은 다른 방향으로는 자동으로 크기 유연성이 지정되기 때문입니다.

- -

이러한 동작 방법은 align 속성을 이용하면 조정할 수 있습니다. align 속성은 수평 상자에서는 자식 요소의 수직 위치를, 수직 상자에서는 자식 요소의 수평 위치를 조정하는데 사용합니다. 사용할 수 있는 값은 pack과 비슷합니다.

- -
-
start 
-
자식 요소를 수평 상자의 윗부분에, 수직 상자의 왼쪽에 정렬합니다.
-
center 
-
자식 요소를 상자의 중앙에 정렬합니다.
-
end 
-
자식 요소를 수평 정렬 상자의 아래쪽에, 수직 정렬 상자의 오른쪽에 정렬합니다.
-
baseline 
-
문자열이 위로 올라오도록 자식 요소를 정렬합니다. 이 속성은 수평 정렬 상자에만 적용됩니다.
-
stretch 
-
이 속성의 기본값으로, 자식 요소들이 유연한 요소처럼 상자의 크기에 맞춰 늘어나도록 합니다. 단, 상자의 정렬 방향의 반대 방향에만 적용됩니다.
-
- -

pack 속성과 마찬가지로 align 속성도 자식 요소가 아닌 자식 요소를 포함하는 상자에 적용해야 합니다.

- -

다음의 예제에서 첫 번째 상자는 align 속성이 지정되지 않았기 때문에 자식 요소들이 늘어나게 됩니다. 하지만 두 번째 상자는 align 속성에 따라 자식 요소들이 한 가운데에 정렬되는 것을 볼 수 있을 것입니다.

- -

예제 5 : Source View

- -
<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-
-<window id="yesno" title="Question" orient="horizontal"
-        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-  <hbox>
-    <button label="Yes"/>
-    <button label="No"/>
-  </hbox>
-  <hbox align="center">
-    <button label="Maybe"/>
-    <button label="Perhaps"/>
-  </hbox>
-
-</window>
-
- -
Image:boxstyle2-b.png
- -

여러분은 pack과 align 속성 대신 style의 -moz-box-pack-moz-box-align을 사용할 수 있습니다.

- -
상자의 여러 가지 속성에 대해 직접 시험해 보시려면, 상자 정렬 예제를 이용해 보시기 바랍니다.
- -

문자열과 버튼 자르기

- -

여러분은 아마 버튼의 최대 너비보다 긴 라벨을 가진 버튼 요소를 만들지도 모릅니다. 물론 문자열이 들어갈 만큼 버튼을 크게 만들면 되겠지만, 버튼(과 라벨을 가진 다른 요소)의 crop 속성을 이용하면 라벨이 너무 큰 경우 라벨이 잘려지는 방법을 제어할 수 있습니다.

- -

문자열이 잘리면 잘린 부분에 말줄임표(...)가 나타납니다. crop 속성에 사용할 수 있는 값은 아래의 네 가지입니다.

- -
-
start 
-
문자열의 왼쪽이 잘립니다.
-
end 
-
문자열의 오른쪽이 잘립니다.
-
center 
-
문자열의 왼쪽과 오른쪽이 모두 잘립니다.
-
none 
-
이 속성의 기본값으로 문자열이 잘리지 않습니다.
-
- -

이 속성은 대화창이 어떤 크기에서든 사용할 수 있도록 만들 때 정말로 유용합니다. crop 속성은 label 속성을 갖는 요소들에서 사용할 수 있습니다. 아래의 예는 crop 속성의 사용법을 보여줍니다.

- -

예제 6 : Source View

- -
Image:boxstyle2.png
- -
<button label="Push Me Please!" crop="end" flex="1"/>
-
- -

창이 줄어들면 문자열의 오른쪽이 잘리는 것을 볼 수 있습니다.

- -
-

지금까지의 파일 찾기 예제 : Source View

-
- -

다음에는 지금까지 살펴본 상자 모델에 대한 요약과 함께 박스 모델에 대한 추가적인 세부 사항에 대해 알아보겠습니다.

- -

-

« 이전다음 »

-

diff --git a/files/ko/mozilla/tech/xul/xul_tutorial/focus_and_selection/index.html b/files/ko/mozilla/tech/xul/xul_tutorial/focus_and_selection/index.html deleted file mode 100644 index c2cc18a638..0000000000 --- a/files/ko/mozilla/tech/xul/xul_tutorial/focus_and_selection/index.html +++ /dev/null @@ -1,132 +0,0 @@ ---- -title: Focus and Selection -slug: Mozilla/Tech/XUL/XUL_Tutorial/Focus_and_Selection -tags: - - XUL - - XUL_Tutorial -translation_of: Archive/Mozilla/XUL/Tutorial/Focus_and_Selection ---- -

 

-

-

« 이전다음 »

-

-

본 단원에서는 요소의 포커스(focus)와 선택(selection)을 다루는 방법에 대해 알아보겠습니다.

-

포커스를 얻은 요소

-

포커스를 얻은 요소라는 것은 현재의 입력 이벤트를 받는 요소를 의미합니다. 만일 창에 세 개의 텍스트 상자가 있다면, 포커스를 가진 것이 사용자가 현재 텍스트를 입력할 수 있는 텍스트 상자가 됩니다. 창 별로 한번에 하나의 요소만이 포커스를 가질 수 있습니다.

-

사용자는 마우스로 요소를 클릭하거나 Tab 키를 눌러서 포커스를 변경할 수 있습니다. Tab 키가 눌러지면, 다음 요소가 포커스를 받습니다. 이전 요소가 포서스를 받게 하려면 Shift와 Tab 키를 누르면 됩니다.

-

탭 순서 바꾸기

-

사용자가 Tab 키를 눌렀을 때 포커스를 받는 요소의 순서를 바꾸기 위해서는 요소에 tabindex 속성을 넣으면 됩니다. 이 속성은 숫자값으로 지정되어야 합니다. 사용자가 Tab을 누르면, 다음 번 tabindex 값을 가진 요소로 이동합니다. 이것은 요소의 인덱스값을 순서대로 지정해서 요소의 순서를 지정할 수 있다는 것을 의미합니다. 일반적으로는 tabindex 속성을 지정하지 않을 것입니다. 이럴 경우에는 Tab을 누르면 다음에 출력된 요소로 포커스가 이동할 것입니다. 여러분은 순서를 바꾸고 싶을 때만 탭 인덱스를 지정하면 됩니다. 예제는 다음과 같습니다.

-

예제 1 : Source View

-
<button label="Button 1" tabindex="2"/>
-<button label="Button 2" tabindex="1"/>
-<button label="Button 3" tabindex="3"/>
-
-

focus 이벤트

-

focus 이벤트는 어떤 요소가 포커스를 받았을 때 반응하기 위해 사용됩니다. blur 이벤트는 요소에서 포커스가 벗어났을 때 반응하기 위해 사용됩니다. 여러분은 code>onfocus</code>나 onblur 속성을 요소에 붙여 포커스의 변화에 반응할 수 있습니다. 이 속성들은 HTML에 있는 해당 속성과 아주 비슷합니다. 이 이벤트 핸들러들은 요소를 강조(highlight)하거나 상태바에 텍스트를 출력하고자 할 때 보통 사용됩니다. 다음 예제는 포커스 이벤트를 처리하는 함수를 적용한 것을 보여주고 있습니다.

-

예제 2 : Source View

-
<script>
-
-function displayFocus(){
-  var elem=document.getElementById('sbar');
-  elem.setAttribute('value','Enter your phone number.');
-}
-
-</script>
-
-<textbox id="tbox1"/>
-<textbox id="tbox2" onfocus="displayFocus();"/>
-<description id="sbar" value=""/>
-
-

예제에서 focus 이벤트가 발생하면 displayFocus 함수가 호출될 것입니다. 이 함수는 텍스트 라벨의 값을 변경합니다. 우리는 이 예제를 확장해서 blur 이벤트가 발생할 때 텍스트가 제거되도록 만들수도 있을 것입니다. 일반적으로 사용자가 요소를 선택함에 따라 인터페이스의 일부분을 변경하기 위해 focus와 blur 이벤트를 사용합니다. 예를 들어 여러분은 사용자가 필드에 값을 입력함에 따라 합계를 갱신하거나 값의 유효성을 검증하는데 focus 이벤트를 사용할 수 있습니다. focus나 blur 이벤트에서 alert 창을 띄우지 마세요. 이렇게 하는 것은 사용자를 혼란스럽게 만들며, 아주 나쁜 사용자 인터페이스 디자인입니다.

-

또한 DOM 함수인 addEventListener를 사용해서 이벤트 핸들러를 동적으로 등록할 수 있습니다. 이 함수는 어떤 요소나 이벤트에도 사용할 수 있습니다. 여기에는 3개의 인자가 있는데 이들은 이벤트 유형, 이벤트가 발생했을 때 실행할 함수, 이벤트 캡쳐를 수행할지를 여부를 나타내는 불린값(boolean) 입니다.

-

현재 포커스를 가진 요소 가져오기

-

현재 포커스를 가진 요소는 명령 발송자(command dispatcher)라고 불리는 객체에 저장되며, 이 객체는 창에 하나만 존재합니다. 명령 발송자는 사용자가 인터페이스를 사용함에 따라 포커스를 가진 요소의 변화를 추적하는 역활을 수행합니다. 명령 발송자는 또 다른 역활도 수행하는데 이에 대해서는 다음 단원에서 자세히 알아 보겠습니다. 지금은 명령 발송자가 가진 기능들 중 포커스와 관련된 것들에 대해서만 알아보겠습니다.

-

여러분은 documentcommandDispatcher 속성을 이용해서 창의 명령 발송자 객체를 얻을 수 있습니다. 이곳에서 발송자의 focusedElement 속성으로부터 포커스를 가진 요소를 얻을 수 있습니다( document.commandDispatcher.focusedElement).

-

예제 3 : Source View

-
<window id="focus-example" title="Focus Example"
-        onload="init();"
-        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-<script>
-function init(){
-  addEventListener("focus",setFocusedElement,true);
-}
-
-function setFocusedElement(){
-  var focused = document.commandDispatcher.focusedElement;
-  document.getElementById("focused").value = focused.tagName;
-}
-</script>
-
-<hbox>
-  <label control="username" value="User Name:"/>
-  <textbox id="username"/>
-</hbox>
-
-<button label="Hello"/>
-<checkbox label="Remember This Decision"/>
-
-<label id="focused" value="-No focus-"/>
-
-</window>
-
-

예제에서 창에 focus 이벤트 핸들러를 부착하였습니다. 우리는 캡처 이벤트 핸들러를 사용하려고 하기 때문에 addEventListener 메소드를 사용하였습니다. 이 메소드를 이용해 창에 캡처 이벤트 핸들러를 등록하고 setFocusedElement 메소드가 호출되도록 하였습니다. 이 메소드는 명령 발송자로부터 포커스를 가진 요소를 가져와서 이 요소의 태그 이름을 라벨에 출력하게 됩니다. 포커스를 가진 요소가 바뀌면, 라벨도 해당 요소의 태그 이름으로 변경됩니다.

-

여기서 몇 가지 확인해야 할 점이 있습니다.

- -

라벨이 포커스를 가질 수 있게 만들기

-

만일 사용자 정의 요소(XBL)를 만들어 봤다면, 어떤 요소가 포커스를 가질 수 있는지의 여부를 수정할 필요가 있었을 것입니다. 이를 위해, -moz-user-focus라는 특별한 스타일 속성을 사용할 수 있습니다. 이 속성은 요소가 포커스를 받을 수 있는지의 여부를 제어합니다. 예를 들어, 다음 예제와 같이 라벨이 포커스를 가질 수 있게도 할 수 있습니다.

-

예제 4 : Source View

-
<label id="focused" style="-moz-user-focus: normal;"
-          onkeypress="alert('Label Focused');" value="Focus Me"/>
-
-

해당 스타일 속성이 normal로 지정되었습니다. 여러분은 요소가 포커스를 가질 수 없게 하기 위해 ignore값을 지정할 수도 있습니다. 이 값은 요소를 사용 불가능한 상태로 만들기 위해 사용해서는 안되며 대신 disabled 속성을 사용하는 것이 좋습니다. 왜냐하면 이 속성이 이런 목적을 위해 존재하는 것이기 때문입니다. 일단 예제의 라벨에 포커스가 주어지면 키 입력에 응답할 수 있습니다. 원래 라벨은 일반적으로 포커스를 받지 않도록 되어 있기 때문에 포커스가 주어져도 어떤 표시도 나타나지는 않습니다.

-

포커스를 바꾸기

-

현재 포커스를 가진 요소를 바꾸는 몇 가지 방법이 있습니다. 가장 간단한 방법은 포커스를 지정하고자 하는 XUL 요소의 focus 메소드를 호출하는 것입니다. 요소에서 포커스를 제거하려면 blur 메소드를 호출하면 됩니다. 다음은 이러한 내용의 예제입니다.

-

예제 5 : Source View

-
<textbox id="addr"/>
-
-<button label="Focus" oncommand="document.getElementById('addr').focus()"/>
-
-

또는 명령 발송자 객체의 advanceFocusrewindFocus 메소드를 호출할 수도 있습니다. 이 메소드들은 포커스를 순서대로 다음 요소나 이전 요소로 옮깁니다. 이것은 사용자가 Tab이나 Shift+Tab 키를 눌렀을때와 동일한 것입니다.

-

텍스트 상자는 포커스를 받을때마다 focused라는 특별한 속성이 추가됩니다. 스크립트나 스타일시트에서 텍스트 상자가 포커스를 가지고 있는지 검사하려면 이 속성이 존재하는지 검사하면 됩니다. 만일 텍스트 상자가 포커스를 가지고 있다면 이 속성은 true값을 가지고, 포커스가 없다면 속성이 존재하지 않습니다.

-

여러분이 포커스를 다음 요소로 옮기고 싶다고 가정해 봅시다. 사용자는 보통 Tab 키를 눌러 포커스를 옮깁니다. XUL 브라우저에서는 다음과 같이 아무데서나 할 수 있습니다.

-
      document.commandDispatcher.advanceFocus();
-
-

사실 commandDispatchernsIDOMXULCommandDispatcher interface를 구현한 것입니다. 포커스를 처리하는 방법과 관련해 다른 많은 함수들이 존재합니다.

-

플랫폼에 따른 동작

-
-
- Mac OS X
-
- "Full Keyboard Access" (FKA)라는 설정이 존재합니다. XUL은 이 값에 충실하다는 것을 알아두세요. 이것은 FKA 설정이 off로 되어 있으면 텍스트 상자와 리스트/트리만이 키보드 또는 focus()를 사용한 코드로 포커스를 가질 수 있습니다.
-
-

텍스트 변경 처리

-

사용자가 텍스트 상자의 값을 변경할 때와 관련된 2가지 이벤트가 있습니다. 당연히 이 이벤트들은 포커스를 가진 텍스트 상자로만 전송됩니다.

- -

텍스트 선택

-

텍스트 상자로 작업할 경우 입력된 전체 텍스트가 아닌 사용자가 선택한 것만을 가져오길 원할때가 있을 것입니다. 또는 현재 선택한 텍스트를 변경하고자 할 때도 있을 것입니다.

-

XUL 텍스트상자는 선택을 가져오거나 수정하는 방법을 제공합니다. 가장 단순한 것은 텍스트상자에 있는 모든 텍스트를 선택하는 것입니다. textboxselect 메소드를 이용해서 이를 수행합니다.

-
tbox.select();
-
-

그러나 텍스트의 일부분만 선택하고자 할 수도 있습니다. 이를 위해서는 setSelectionRange 함수를 사용할 수 있습니다. 이 함수는 두개의 인자를 가지며, 첫번째 인자는 시작 문자의 위치이고 두번째는 선택하고자 하는 텍스트의 마지막 문자 위치입니다. 이 값들은 0 기반으로 첫번째 문자는 0이고 두번째는 1과 같이 진행됩니다.

-
tbox.setSelectionRange(4,8);
-
-

예제는 다섯번째 부터 여덟번째 문자까지를 선택합니다. 만일 필드에 여섯개의 문자만 입력되어 있다면, 다섯번째와 여섯번째 문자만 선택되고 오류가 발생하지는 않습니다.

-

만일 두 인자에 동일한 값을 사용하면, 선택의 시작과 끝이 같이 위치가 됩니다. 이는 텍스트상자에서 커서의 위치를 변하게 할 뿐입니다. 예를 들어 아래는 커서를 텍스트의 처음으로 이동하게 하기 위해 사용될 수 있습니다.

-
tbox.setSelectionRange(0,0);
-
-

여러분은 또한 selectionStartselectionEnd 속성을 이용해서 현재 선택된 위치를 가져올 수 있습니다. 이 속성들은 현재 선택된 것의 시작과 끝 위치를 나타냅니다. 만일 둘다 동일한 값으로 설정되어 있으면 아무런 텍스트도 선택되어 있지 않다는 것이며, 커서는 해당 위치로 이동합니다. 만일 시작과 끝 위치를 안다면, 전체 텍스트 중 일부 문자열을 뽑아낼 수 있습니다.

-

텍스트 상자의 내용을 수정하거나 가져오려면 value 속성을 사용하면 됩니다.

-

텍스트 상자의 또 한가지 유용한 속성은 textLength로 입력된 문자의 개수를 담고 있습니다.

-

다음 단원에서는 commands를 사용하는 방법에 대해 알아보겠습니다.

-

-

« 이전다음 »

-

-

diff --git a/files/ko/mozilla/tech/xul/xul_tutorial/grids/index.html b/files/ko/mozilla/tech/xul/xul_tutorial/grids/index.html deleted file mode 100644 index 473c269406..0000000000 --- a/files/ko/mozilla/tech/xul/xul_tutorial/grids/index.html +++ /dev/null @@ -1,156 +0,0 @@ ---- -title: Grids -slug: Mozilla/Tech/XUL/XUL_Tutorial/Grids -tags: - - XUL - - XUL_Tutorial -translation_of: Archive/Mozilla/XUL/Tutorial/Grids ---- -

 

-

-

« 이전다음 »

-

-

XUL에는 표 형식의 격자를 만들기 위한 요소들이 있습니다.

-

XUL 표 형식의 레이아웃

-

XUL에는 표와 같은 방식으로 배치하기 위해 grid 및 관련 요소들을 사용합니다. 이것은 HTML의 table 태그와 약간 비슷합니다. Grid는 자체만으로는 아무것도 출력되지 않으며, 단지 행과 열을 가진 표 형식으로 요소들을 배치시키기 위해서만 사용합니다.

-

Grid에는 table처럼 행으로 정렬되는 요소가 있습니다. grid 내부에는 사용되는 행과 열을 선언합니다. HTML의 table 처럼, 행 안에 라벨이나 버튼과 같은 내용을 넣을 수 있습니다. 그러나 grid는 행 또는 열 기반의 구조로 작성할 수 있어, 행이나 열 아무쪽에 내용을 포함할 수 있습니다. Table과 같이 행 기반으로 사용하는 것이 가장 일반적입니다. 행 기반으로 사용하더라도 격자 내 열의 크기와 모양을 설정하기 위해 열을 사용할 수 있습니다. 다른 방법으로는 열에 내용을 넣고, 모양은 행에서 설정할 수도 있습니다.

-

Grid 선언하기

-

행 묶음을 선언하기 위해서는 rows 태그를 grid의 자식 요소로 사용해야 합니다. 이 요소 내부에는 row 요소를 추가해야 하며, 이는 각 행을 표현하기 위해 사용합니다. 행 내부에 넣고자 하는 내용은 row 요소 내에 두면 됩니다.

-

비슷하게 열 묶음은 columns 요소로 선언하고, grid를 자식요소로 두어야 합니다. 이 요소 내에는 column 요소가 들어가게 되고, 각 요소는 격자 내의 각 열에 해당하게 됩니다.

-

예제를 통해 여태까지의 내용을 쉽게 이해하실 수 있을 것입니다.

-

예제 1 : Source View

-
- Image:grids1.png
-
<grid flex="1">
-
-  <columns>
-    <column flex="2"/>
-    <column flex="1"/>
-  </columns>
-
-  <rows>
-    <row>
-      <button label="Rabbit"/>
-      <button label="Elephant"/>
-    </row>
-    <row>
-      <button label="Koala"/>
-      <button label="Gorilla"/>
-    </row>
-  </rows>
-
-</grid>
-
-

예제에는 격자에 2개의 행과 열이 추가되어 있습니다. 각각의 열은 column 태그로 선언되어 있고 flex 속성이 주어져 있습니다. 각 행은 두 개의 버튼 요소를 포함하고 있습니다. 각각의 row 요소에 있는 첫 번째 버튼은 격자의 첫 번째 열에 위치하고 두 번째 버튼은 두 번째 열에 위치합니다. XUL의 grid에서는 방(cell)을 정의하는 요소가 존재하지 않습니다. 이는 HTML의 td와 같은 요소가 없다는 것을 의미합니다. 대신 row 요소에 내용을 직접 넣으면 됩니다.

-

여러개의 요소를 가지는 격자

-

당연히, button 요소의 위치에는 어떤 요소든 사용할 수 있습니다. 만일 특정 방에 여러개의 요소들을 넣고자 한다면, 중첩된 hbox나 다른 상자 요소를 사용하면 됩니다. hbox는 단일 요소지만 내부에 원하는 만큼의 요소를 넣을 수 있습니다. 다음은 이러한 예제입니다.

-

예제 2 : Source View

-
<grid flex="1">
-
-  <columns>
-    <column/>
-    <column flex="1"/>
-  </columns>
-
-  <rows>
-    <row>
-      <label control="doctitle" value="Document Title:"/>
-      <textbox id="doctitle" flex="1"/>
-    </row>
-    <row>
-      <label control="docpath" value="Path:"/>
-      <hbox flex="1">
-        <textbox id="docpath" flex="1"/>
-        <button label="Browse..."/>
-      </hbox>
-    </row>
-  </rows>
-
-</grid>
-
-
- Image:grids2.png
-

그림에서 라벨 요소를 포함하는 첫 번째 열에는 각 행별로 한개 요소씩만 있는 것을 볼 수 있습니다. 두 번째 열, 두 번째 행은 상자를 포함하며, 상자에는 textboxbutton 두 가지 요소를 포함하고 있습니다. 여러분은 하나의 방안에 중첩된 상자나 다른 격자도 추가할 수 있습니다.

-

예제에서 창의 크기를 조절하면, 다른 요소들은 그대로이지만 글상자들의 크기만 변하는 것을 볼 수 있습니다. 이것은 글상자들과 두 번째 column 요소에 flex 속성이 설정되어 있기 때문입니다. 라벨은 크기를 조절할 필요가 없기 때문에, 첫 번째 열에는 flex 속성을 지정할 필요가 없습니다.

-

열의 초기 넓이는 열에 있는 요소들 중 가장 큰 것에 의해 결정됩니다. 마찬가지로 행의 높이는 행에 있는 요소들의 크기에 의해 결정됩니다. 여러분은 격자의 크기를 좀 더 자세히 정의하기 위해 minwidthmaxwidth, 그리고 관련 속성을 사용할 수 있습니다.

-

열 기반 구조

-

행 대신에 column 요소 내에 요소를 넣을 수 있습니다. 이렇게 할 경우, rows는 단지 행의 개수를 지정하기 위해서만 사용됩니다.

-

예제 3 : Source View

-
<grid>
-  <rows>
-    <row/>
-    <row/>
-    <row/>
-  </rows>
-
-  <columns>
-    <column>
-      <label control="first" value="First Name:"/>
-      <label control="middle" value="Middle Name:"/>
-      <label control="last" value="Last Name:"/>
-    </column>
-    <column>
-      <textbox id="first"/>
-      <textbox id="middle"/>
-      <textbox id="last"/>
-    </column>
-  </columns>
-
-</grid>
-
-

이 격자는 3개의 행과 2개의 열을 가집니다. row 요소는 행이 필요로하는 공간을 확보하기 위해서 사용한 것입니다. 여러분은 행이 유연하게 동작하도록 flex 속성을 추가할 수 있습니다. 내용은 각 열에 위치합니다. column 요소 내에 있는 첫 번째 요소는 첫 번째 행에, 그리고 두 번째 요소는 두 번째 행에 그리고 세 번째 요소는 세 번째 행에 위치합니다.

-

만일 column과 row 양쪽 모두에 내용을 넣는다면, 동일한 위치에 있는 내용들은 중첩되어 출력됩니다. 이렇게 하면 격자 내에 stack 요소를 포함하는 것처럼 보입니다.

-

grid 태그 내 요소들의 순서는 어떤 것이 위에 출력되고 어떤 것이 아래에 놓이는지를 결정합니다. 만일 rows 요소가 columns 요소 다음에 위치하면, rows 안에 있는 내용이 상위에 표시되고, columns 요소가 rows 요소 다음에 오면, columns 내의 내용이 상위에 표시됩니다. 마찬가지로, 마우스 버튼과 키누름과 같은 이벤트는 맨 위에 있는 요소들에게만 전달됩니다. 이런 이유로 위의 예제에서는 행이 먼저 오고 다음에 열이 선언되었습니다. 만약 columns가 먼저 위치했다면, rows가 이벤트를 잡아채기 때문에 입력란에 아무것도 입력할 수 없게 됩니다.

-

격자의 유연성

-

중첩된 상자 대신 격자를 사용하면 수직, 수평 모두 유연한 공간을 만들 수 있는 장점이 있습니다. 이렇게 하기 위해서는 행과 열 모두에 flex 속성을 설정하면 됩니다. 다음은 이러한 효과를 보여주는 예제입니다.

-

예제 4 : Source View

-
<grid flex="1">
- <columns>
-  <column flex="5"/>
-  <column/>
-  <column/>
- </columns>
- <rows>
-  <row flex="10">
-    <button label="Cherry"/>
-    <button label="Lemon"/>
-    <button label="Grape"/>
-  </row>
-  <row flex="1">
-    <button label="Strawberry"/>
-    <button label="Raspberry"/>
-    <button label="Peach"/>
-  </row>
- </rows>
-</grid>
-
-

예제에서 첫 번째 열과 두 개의 행이 유연하게 작성되었습니다. 이것은 첫 번째 열에 있는 모든 방이 가로 방향의 유연성을 가진다는 것을 의미합니다. 또한, 모든 행이 유연하도록 설정되어 모든 방은 세로 방향의 유연성을 가집니다. 첫 번째 행과 열에 해당하는 방(Cherry 버튼)은 가로 방향으로는 5만큼, 세로 방향으로는 10의 유연성을 가지며, 그 다음 방(Lemon 버튼)은 세로 방향으로만 유동적입니다.

-

또한 grid 요소에도 flex 속성이 설정되어 있기 때문에 전체 격자가 유연하며, 이렇지 않을 경우는 한 방향으로만 늘어나게 됩니다.

-

열 걸침(column spanning)

-

격자에는 몇 개의 행 또는 열을 병합한 방을 만들 수 있는 방법이 없습니다( Discussion에서 동일한 효과를 내기 위한 여러가지 방법을 볼 수 있습니다). 그러나 격자의 전체 높이나 너비 만큼에 걸치는 행이나 열을 만들 수는 있습니다. 이렇게 하기 위해서는 row 요소에 내용을 넣지 말고 그냥 rows요소에 내용을 넣으면 됩니다. 예를 들어 상자 타입의 요소를 사용할 수 있으며, 여러개의 요소들을 포함시키려면 상자 내에 다른 요소들을 넣으면 됩니다. 다음은 이러한 내용에 대한 간단한 예제입니다.

-

예제 5 : Source View

-
<grid>
-  <columns>
-    <column flex="1"/>
-    <column flex="1"/>
-  </columns>
-
-  <rows>
-    <row>
-      <label value="Northwest"/>
-      <label value="Northeast"/>
-    </row>
-    <button label="Equator"/>
-    <row>
-      <label value="Southwest"/>
-      <label value="Southeast"/>
-    </row>
-  </rows>
-</grid>
-
-

버튼은 하나의 행에 포함되지 않아서 격자 전체 너비에 맞게 늘어날 것입니다. 여러분은 동일한 기법을 열에도 적용할 수 있습니다. 이 경우에는 격자의 전체 높이에 맞게 늘어나게 됩니다. 또한 만일 원한다면 행과 열 모두에도 사용할 수 있습니다.

-

다음에는 내용 패널을 추가하는 것에 대해 알아보겠습니다.

-

-

« 이전다음 »

-

-

diff --git a/files/ko/mozilla/tech/xul/xul_tutorial/groupboxes/index.html b/files/ko/mozilla/tech/xul/xul_tutorial/groupboxes/index.html deleted file mode 100644 index 02a3067646..0000000000 --- a/files/ko/mozilla/tech/xul/xul_tutorial/groupboxes/index.html +++ /dev/null @@ -1,74 +0,0 @@ ---- -title: Groupboxes -slug: Mozilla/Tech/XUL/XUL_Tutorial/Groupboxes -tags: - - XUL - - XUL_Tutorial -translation_of: Archive/Mozilla/XUL/Tutorial/Groupboxes ---- -

-

« 이전다음 »

-

-

이 단원에서는 요소들을 그룹에 포함하는 방법에 대해 알아 보겠습니다.

-

그룹상자

-

HTML에서는 여러 가지 요소를 그룹핑하기 위한 목적으로 사용할 수 있는 fieldset 요소를 제공합니다. 이 때 요소들을 둘러 싸는 테두리가 생기기 때문에 각 요소가 서로 연관되어 있음을 알 수 있게 됩니다. 체크박스의 그룹이 하나의 예가 될 수 있습니다. XUL은 비슷한 기능을 위해 사용될 수 있는 groupbox 요소를 제공합니다.

-

이름에서 알 수 있듯이 groupbox는 상자의 한 형태입니다. 따라서 groupbox 내부의 요소들은 상자에 적용되는 규칙에 따라 정렬됩니다. 하지만 groupbox와 일반 상자 사이에는 다음의 두 가지 차이점이 있습니다.

- -

groupbox도 상자의 한 유형이기 때문에 상자에서 사용하는 orientflex같은 속성을 사용할 수 있습니다. groupbox에는 어떤 요소들도 넣을 수 있지만, 보통 서로 관련된 요소들만 넣습니다.

-

groupbox의 위쪽 제목은 caption 요소를 사용해서 생성할 수 있습니다. caption은 HTML의 legend 요소와 비슷한 기능을 합니다. 제목을 넣을 때는 caption을 첫 번째 자녀 요소로 넣어 주면 됩니다.

-

간단한 groupbox 예제

-

아래는 간단한 groupbox 예제입니다.

-

예제 1 : Source View

-
- Image:titledbox1.png
-
<groupbox>
-  <caption label="Answer"/>
-  <description value="Banana"/>
-  <description value="Tangerine"/>
-  <description value="Phone Booth"/>
-  <description value="Kiwi"/>
-</groupbox>
-
-

이 예제를 실행하면 네 개의 문자열을 둘러 싸는 - - Answer - 라는 제목을 가진 상자가 표시됩니다. groupbox의 정렬 속성은 세로 정렬이 기본이기 때문에 문자열이 세로로 차곡차곡 쌓이게 됩니다.

-

좀 더 복잡한 제목

-

caption 요소에 자식 요소를 넣으면 더 다양한 기능을 구현할 수 있습니다. 예를 들어 모질라의 글꼴 설정 판넬은 펼침 메뉴(drop-down menu)를 제목으로 사용하고 있습니다. 자식 요소는 무엇이든 쓸 수 있지만 보통 체크박스나 펼침 메뉴가 사용됩니다.

-

예제 2 : Source View

-
- Image:groupbox2.png
-
<groupbox flex="1">
-  <caption>
-    <checkbox label="Enable Backups"/>
-  </caption>
-  <hbox>
-    <label control="dir" value="Directory:"/>
-    <textbox id="dir" flex="1"/>
-  </hbox>
-  <checkbox label="Compress archived files"/>
-</groupbox>
-
-

이 예제에서는 checkbox가 제목으로 사용되었습니다. 스크립트를 사용하면 checkbox의 선택 여부에 따라 groupbox의 내용을 사용 가능/불가로 전환할 수 있습니다. 이 groupbox는 수평 box 하나를 갖고 있는데 그 안에는 labeltextbox가 포함되어 있습니다. 글상자와 groupbox 둘 다 flex 속성이 적용되었기 때문에 창이 늘어나면 글상자도 함께 늘어납니다. 그 다음의 체크박스는 글상자의 아래에 표시되는데 이는 groupbox의 정렬 방식이 세로 정렬이기 때문입니다. 다음 단원에서는 파일 찾기 대화창에 groupbox를 넣어 보도록 하겠습니다.

-

라디오 그룹

-

radiogroup 요소를 사용하면 여러 개의 라디오 버튼을 하나로 묶을 수 있습니다. radiogroup도 상자의 일종입니다. radiogroup은 radio 버튼을 다룰 수 있는 특수 기능 외에는 다른 상자와 다를 게 없기 때문에 안에 어떠한 요소를 넣어도 상관 없습니다.

-

radiogroup 안에 있는 라디오 버튼들은 그것들이 중첩된 상자내에 있더라도 모두 하나의 그룹이 됩니다. 이는 아래의 예제처럼 라디오 버튼으로 이루어진 구조에 다른 요소를 넣을 때 유용하게 사용될 수 있습니다.

-

예제 3 : Source View

-
<radiogroup>
-  <radio id="no" value="no" label="No Number"/>
-  <radio id="random" value="random" label="Random Number"/>
-  <hbox>
-    <radio id="specify" value="specify" label="Specify Number:"/>
-    <textbox id="specificnumber"/>
-  </hbox>
-</radiogroup>
-
-

한 가지 유의할 점은 radiogroup 요소는 테두리가 생기지 않는다는 것입니다. 만약 테두리와 제목이 필요하다면 radiogroup을 groupbox에 포함시켜 사용하시면 됩니다.

-

다음에는, 지금까지 배워온 내용을 이용해서 몇 가지 요소들을 파일 찾기 대화창에 추가해 보겠습니다.

-

-

« 이전다음 »

-

-

diff --git a/files/ko/mozilla/tech/xul/xul_tutorial/index.html b/files/ko/mozilla/tech/xul/xul_tutorial/index.html deleted file mode 100644 index b069c217a0..0000000000 --- a/files/ko/mozilla/tech/xul/xul_tutorial/index.html +++ /dev/null @@ -1,132 +0,0 @@ ---- -title: XUL Tutorial -slug: Mozilla/Tech/XUL/XUL_Tutorial -tags: - - XUL - - XUL_Tutorial -translation_of: Archive/Mozilla/XUL/Tutorial ---- -

이 튜토리얼은 XML 유저 인터페이스 언어(XML User-Interface Language)인 XUL 을 설명합니다. 이 언어는 모질라 응용프로그램(Application)을 만드는데 사용되며 특히 유저 인터페이스를 기술하는데 사용됩니다. -

-
-

본 XUL 튜토리얼 한국어 번역본은 김재용, 김고명님에 의해 최초로 작성되었으며 그는 고맙게도 본 튜토리얼을 MDC 한국 프로젝트의 일부로 사용할 수 있도록 허락해 주었습니다. 두 분의 최초 한국 번역본은 XULPlanet의 Neil Deakin 허락하에 번역되었습니다. -

-
-
개요
- -
단순 요소들(Simple Elements)
- -
박스 모델(The Box Model)
- -
더욱 다양한 레이아웃 요소들(More Layout Elements)
- -
툴바와 메뉴(Toolbars and Menus)
- -
이벤트와 스크립트(Events and Scripts)
- -
문서 객체 모델(Document Object Model)
- -
트리(Trees)
- -
RDF 와 템플릿(Templates)
- -
스킨과 지역화(Skins and Locales)
- -
Bindings
- -
Specialized Window Types
- -
설치(Installation)
- -
-

본 XUL 튜토리얼은 본래 Neil Deakin에 의해 작성되었으며 그는 고맙게도 본 튜토리얼을 MDC의 일부로 사용할 수 있도록 허락해 주었습니다. -

-
-
-
원본 문서 정보
- -
-

Interwiki Language Links -

diff --git a/files/ko/mozilla/tech/xul/xul_tutorial/input_controls/index.html b/files/ko/mozilla/tech/xul/xul_tutorial/input_controls/index.html deleted file mode 100644 index df96b700f3..0000000000 --- a/files/ko/mozilla/tech/xul/xul_tutorial/input_controls/index.html +++ /dev/null @@ -1,110 +0,0 @@ ---- -title: Input Controls -slug: Mozilla/Tech/XUL/XUL_Tutorial/Input_Controls -tags: - - XUL - - XUL_Tutorial -translation_of: Archive/Mozilla/XUL/Tutorial/Input_Controls ---- -

-

« 이전다음 »

-

-

XUL은 HTML의 form 컨트롤과 비슷한 요소들을 가지고 있습니다.

-

텍스트 입력 컨트롤

-

HTML은 텍스트 입력 컨트롤로 사용할 수 있는 input 요소를 가집니다. XUL 또한 textbox라고 하는 텍스트를 입력하는데 사용되는 비슷한 요소를 가지고 있습니다. 아무런 속성이 지정되어 있지 않으면 textbox 요소는 사용자가 텍스트를 입력할 수 있는 상자를 만들어 냅니다. Textbox는 HTML의 input 컨트롤과 많은 동일한 속성을 사용할 수 있습니다. 다음은 속성들의 일부입니다.

-
-
- id 
-
- Textbox를 실별하는데 사용할 수 있는 유일식별자(unique identifier) 입니다.
-
- class 
-
- Textbox의 스타일 클래스 입니다.
-
- value 
-
- Textbox의 기본 텍스트를 지정하고 싶으면, 이 속성값에 적용하면 됩니다.
-
- disabled 
-
- 입력을 할 수 없게 하려면 이 속성을 true로 지정합니다.
-
- type 
-
- 입력한 텍스트를 숨기는 textbox를 만드려면 이 속성을 password라는 특별한 값으로 지정할 수 있습니다.
-
- maxlength 
-
- Textbox에 입력할 수 있는 최대 문자수를 지정합니다.
-
-

HTML에서는 input 요소로 다양한 종류의 컨트롤 타입을 만들 수 있지만, XUL에서는 각 타입에 대응되는 별도의 요소가 있습니다.

-

다음은 몇 가지 textbox 예제입니다.

-

예제 1 : Source View

-
<label control="some-text" value="Enter some text"/>
-<textbox id="some-text"/>
-<label control="some-password" value="Enter a password"/>
-<textbox id="some-password" type="password" maxlength="8"/>
-
-

여러줄(multiline) textbox

-

위의 textbox 예제는 한줄짜리 텍스트만 입력하는데 사용할 수 있는 입력 컨트롤을 생성합니다. HTML에서는 더 많은 텍스트 입력 영역이 있는 textarea 요소가 존재합니다. XUL에서는 textbox 요소를 이러한 목적으로 사용할 수 있늡니다(서로 다른 두개 요소는 필요 없습니다). multiline속성을 true로 지정하면 텍스트 입력 필드는 다중 행을 표시합니다.

-

예제 2 : Source View

-
<textbox multiline="true"
-           value="This is some text that could wrap onto multiple lines."/>
-
-

HTML의 textarea처럼, 크기를 지정하기 위해 rowscols를 사용할 수 있습니다. 이 속성들은 출력될 문자의 행과 열수를 지정합니다.

-
-

우리의 파일 찾기 예제

-

이제 파일 찾기 대화상자에 검색을 위한 입력 필드를 추가합니다. Textbox 요소를 사용할 것입니다.

-
<label value="Search for:" control="find-text"/>
-<textbox id="find-text"/>
-
-<button id="find-button" label="Find"/>
-
-
- Image:inputs1.png
-

앞선 섹션에서 만든 버튼 앞 부분에 위의 코드를 추가하세요. 창을 열면, 이미지와 같이 보일 것입니다.

-

라벨과 텍스트 input 필드가 윈도우에 출력됩니다. 텍스트박스는 완전히 작동하며 텍스트를 입력하거나 선택할 수 있습니다. 예제에서 라벨의 control 속성이 사용되어서 label이 클릭되면 텍스트 박스가 선택됩니다.

-
-

체크박스와 라디오 버튼

-

체크박스와 라디오 버튼을 만들기 위해서는 두 개의 추가적인 요소를 사용합니다. 이것들은 버튼의 일종입니다. 체크박스 요소는 가능 또는 불가능될 수 있는 옵션을 위해 사용할 수 있습니다. 라디오 버튼은 비슷한 목적으로 사용할 수 있는 것으로 여러개의 항목 중 하나만 선택할 수 있을 때 사용합니다.

-

체크박스와 라디오 버튼은 버튼과 대부분 동일한 속성을 사용합니다. 아래 예제는 간단한 체크박스와 라디오 버튼을 보여줍니다.

-
<checkbox id="case-sensitive" checked="true" label="Case sensitive"/>
-<radio id="orange" label="Orange"/>
-<radio id="violet" selected="true" label="Violet"/>
-<radio id="yellow" label="Yellow"/>
-
-

첫번째 줄에서는 간단한 checkbox를 생성합니다. 사용자가 체크박스를 클릭하면 선택 또는 선택되지 않은 상태를 교환합니다. checked 속성은 처음 상태를 나타내기 위해 사용할 수 있습니다. 이것은 true또는 false로 지정되어야 합니다. label 속성은 체크박스 옆에 출력될 라벨을 지정하기 위해 사용합니다. radio 버튼에서는 checked 속성 대신 selected를 사용해야 합니다. 라디오 버튼이 처음 선택된 상태로 마들기 위해서는 selectedtrue로 설정하세요.

-

라디오그룹 요소

-

라디오 버튼들을 그룹짖기 위해서는 radiogroup 요소를 사용할 필요가 있습니다. 라디오 그룹내에 있는 라디오 버튼들 중 하나만 선택할 수 있습니다. 하나를 선택하면 같은 그룹 내의 다른 것들은 모두 꺼지게 됩니다. 다음 예제는 이러한 내용을 보여줍니다.

-

예제 3 : Source View

-
<radiogroup>
-  <radio id="orange" label="Orange"/>
-  <radio id="violet" selected="true" label="Violet"/>
-  <radio id="yellow" label="Yellow"/>
-</radiogroup>
-
-

속성

-

버튼처럼, 체크박스와 라디오 버튼들도 라벨과 이미지로 구성되며, 버튼들이 눌러졌을 때체크된 상태와 체크되지 않은 상태의 이미지가 바뀌어집니다. 체크 박스는 버튼과 많은 동일한 속성을 가집니다.

-
-
- label 
-
- 체크 박스나 라디오 버튼의 라벨를 설정합니다.
-
- disabled 
-
- 체크 박스나 라디오 버튼을 가능 또는 불가능 하게 하기 위해서 본 속성을 truefalse로 설정하세요.
-
- accesskey 
-
- 요소를 선택할 때 사용하는 단축키입니다. 여기에 지정된 문자는 보통 라벨에 아랫줄을 그어 출력합니다.
-
-
-

여기까지의 파일 찾기 예제 : Source View

-
-

다음 섹션에서는 리스트 박스 만들기를 위한 몇 가지 요소들에 대해 알아볼 것입니다.

-

-

« 이전다음 »

-

-

diff --git a/files/ko/mozilla/tech/xul/xul_tutorial/introduction/index.html b/files/ko/mozilla/tech/xul/xul_tutorial/introduction/index.html deleted file mode 100644 index 50308acfc9..0000000000 --- a/files/ko/mozilla/tech/xul/xul_tutorial/introduction/index.html +++ /dev/null @@ -1,38 +0,0 @@ ---- -title: Introduction -slug: Mozilla/Tech/XUL/XUL_Tutorial/Introduction -tags: - - XUL - - XUL_Tutorial -translation_of: Archive/Mozilla/XUL/Tutorial/Introduction ---- -

-

다음 »

-

-

이 설명서는 XUL(XML 사용자 인터페이스 언어)를 배우는 데 도움을 주기 위한 것입니다. XUL은 응용 프로그램의 사용자 인터페이스를 작성하는 데 쓰이는 크로스 플랫폼 언어입니다.

-

이 설명서는 매킨토시의 셜록이나 윈도우의 검색 대화상자처럼 파일 찾기 기능을 갖춘 간단한 사용자 인터페이스를 만드는 방법을 설명해나갈 것입니다. 하지만 다루는 내용은 사용자 인터페이스를 만들고 몇 가지 기능을 추가하는 것으로 제한할 것입니다. 실제로 파일을 찾는 기능에 대한 설명은 제공되지 않습니다. 문서 왼쪽에 파란선이 나타나는 문단은 파일 찾기 대화상자가 수정되는 부분입니다. 이러한 문단을 따라가면 우리가 원하는 사용자 인터페이스가 완성됩니다.

-

XUL은 무엇이며 왜 만들어졌는가?

-

XUL(cool의 리듬으로 줄(zool)이라고 발음합니다)은 더 쉽고 빠르게 모질라 브라우저 개발을 하기 위해 만들어졌습니다. XML 언어이기 때문에 XML에서 사용할 수 있는 모든 기능은 XUL에서도 사용할 수 있습니다.

-

응용 프로그램을 개발할 때 특정 플랫폼의 기능을 사용해야 하는 경우가 많기 때문에 크로스 플랫폼 소프트웨어를 만드는 데는 많은 시간과 비용이 필요합니다. 그래서 오래 전부터 크로스 플랫폼 개발 도구가 개발되고 있습니다. 예를 들어, 자바는 이식성을 가장 큰 장점으로 내세우고 있습니다. XUL도 이식 가능한 사용자 인터페이스를 만들기 위해 고안된 언어입니다. 한 플랫폼에 맞추어 응용 프로그램을 개발하는 데에도 많은 시간이 걸립니다. 컴파일을 하고 디버그를 하는 과정이 매우 길어질 수도 있습니다. 하지만, XUL을 사용하면 빠르고 쉽게 인터페이스를 만들고 수정할 수 있습니다.

-

XUL은 다른 XML 언어의 장점을 모두 갖추고 있습니다. 예를 들어 XHTML이나 MathML, SVG 같은 XML 언어를 XUL 안에 삽입할 수 있습니다. 그리고 XUL에 사용된 문구는 쉽게 현지화할 수 있기 때문에 번역 작업이 수월합니다.

-

XUL로 만들 수 있는 사용자 인터페이스는 무엇인가?

-

XUL은 다양한 기능을 제공하여 세련된 그래픽 인터페이스를 만들 수 있게 해줍니다. 예를 들어 아래와 같은 엘리먼트를 만들 수 있습니다.

- -

화면에 표시되는 내용은 XUL 파일 내부의 내용이나 데이터소스에 있는 자료를 이용하여 만들어집니다. 모질라에서는 사용자의 편지함, 북마크, 검색 결과 등도 데이터소스로 사용할 수 있습니다. 메뉴나 트리 같은 엘리먼트에 내용을 넣을 때에는 이런 자료뿐만 아니라 원하는 내용을 직접 RDF 파일로 작성하여 사용할 수도 있습니다.

-

XUL은 다음과 같이 사용할 수 있습니다.

- -

앞의 세 가지는 실행하기 전에 사용자의 컴퓨터에 설치를 해야 합니다. 하지만, 이들은 보안과 관련된 제약이 없기 때문에 하드디스크의 파일에 접근하거나 사용자의 환경 설정을 읽고 바꾸는 것과 같은 작업도 할 수 있습니다. 확장 기능은 XUL 파일을 비롯한 스크립트, 그림 파일 등이 하나의 파일로 압축되어 제공되는데 사용자는 이를 내려 받아 설치할 수 있습니다. 파이어폭스 등의 모질라 응용 프로그램은 사용자가 손쉽게 확장 기능을 설치할 수 있도록 확장 기능 관리자를 제공합니다.

-

XUL 파일을 하드 디스크나 웹 사이트에서 바로 열 수도 있습니다. 하지만, 이 경우에는 사용할 수 있는 기능에 제약이 있고 XUL의 일부 기능이 바르게 작동하지 않을 수 있습니다. XUL로 작성된 프로그램이 웹 사이트를 통해 열리게 하려면, 웹 서버가 XUL 파일을 "application/vnd.mozilla.xul+xml" 컨텐트 타입으로 전송하도록 설정하여야 합니다. XUL은 보통 확장자가 .xul인 파일에 저장됩니다. 모질라에서는 다른 파일을 열 때처럼 파일 메뉴 아래의 파일 열기를 이용하거나 주소 막대에 직접 URL을 입력하여서도 XUL 파일을 열 수 있습니다.

-

이 설명서를 읽기 위해 알아야할 것은 무엇인가?

-

HTML과 XML, CSS에 대한 기본적인 지식이 필요합니다. 다음 사항을 항상 기억하시기 바랍니다.

- -

XUL은 모질라와 그에 바탕한 브라우저(네스케이프 6 이상 그리고 모질라 Firefox)에서 지원됩니다. XUL 구문은 오랜 시간동안 여러 변화가 있었기 때문에, 올바르게 작동할 수 있는 최신의 사례를 보았으면 할 것입니다. 대부분의 사례는 모질라 1.0 이상에서 작동합니다.

-

파이어폭스 등의 브라우저에서 작동하는 XUL도 이와 매우 비슷하지만, 도구 막대 편집 기능 등 각 브라우저에 특화된 기능을 갖추고 있습니다.

-

이 설명서는 XUL의 다양한 기능을 설명할 것이지만 모든 기능을 다루지는 않을 것입니다. XUL에 어느 정도 익숙해진 후에 특정 엘리먼트가 지원하는 기능들을 살펴보고 싶으면 XUL Reference를 이용하시기 바랍니다.

-

-

다음 »

-

-

diff --git a/files/ko/mozilla/tech/xul/xul_tutorial/introduction_to_rdf/index.html b/files/ko/mozilla/tech/xul/xul_tutorial/introduction_to_rdf/index.html deleted file mode 100644 index c584671798..0000000000 --- a/files/ko/mozilla/tech/xul/xul_tutorial/introduction_to_rdf/index.html +++ /dev/null @@ -1,74 +0,0 @@ ---- -title: Introduction to RDF -slug: Mozilla/Tech/XUL/XUL_Tutorial/Introduction_to_RDF -tags: - - XUL - - XUL_Tutorial -translation_of: Archive/Mozilla/XUL/Tutorial/Introduction_to_RDF ---- -

이 장에서는 RDF ( Resource Description Framework )에 대해 살펴봅니다.

-

Resource Description Framework

-

북마크나 메일 메세지등과 같은 데이터의 집합을 표시하는 목적으로 트리 요소를 사용할 수 있습니다. 그렇지만, XUL 파일에 직접 데이터를 넣는것은 귀찮은 일입니다. 북마크가 직접 XUL 파일에 쓰여져 있다고 한다면 그 변경은 어려운 것이 됩니다. 그래서 이것을 해결하는 방법은 RDF 데이터소스를 이용하는 것입니다.

-

RDF ( Resource Description Framework )란 북마크나 메일등의 리소스를 저장하기 위한 형식입니다. 다른 방법으로서 다른 형식의 데이터를 이용해 그 파일로부터 RDF 데이터를 생성하는 코드가 쓰여져 있는 경우도 있습니다. 이것이 Mozilla 가 북마크나 히스토리, 메일 메세지등의 데이터를 읽어들일 때 가고 있는 방법입니다. 개발자에게 편의를 도모하기 위해서 Mozilla 는 이러한 공통되어 이용되는 데이터를 위한 데이터소스를 제공합니다.

-

Mozilla 가 제공하고 있는 어느 RDF 데이터 소스도 데이터로부터의 트리 생성에 이용할 수 있거나 데이터를 포함한 XML 로서 보존하고 있는 RDF 파일을 참조할 수도 있습니다. 이것에 의해 여러 줄이 있는 트리의 표시가 매우 편해집니다. RDF 는 리스트 박스나 메뉴등이 같은 다른 요소에 있어서의 생성에도 이용할 수 있습니다. 이것에 대해서는 다음 절에서 다룹니다.

-

여기에서는 RDF 에 대해 아주 대략적으로 설명합니다. RDF 에 대한 자세한 안내는 RDF 모델 입문을 읽어 바랍니다. RDF 에 처음으로 접한다면 이 안내를 읽는 것을 추천합니다. RDF/XML 파일의 몇개의 예는 Mozilla 가 제공하고 있는 것을 보면 좋을 것입니다. RDF/XML 파일의 확장자(extension)는 rdf 입니다.

-

RDF 는 그래프 구조로 표현되는 데이터의 모델로부터 됩니다. RDF/XML 는 RDF 데이터를 표현하기 위해서 이용되는 XML 언어입니다. 그것은 필요 충분한 단순한 요소로 설정 됩니다. 아래에 간단한 RDF 의 구조를 나타냅니다.

-
<? xml version="1.0"? >
-<RDF:RDF
-  xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
-  ...
-</RDF:RDF>
-
-

이것은 XUL 의 헤더와 닮아 있습니다. window 요소 대신에 RDF 요소가 이용되고 있습니다. RDF 의 요소가 올바르게 인식되도록하기 위해서 RDF 의 네임스페이스가 선언되고 있는 것이 알 수 있네요. RDF 요소의 안쪽에 데이터를 기술합니다.

-

여기에서는 RDF 에 대해 매우 간단하게 설명합니다. 보다 자세한 것은 RDF 사양을 참조해 주세요. 예로 RDF 로부터 생성되는 북마크의 리스트에 대해 보겠습니다. 북마크의 리스트는 레코드의 집합을 포함하고 있어 각각에는 URL, 타이틀, 방문일등의 일련의 데이터가 주어지고 있습니다.

-

북마크는 얼마든지의 필드로부터 되는 거대한 테이블로서 보존되고 있는 데이타베이스의 일종이라고 생각합니다. 다만, RDF 에서는 리스트는 동시에 계층적으로도 될 수 있습니다. 이것은 북마크를 폴더 마다 정리하거나 종류별 정리하기 위해서 필요한 일입니다. RDF 데이타베이스내의 각 필드는 첨부이름의 리소스입니다. 이름은 URI 로 기술됩니다.

-

예를 들면, Mozilla 의 북마크 리스트에 있어서의 필드의 몇개인가는 아래에 URI 로 기술되고 있습니다.

-
Name 	http://home.netscape.com/NC-rdf#Name 	북마크명
-URL 	http://home.netscape.com/NC-rdf#URL 	링크 URL
-Description 	http://home.netscape.com/NC-rdf#Description 	북마크의 설명
-Last Visited 	http://home.netscape.com/WEB-rdf#LastVisitDate 	최종 방문일
-
-

이것들은 네임스페이스명으로 얘기되는 필드명으로부터 생성됩니다. 다음 절에서는 이것들을 사용해 필드의 값을 자동 생성시키는 방식에 대해 보고 갑니다. 최종 방문일은 다른 3개의 필드와 조금 다른 네임스페이스가 되어 있는 것에 주의해 주세요.

-

아래에 3개의 레코드와 3개의 필드를 가지는 RDF/XML 의 예를 나타냅니다.

-
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-         xmlns:ANIMALS="http://www.some-fictitious-zoo.com/rdf#">
-
-  <RDF:Seq about="http://www.some-fictitious-zoo.com/all-animals">
-    <RDF:li>
-       <RDF:Description about="http://www.some-fictitious-zoo.com/mammals/lion">
-         <ANIMALS:name>Lion</ANIMALS:name>
-         <ANIMALS:species>Panthera leo</ANIMALS:species>
-         <ANIMALS:class>Mammal</ANIMALS:class>
-       </RDF:Description>
-    </RDF:li>
-    <RDF:li>
-       <RDF:Description about="http://www.some-fictitious-zoo.com/arachnids/tarantula">
-         <ANIMALS:name>Tarantula</ANIMALS:name>
-         <ANIMALS:species>Avicularia avicularia</ANIMALS:species>
-         <ANIMALS:class>Arachnid</ANIMALS:class>
-       </RDF:Description>
-    </RDF:li>
-    <RDF:li>
-       <RDF:Description about="http://www.some-fictitious-zoo.com/mammals/hippopotamus">
-         <ANIMALS:name>Hippopotamus</ANIMALS:name>
-         <ANIMALS:species>Hippopotamus amphibius</ANIMALS:species>
-         <ANIMALS:class>Mammal</ANIMALS:class>
-       </RDF:Description>
-    </RDF:li>
-  </RDF:Seq>
-</RDF:RDF>
-
-

여기에서는 각 동물( animal )에 대응해 3개의 레코드가 선언되고 있습니다. 각 RDF:Description 태그가 하나의 레코드를 나타냅니다. 각각의 레코드의 내부에는 3개의 필드: name, species, class 가 기술되고 있습니다. 모든 레코드가 같은 필드에서 구성되어 있지 않으면 안 되는 것은 아닙니다만, 그렇게 하는 편이 보다 자연스럽습니다.

-

3개의 필드 각각 네임스페이스로서 ANIMALS 가 주어지고 있어 ANIMALS 의 URL 는 RDF 태그내에서 선언되고 있습니다. 이름은 이유가 적당하게 선택한 것만으로 있지만 무엇이든 다른 이름이라도 괜찮습니다. 네임스페이스의 이용은 class 필드가 스타일의 필드와 충돌하지 않게 하는 것에 도움이 되고 있습니다.

-

Seq 요소와 li 요소는 레코드의 리스트를 지정하기 위해서 이용하는 것입니다. 이것은 HTML 의 리스트의 선언과 잘 닮은 것입니다. Seq 요소는 요소가 순서로 나타내질 수 있는 것을 나타냅니다. 순서를 가지지 않는 경우는 Seq 요소 대신에 Bag 요소를 이용합니다. Alt 요소를 이용하면 데이터의 각 레코드가(미러 URL 등의) 대체값을 지정하고 있는 것을 지시할 수가 있습니다.

-

네임스페이스 URL 와 거기에 계속되는 필드명에 의해 XUL 파일내의 리소스를 참조할 수가 있습니다. 위의 예에서는 다음에 특정 필드의 참조에 이용할 수 있는 URI 가 생성됩니다.

-
Name 	http://www.some-fictitious-zoo.com/rdf#name
-Species 	http://www.some-fictitious-zoo.com/rdf#species
-Class 	http://www.some-fictitious-zoo.com/rdf#class
-
-
-

다음 절에서는 RDF 를 사용한 XUL 요소의 생성 방법에 대해 살펴봅니다.

-


-

-

« 이전다음 »

-

diff --git a/files/ko/mozilla/tech/xul/xul_tutorial/introduction_to_xbl/index.html b/files/ko/mozilla/tech/xul/xul_tutorial/introduction_to_xbl/index.html deleted file mode 100644 index f6e3ddde65..0000000000 --- a/files/ko/mozilla/tech/xul/xul_tutorial/introduction_to_xbl/index.html +++ /dev/null @@ -1,82 +0,0 @@ ---- -title: Introduction to XBL -slug: Mozilla/Tech/XUL/XUL_Tutorial/Introduction_to_XBL -tags: - - XBL - - XUL - - XUL_Tutorial -translation_of: Archive/Mozilla/XUL/Tutorial/Introduction_to_XBL ---- -

-

« 이전다음 »

-

-

XUL은 자매(sister) 언어 XBL (eXtensible Bindings Language)이 있습니다. 이 언어는 XUL 위젯의 behavior를 선언하는데 쓰입니다.

-

바인딩

-

어플리케이션 사용자 인터페이스의 레이아웃을 정의하기 위해 XUL을 쓸 수 있습니다. 요소에 스타일을 적용하여 입맛대로 모양(look)을 바꿀 수 있습니다. 또한 스타일을 바꿔 새 스킨을 만들 수 있습니다.

-

스크롤 바체크 박스 같은 요소 모두의 기본 겉모양은 스타일 조정(adjust)이나 요소에 속성을 주어 수정해도 좋습니다. 그러나, XUL은 요소가 작동하는 법을 바꿀 수 있는 수단은 제공하지 않습니다. 예를 들면, 스크롤 바 막대가 기능하는 법을 바꾸고 싶을지도 모릅니다. 이를 이해서는, XBL이 필요합니다.

-

XBL 파일은 바인딩 집합을 포함합니다. 각 바인딩은 XUL 위젯의 behavior를 기술합니다. 예를 들면, 바인딩은 스크롤 바에 부착될지도 모릅니다. behavior는 스크롤 바를 만드는 XUL 요소 기술뿐만 아니라 속성(property)과 메소드도 기술합니다.

-

XUL처럼 XBL도 XML 언어입니다. 그래서 비슷한 구문 규칙이 있습니다. 다음 예는 XBL 파일의 기본 뼈대(skeleton)를 보입니다.

-
<?xml version="1.0"?>
-<bindings xmlns="http://www.mozilla.org/xbl">
-  <binding id="binding1">
-    <!-- content, property, method and event descriptions go here -->
-  </binding>
-  <binding id="binding2">
-    <!-- content, property, method and event descriptions go here -->
-  </binding>
-</bindings>
-
-

bindings 요소는 XBL 파일의 루트 요소고 하나 이상의 binding 요소를 포함합니다. 각 binding 요소는 단일 바인딩으로 선언합니다. id 속성은 위 보기처럼 바인딩을 식별하기 위해 쓰일 수 있습니다. 템플릿에는 두 바인딩이 있습니다. 하나는 binding1으로 부르고 다른 하나는 binding2입니다. 하나는 스크롤 바에 다른 하나는 메뉴에 부착될지도 모릅니다. 바인딩은 어떤 XUL 요소에도 부착할 수 있습니다. CSS 클래스를 쓰면, 필요에 따라 많은 다양한 바인딩을 쓸 수 있습니다. 이것은 XBL 구문을 써서 선언합니다.

-

바인딩 파일의 URL에 CSS 속성(property) -moz-binding을 주어 요소에 바인딩을 할당합니다. 예를 들면,

-
scrollbar {
-    -moz-binding: url('chrome://findfile/content/findfile.xml#binding1');
-}
-
-

URL은 파일 'chrome://findfile/content/findfile.xml' 안 id가 'binding1'인 바인딩을 가리킵니다.

-

'#binding1' 구문은 HTML 파일에서 앵커(anchor)를 가리키는 것처럼 특정 바인딩을 가리키는데 쓰입니다. 보통 파일 하나에 바인딩을 전부 둘 겁니다. 이 예에서 결과는 모든 스크롤바 요소가 바인딩 'binding1'에 기술한 behavior를 지닐 겁니다.

-

바인딩은 선언하는 다섯 가지 종류가 있습니다.

-
    -
  1. 컨텐트: 바인딩이 바운드되는 요소에 더하는 자식 요소.
  2. -
  3. 속성: 요소에 더하는 속성. 스크립트로 접근할 수 있습니다.
  4. -
  5. 메소드: 요소에 더하는 메소드. 스크립트에서 호출할 수 있습니다.
  6. -
  7. 이벤트: 요소가 반응할 마우스 클릭과 키누름 같은 이벤트. 바인딩은 기본 처리(handling)를 제공하는 스크립트를 더할 수 있습니다. 게다가 새 이벤트를 정의할 수도 있습니다.
  8. -
  9. 스타일: XBL이 정의한 요소의 사용자 정의 스타일 속성.
  10. -
-

바인딩 예제

-

box는 사용자 정의 위젯을 만드는데 쓸 수 있을 만큼 충분히 일반적(generic)입니다(비록 어떤 요소라도 쓸 수 있지만). box 태그에 class를 할당하여 바인딩을 오직 그 클래스에 속하는 상자에 관련지을 수 있습니다. 다음 예가 이를 보입니다.

-
XUL (example.xul):
-
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://example/skin/example.css" type="text/css"?>
-
-<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-  <box class="okcancelbuttons"/>
-</window>
-
-CSS (example.css):
-
-box.okcancelbuttons {
-    -moz-binding: url('chrome://example/skin/example.xml#okcancel');
-}
-
-XBL (example.xml):
-
-<?xml version="1.0"?>
-<bindings xmlns="http://www.mozilla.org/xbl"
-         xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-  <binding id="okcancel">
-    <content>
-      <xul:button label="OK"/>
-      <xul:button label="Cancel"/>
-    </content>
-  </binding>
-</bindings>
-
-

이 예는 상자 하나가 있는 창을 만듭니다. 상자는 okcancelbuttonsclass가 있게 선언되었습니다. 파일과 관련 있는 스타일 시트는 okcancelbuttons 클래스가 있는 상자가 XBL 파일에 정의한 특수 바인딩을 갖는다고 말합니다. box 말고도 다른 요소, 심지어 사용자 정의 테그를 쓸지도 모릅니다.

-

다음 절에서 XBL의 세부 부분을 더 살펴보겠습니다. 그러나, 간략히 말하면 상자 안에 자동으로 버튼 2개(확인 버튼과 취소 버튼)를 더하게 합니다.

-

다음 절에서는, XBL로 컨텐트 만들기를 보겠습니다.

-

-

« 이전다음 »

-

-

diff --git a/files/ko/mozilla/tech/xul/xul_tutorial/keyboard_shortcuts/index.html b/files/ko/mozilla/tech/xul/xul_tutorial/keyboard_shortcuts/index.html deleted file mode 100644 index 2b383d0c88..0000000000 --- a/files/ko/mozilla/tech/xul/xul_tutorial/keyboard_shortcuts/index.html +++ /dev/null @@ -1,384 +0,0 @@ ---- -title: Keyboard Shortcuts -slug: Mozilla/Tech/XUL/XUL_Tutorial/Keyboard_Shortcuts -tags: - - XUL - - XUL_Tutorial -translation_of: Archive/Mozilla/XUL/Tutorial/Keyboard_Shortcuts ---- -

 

- -

-

« 이전다음 »

-

- -

여러분은 키보드에 응답하는 키보드 이벤트 핸들러를 사용할 수 있습니다. 그러나 모든 버튼과 메뉴 항목에 이벤트 핸들러를 사용하는 것은 정말 번거로운 일일 것입니다.

- -

키보드 단축키 만들기

- -

XUL에서는 키보드 단축키를 정의할 수 있는 방법을 제공합니다. 우리는 메뉴 단원에서 accesskey 속성에 대해 알아 보았습니다. 이 속성은 메뉴나 메뉴 항목을 활성화하기 위해 사용자가 누를 수 있는 키를 명시하는데 사용됩니다. 아래 예제에서는 Alt와 F(어떤 플랫폼에서는 다른 키 조합) 키를 눌러 File 메뉴를 선택할 수 있는 것을 보여주고 있습니다. File 메뉴가 열리면 Close 메뉴 항목은 C 키를 눌러 선택할 수 있습니다.

- -

예제 1 : Source View

- -
<menubar id="sample-menubar">
-  <menu id="file-menu" label="File" accesskey="f">
-    <menupopup id="file-popup">
-      <menuitem id="close-command" label="Close" accesskey="c"/>
-    </menupopup>
-  </menu>
-</menubar>
-
- -

여러분은 버튼에도 accesskey 속성을 사용할 수 있습니다. 버튼에 이 속성을 사용하고 키를 누르면 버튼이 선택(클릭)됩니다.

- -

그러나 여러분은 아마 좀 더 일반적인 방법으로 키보드 단축키를 설정하고 싶어할 것입니다. 예를 들어 클립보드로 텍스트를 복사하기 위해 Control+C를 누르는 것과 같은 것 말입니다. 이와 같은 단축키를 항상 사용할 수 있는 것은 아니지만 창이 열려있는 동안에는 대부분 동작할 것입니다. 보통 키보드 단축키는 아무때나 사용할 수 있고 스크립트를 사용해 무엇인지를 수행할지 여부를 검사할 수 있습니다. 예를 들어 텍스트가 선택되었을 때만 클립보드로 텍스트를 복사하는 것이 가능하도록 하게 검사할 수 있습니다.

- -

key 요소

- -

XUL에서는 하나의 창에서 사용할 키보드 단축키를 정의할 수 있게 해주는 key 요소를 제공합니다. 이 요소에는 누를 키와 같이 눌러야 하는 변경키(modifier key, Shift나 Control)를 명시할 수 있는 속성이 있습니다. 예제는 다음과 같습니다.

- -
<keyset>
-  <key id="sample-key" modifiers="shift" key="R"/>
-</keyset>
-
- -

위의 예제는 Shift와 R 키를 누를 때 활성화되는 단축키를 정의하고 있습니다. key 속성(요소 이름과 동일합니다)은 어떤 키를 눌러야 할지를 나타내기 위해 사용되며 예제에서는 R 키입니다. 이 속성에는 눌러야하는 키에 해당하는 어떤 문자도 넣을 수 있습니다. 변경자는 항상 같이 눌러야 하는 키를 의미하며 modifiers 속성으로 지정합니다. 이 속성은 공백으로 분리된 변경자 키 목록으로 입력하며, 아래의 값을 가질 수 있습니다.

- -
-
alt 
-
사용자는 항상 Alt 키를 눌러야 합니다. Mac에서는 Option 키에 해당합니다.
-
control 
-
사용자는 항상 Control 키를 눌러야 합니다.
-
meta 
-
사용자는 항상 Meta 키를 눌러야 합니다. Mac에서는 Command 키에 해당합니다.
-
shift 
-
사용자는 항상 Shift 키를 눌러야 합니다.
-
accel 
-
사용자는 항상 특별한 가속키(accelerator key)를 눌러야 합니다. 여기에 사용되는 키는 사용자의 플랫폼에 따라 달라집니다. 보통 이 값을 사용하게 될 것입니다.
-
- -

여러분의 키보드에서 이러한 모든 키를 제공하지 않을 것이며, 이 경우 키보드에 있는 변경키 중 하나와 연결될 것입니다.

- -

key 요소는 keyset 요소 내부에 위치해야 합니다. 이 요소는 key 요소를 포함하기 위해 고안된 것으로, 파일내 한 곳에서 모든 키 정의를 묶는 용도로 사용됩니다. keyset 요소 밖에 있는 key 요소는 동작하지 않습니다.

- -

일반적으로 각각의 플랫폼은 단축키를 위해 서로 다른 키를 사용합니다. 예를 들어, Windows는 Control 키를 사용하며, Mac에서는 Command 키를 사용합니다. 이렇게 플랫폼별로 서로 다른 key 요소를 정의하는 것은 불편할 것입니다. 운 좋게 해결책이 있습니다. accel 변경자는 플랫폼별로 단축키로 사용되는 특수 키를 나타냅니다. 이것은 다른 변경키와 동일하게 작동하면서도 각 플랫폼별로 동일하지 않을 수 있습니다.

- -

여기에 몇 가지 추가 예제가 있습니다.

- -
<keyset>
-  <key id="copy-key" modifiers="control" key="C"/>
-  <key id="explore-key" modifiers="control alt" key="E"/>
-  <key id="paste-key" modifiers="accel" key="V"/>
-</keyset>
-
- -

keycode 속성

- -

key 속성은 눌러야 하는 키를 지정하기 위해 사용됩니다. 그러나 문자로 나타낼 수 없는 키(Enter키나 기능키)를 지정하고 싶을 때도 있을 것입니다. key 속성은 출력 가능한 문자에 대해서만 사용할 수 있습니다. 출력할 수 없는 문자는 keycode라는 또 다른 속성을 이용해서 지정할 수 있습니다.

- -

keycode 속성에는 키를 나타내는 특별한 코드를 설정해야 합니다. 키 목록은 다음 표와 같습니다. 모든 키가 키보드 상에 있는 것은 아닙니다.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
VK_CANCELVK_BACKVK_TABVK_CLEAR
VK_RETURNVK_ENTERVK_SHIFTVK_CONTROL
VK_ALTVK_PAUSEVK_CAPS_LOCKVK_ESCAPE
VK_SPACEVK_PAGE_UPVK_PAGE_DOWNVK_END
VK_HOMEVK_LEFTVK_UPVK_RIGHT
VK_DOWNVK_PRINTSCREENVK_INSERTVK_DELETE
VK_0VK_1VK_2VK_3
VK_4VK_5VK_6VK_7
VK_8VK_9VK_SEMICOLONVK_EQUALS
VK_AVK_BVK_CVK_D
VK_EVK_FVK_GVK_H
VK_IVK_JVK_KVK_L
VK_MVK_NVK_OVK_P
VK_QVK_RVK_SVK_T
VK_UVK_VVK_WVK_X
VK_YVK_ZVK_NUMPAD0VK_NUMPAD1
VK_NUMPAD2VK_NUMPAD3VK_NUMPAD4VK_NUMPAD5
VK_NUMPAD6VK_NUMPAD7VK_NUMPAD8VK_NUMPAD9
VK_MULTIPLYVK_ADDVK_SEPARATORVK_SUBTRACT
VK_DECIMALVK_DIVIDEVK_F1VK_F2
VK_F3VK_F4VK_F5VK_F6
VK_F7VK_F8VK_F9VK_F10
VK_F11VK_F12VK_F13VK_F14
VK_F15VK_F16VK_F17VK_F18
VK_F19VK_F20VK_F21VK_F22
VK_F23VK_F24VK_NUM_LOCKVK_SCROLL_LOCK
VK_COMMAVK_PERIODVK_SLASHVK_BACK_QUOTE
VK_OPEN_BRACKETVK_BACK_SLASHVK_CLOSE_BRACKETVK_QUOTE
VK_HELP   
- -

예를 들어, 사용자가 Alt와 F5를 눌렀을 때 활성화되는 단축키를 만드려면 다음과 같이 하세요.

- -
<keyset>
-  <key id="test-key" modifiers="alt" keycode="VK_F5"/>
-</keyset>
-
- -

아래 예제는 좀 더 많은 단축키를 보여줍니다.

- -
<keyset>
-  <key id="copy-key" modifiers="accel" key="C"/>
-  <key id="find-key" keycode="VK_F3"/>
-  <key id="switch-key" modifiers="control alt" key="1"/>
-</keyset>
-
- -

첫 번째 키는 사용자가 사용하는 플랫폼에 해당하는 단축키와 C를 눌렀을 때 호출됩니다. 두번째는 F3을 눌렀을 때 호출됩니다. 세 번째는 Control키와 Alt키 그리고 1을 눌렀을 때 호출됩니다. 만일 키보드의 메인 영역에 있는 키와 숫자 패드에 있는 키를 구분하기 위해서는 VK_NUMPAD 키(VK_NUMPAD1과 같은 것)를 사용하세요.

- -
-

응용 프로그램에서 사용할 단축키의 선택과 관련된 더 많은 정보는 Mozilla Keyboard Planning FAQ and Cross Reference를 참조하세요.

-
- -

키보드 단축키 사용하기

- -

어떻게 키보드 단축키를 정의하는지를 알았으니까, 이제는 사용 방법에 대해 알아보겠습니다. 두 가지 방법이 있습니다. 첫 번째는 가장 간단한 방법으로 key 요소에서 키입력(keypress) 이벤트 핸들러를 사용하는 방법입니다. 사용자가 키를 누르면 스크립트가 호출됩니다. 예제는 다음과 같습니다.

- -
<keyset>
-  <key id="copy-key" modifiers="accel" key="C" oncommand="DoCopy();"/>
-</keyset>
-
- -

DoCopy 함수는 사용자가 key 요소에서 명시한 키를 눌렀을때 호출됩니다. 위 예제에서는 클립보드에 복사하는 키(Control+C)입니다. 이 단축키는 창이 열려있는 동안은 계속 동작합니다. DoCopy 함수는 텍스트가 선택되어 있는지 검사한 후 클립보드에 선택한 텍스트를 복사할 것입니다. 텍스트상자는 원래 클립보드와 관련된 단축키가 있으므로 구현할 필요는 없다는 것을 기억하세요.

- -

메뉴에 키보드 단축키 지정하기

- -

메뉴에 있는 명령에 대한 키보드 단축키를 지정할 경우에는 key 요소와 메뉴 명령을 직접 연결할 수 있습니다. 이를 위해서는 menuitem 요소에 key 속성을 추가하면 됩니다. 이 속성에는 사용할 key 요소의 id값을 지정하면 됩니다. 예제는 다음과 같습니다.

- -

예제 2 : Source View

- -
Image:keyshort1.jpg
- -
<keyset>
-  <key id="paste-key" modifiers="accel" key="V"
-          oncommand="alert('Paste invoked')"/>
-</keyset>
-
-<menubar id="sample-menubar">
-  <menu id="edit-menu" label="Edit" accesskey="e">
-    <menupopup id="edit-popup">
-      <menuitem id="paste-command"
-         accesskey="p" key="paste-key"
-         label="Paste" oncommand="alert('Paste invoked')"/>
-    </menupopup>
-  </menu>
-</menubar>
-
- -

위 예제에서 메뉴 항목의 key 속성값은 paste-key로 앞에서 정의된 key 요소의 id와 동일한 값입니다. 여러분은 이 값을 여러개의 메뉴 항목에 대한 키보드 단축키로 여러번 사용할 수 있습니다.

- -

여러분은 그림에서 보듯이 Paste 메뉴 옆에 Control과 V키 텍스트가 위치하는 것을 볼 수 있으며, 이는 이 메뉴를 호출하기 위해 이 키 조합을 누르면 된다는 것을 나타냅니다. 이것은 key 요소에 있는 modifier 속성에 따라 자동으로 추가됩니다. 메뉴에 연결되는 키보드 단축키는 메뉴가 열리지 않은 상태에서도 동작합니다.

- -

키 정의의 또 다른 기능은 쉽게 사용 불가능한 상태로 만들 수 있다는 것입니다. 이를 위해서는 key 요소에 disabled 속성을 추가하고 true값으로 설정하면 됩니다. 이렇게 지정하면 해당 키보드 단축키는 사용 불가능한 상태이면 따라서 키를 누르더라도 호출되지 않습니다. 스크립트를 이용해 disabled 속성을 변경는 것은 유용한 기능입니다.

- -
-

파일 찾기 예제

- -

파일 찾기 대화창을 위한 키보드 단축키를 추가해 보겠습니다. 4개의 단축키를 넣을 것인데, Cut, Copy, Paste 명령에 각각 하나씩과 ESC를 눌렀을 경우 사용할 Close 명령에 하나를 추가할 것입니다.

- -
<keyset>
-  <key id="cut_cmd" modifiers="accel" key="X"/>
-  <key id="copy_cmd" modifiers="accel" key="C"/>
-  <key id="paste_cmd" modifiers="accel" key="V"/>
-  <key id="close_cmd" keycode="VK_ESCAPE" oncommand="window.close();"/>
-</keyset>
-
-<vbox flex="1">
- <toolbox>
-  <menubar id="findfiles-menubar">
-   <menu id="file-menu" label="File" accesskey="f">
-     <menupopup id="file-popup">
-       <menuitem label="Open Search..." accesskey="o"/>
-       <menuitem label="Save Search..." accesskey="s"/>
-       <menuseparator/>
-       <menuitem label="Close" accesskey="c" key="close_cmd"
-         oncommand="window.close();"/>
-     </menupopup>
-   </menu>
-   <menu id="edit-menu" label="Edit" accesskey="e">
-     <menupopup id="edit-popup">
-       <menuitem label="Cut" accesskey="t" key="cut_cmd"/>
-       <menuitem label="Copy" accesskey="c" key="copy_cmd"/>
-       <menuitem label="Paste" accesskey="p" key="paste_cmd" disabled="true"/>
-     </menupopup>
-   </menu>
-
- -

이제 우리는 명령을 실행하기 위해 단축키를 사용할 수 있습니다. 물론 아직 클립보드와 관련된 스크립트를 작성하지 않았기 때문에 아무것도 수행되지는 않을 것입니다.

-
- -

키 이벤트

- -

위에서 언급한 키와 관련된 기능이 적당하지 않은 경우에 사용할 수 있는 세 가지 키보드 이벤트가 있습니다. 이 이벤트는 다음과 같습니다.

- -
-
keypress 
-
포커스를 가진 요소에 키가 눌러졌다가 때어질때 호출됩니다. 입력필드에 특정 문자만 입력 가능 하도록 하고자 할 때 사용할 수 있습니다.
-
keydown 
-
포커스를 가진 요소에 키가 눌러졌을 때 호출됩니다. 이 이벤트는 키를 누른 후 때지 않더라도 발생합니다.
-
keyup 
-
포커스를 가진 요소에 눌러진 키가 떨어질 때 호출됩니다.
-
- -

키 이벤트는 포커스를 가진 요소로만 전달됩니다. 일반적으로 텍스트상자, 버튼, 체크박스 등이 이에 해당합니다. 포커스를 가진 요소가 아무것도 없다면 XUL 문서가 이벤트의 대상이 됩니다. 이 경우, window 태그에 이벤트 리스너를 추가할 수 있습니다. 그렇지만 일반적으로 전역적인 키에 응답하는 경우에는 앞에서 언급한 키보드 단축키를 사용합니다.

- -

키의 이벤트 객체는 눌러진 키에 대한 정보를 담고 있는 두 가지 속성이 있습니다. keyCode 속성은 키 코드를 가지고 있으며 앞 절에서 본 키 테이블에 있는 상수들 중 하나와 비교될 수 있습니다. charCode 속성은 출력 가능한 문자로 눌러진 키에 해당하는 문자 코드를 담고 있습니다.

- -
지금까지의 파일 찾기 예제 : Source View
- -

다음 절에서는 포커스와 선택을 처리하는 방법에 대해 알아보겠습니다.

- -

-

« 이전다음 »

-

- -

diff --git a/files/ko/mozilla/tech/xul/xul_tutorial/list_controls/index.html b/files/ko/mozilla/tech/xul/xul_tutorial/list_controls/index.html deleted file mode 100644 index de4f6124da..0000000000 --- a/files/ko/mozilla/tech/xul/xul_tutorial/list_controls/index.html +++ /dev/null @@ -1,133 +0,0 @@ ---- -title: List Controls -slug: Mozilla/Tech/XUL/XUL_Tutorial/List_Controls -tags: - - XUL - - XUL_Tutorial -translation_of: Archive/Mozilla/XUL/Tutorial/List_Controls ---- -

-

« 이전다음 »

-

-

XUL은 목록 상자를 생성하는 여러 요소의 형식을 가지고 있습니다.

-

목록 상자

-

목록 상자는 목록에서 여러 항목을 표시하는 데 사용됩니다. 사용자는 리스트에서 어떤 항목을 선택할 수 있습니다.

-

XUL은 목록을 생성하기 위해 두 가지 요소 타입을 제공하는데, listbox 요소는 다중 행 목록 상자를, 그리고 menulist요소는 드롭다운 목록 상자를 생성합니다. 이들은 HTML select 요소와 유사한 방식으로 작업을 하면서, 두 가지 기능 모두 수행하지만, XUL의 요소는 추가적인 기능을 가지고 있습니다.

-

가장 단순한 목록 상자는 상자 자체에 대해서는 listbox를 사용하고, listitem 요소는 각 항목으로 사용합니다. 예제를 보면, 이 목록 상자는 4개의 행을 가지면서, 각 항목마다 하나씩입니다.

-

예제 1 : Source View

-
- Image:lists1.png
-
<listbox>
-  <listitem label="Butter Pecan"/>
-  <listitem label="Chocolate Chip"/>
-  <listitem label="Raspberry Ripple"/>
-  <listitem label="Squash Swirl"/>
-</listbox>
-
-

HTML의 option 요소가 가진 것과 마찬가지로, 사용자는 value 속성을 사용해서 각 항목에 대해 값을 할당할 수 있습니다. 그리고 나서 스크립트로 해당 값을 사용할 수 있습니다. 목록 상자는 적당한 크기를 기본으로 설정하지만, rows 속성으로 크기를 제어할 수 있습니다. 목록 상자에 출력될 행 수를 지정하기 위해 값을 설정하세요. rows 값 보다 더 많은 행이 있으면 이를 표시할 수 있는 스크롤바가 나타납니다.

-

다음의 예제는 이러한 추가 기능을 설명합니다.

-

예제 2 : Source View

-
<listbox rows="3">
-  <listitem label="Butter Pecan" value="bpecan"/>
-  <listitem label="Chocolate Chip" value="chocchip"/>
-  <listitem label="Raspberry Ripple" value="raspripple"/>
-  <listitem label="Squash Swirl" value="squash"/>
-</listbox>
-
-

이 예제는 한번에 단 3개 행만을 표시하도록 변경된 것입니다. 또한 목록에 있는 각 항목에 값이 추가되었습니다. 목록 상자는 더 많은 기능을 제공하며, 다음에서 설명하고 있습니다.

-

다중열 목록 상자

-

목록 상자는 다중열을 지원합니다. 셀에는 보통 텍스트가 쓰이지만 어떤 컨텐츠도 포함할 수 있습니다. 사용자가 목록에서 항목을 선택하면 행 전체가 선택되며, 하나의 셀만 선택되도록 할 수는 없습니다.

-

목록 상자에 열을 명시하기 위해서는 2개의 태그가 사용됩니다. listcols 요소는 열의 정보를 담기 위해 사용되며, 각 열에 대한 정보는 listcol요소를 사용해 명시합니다. 목록 상자의 각 열별로 하나의 listcol 요소가 필요합니다.

-

행에 포함되는 각 셀은 listcell 요소를 사용해 표현합니다. 3개의 열을 표현하려면, 각각의 listitem 내부에 3개의 listcell을 넣어야 합니다. 셀의 텍스트 컨텐츠를 명시하려면 listcell 요소의 label 속성을 사용합니다. 하나의 열만 있는 단순한 경우에는 label 속성을 listitem 요소에 직접 넣을 수 있으며, 이럴 경우에는 앞서 보았던 목록 상자 예제처럼 listcell 요소가 전혀 필요 없습니다.

-

다음은 두 개의 열과 세개의 행을 가진 목록 박스 예제입니다.

-

예제 3 : Source View

-
<listbox>
-  <listcols>
-    <listcol/>
-    <listcol/>
-  </listcols>
-  <listitem>
-    <listcell label="George"/>
-    <listcell label="House Painter"/>
-  </listitem>
-  <listitem>
-    <listcell label="Mary Ellen"/>
-    <listcell label="Candle Maker"/>
-  </listitem>
-  <listitem>
-    <listcell label="Roger"/>
-    <listcell label="Swashbuckler"/>
-  </listitem>
-</listbox>
-
-

머리 행

-

목록 상자에서는 특별한 머리 행을 사용할 수 있습니다. 이것은 일반적인 행과 비슷하지만 다른 모양으로 출력됩니다. 이것은 열 머리를 만들기 위해 사용할 수 있으며, 두 개의 새로운 요소가 사용됩니다.

-

listhead 요소는 listitem가 보통 행에 사용되는 것처럼, 머리 행을 위해 사용합니다. 머리 행은 보통 행이 아니라서, 스크립트를 이용해 목록 상자의 첫번째 행을 얻으려고 할 경우 무시됩니다.

-

listheader 요소는 머리 행의 각 셀에 사용됩니다. 머리 셀의 라벨을 지정하기 위해서는 label 속성을 사용하세요.

-

다음은 예제 3에 머리 행을 추가한 예제입니다.

-

예제 4 : Source View

-
- Image:morelists1.png
-
<listbox>
-
-  <listhead>
-    <listheader label="Name"/>
-    <listheader label="Occupation"/>
-  </listhead>
-
-  <listcols>
-    <listcol/>
-    <listcol flex="1"/>
-  </listcols>
-
-  <listitem>
-    <listcell label="George"/>
-    <listcell label="House Painter"/>
-  </listitem>
-  <listitem>
-    <listcell label="Mary Ellen"/>
-    <listcell label="Candle Maker"/>
-  </listitem>
-  <listitem>
-    <listcell label="Roger"/>
-    <listcell label="Swashbuckler"/>
-  </listitem>
-
-</listbox>
-
-

위 예제에서는 열을 유연하게 만들기 위해 flex 속성을 사용하였습니다. 이 속성은 다음 절에서 설명하겠지만, 여기서는 열이 남은 공간을 모두 채우도록 하는데 사용하고 있습니다. 여러분이 창의 크기를 변경하면 열이 창만큼 늘어나는 것을 볼 수 있을 것입니다. 창의 크기가 줄어들면, 셀안에 있는 라벨이 자동으로 잘려 지고 생략부호가 출력됩니다. 생략부호가 출력되지 않도록 하기 위해서는 셀이나 아이템에 crop 속성을 none으로 설정하면 됩니다.

-

드롭다운 목록

-

드롭다운 목록은 select 요소를 사용하여 HTML에서 생성할 수 있습니다. 사용자는 텍스트상자에서 하나만 선택된 것을 볼 수도 그리고 화살표를 클릭하거나 다른 선택을 하기 위해 텍스트상자 옆에 있는 유사한 버튼을 클릭할 수도 있습니다. 다른 선택사항은 팝업창에 나타날 것입니다. XUL은 이런 목적에 사용할 수 잇는 menulist 요소를 가지고 있습니다. 이것은 텍스트상자와 그 옆에 있는 버튼으로 이루어집니다. 이름이 선택된 것은 내부에서 선택된 메뉴로 띄워졌기 때문입니다.

-

드롭다운 상자를 기술하기 위해서는 세 가지 요소가 필요합니다. 첫번째는 menulist 요소로 버튼을 가진 텍스트상자를 생성합니다. 두번째는 menupopup으로 버튼을 클릭했을 때 나타나는 팝업창을 생성합니다. 세번재는 menuitem으로 개별 선택 항목을 생성합니다.

-

다음의 예제는 이런한 점을 잘 설명하고 있는 구문입니다.

-

예제 5 : Source View

-
- Image:inputs2.png
-
<menulist label="Bus">
-  <menupopup>
-    <menuitem label="Car"/>
-    <menuitem label="Taxi"/>
-    <menuitem label="Bus" selected="true"/>
-    <menuitem label="Train"/>
-  </menupopup>
-</menulist>
-
-

위의 menulist는 4가지 선택 항목을 담고있는 데, 각각은 menuitem 요소에 해당 합니다. 선택 항목을 보이도록 하려면 menulist에서 화살 버튼(▼)을 클릭합니다. 하나를 선택하면, menulist에서 선택된 것이 나타납니다. selected 속성은 기본적으로 선택된 값을 지정하는 데 사용됩니다.

-

편집 가능한 메뉴목록

-

기본적으로 사용자는 목록에서 선택항목을 선택할 수만 있습니다. 여러분은 직접 타이핑해서 입력 할 수는 없습니다. 또 다른 종류의 menulist은 필드에서 텍스트 편집을 허용합니다. 예를 들면, 브라우저의 URL 필드 이전에 타이핑한 URL 선택을 위한 드롭다운 메뉴가 있는 데, 거기에 입력할 수도 있습니다.

-

편집가능한 menulist를 만들려면, 다음과 같은 editable 속성을 추가하면 됩니다.

-

예제 6 : Source View

-
<menulist editable="true">
-  <menupopup>
-    <menuitem label="www.mozilla.org"/>
-    <menuitem label="www.xulplanet.com"/>
-    <menuitem label="www.dmoz.org"/>
-  </menupopup>
-</menulist>
-
-

생성된 URL 필드는 사용자가 선택할 수 있는 이미 설정된 선택 항목을 가지고 있으면서 또한 필드에다 사용자 자신이 타이핑할 수도 있습니다. 사용자가 입력한 텍스트는 새로운 선택항목으로 추가되지는 않습니다. label 속성은 이 예제에선 사용되지 않았기 때문에, 기본 값은 공백으로 처리되게 됩니다.

-

다음 장에서는 진행 지시자 만들기를 익혀 보겠습니다.

-

-

« 이전다음 »

-

-

diff --git a/files/ko/mozilla/tech/xul/xul_tutorial/localization/index.html b/files/ko/mozilla/tech/xul/xul_tutorial/localization/index.html deleted file mode 100644 index 7ca10f7172..0000000000 --- a/files/ko/mozilla/tech/xul/xul_tutorial/localization/index.html +++ /dev/null @@ -1,279 +0,0 @@ ---- -title: Localization -slug: Mozilla/Tech/XUL/XUL_Tutorial/Localization -tags: - - Localization - - XUL - - XUL_Tutorial -translation_of: Archive/Mozilla/XUL/Tutorial/Localization ---- -

-

« 이전다음 »

-

-

XUL과 XML은 지역화를 허락하는 편리한 방법인 엔티티(entity)를 제공합니다.

-

엔티티

-

많은 응용프로그램은 될 수 있는 대로 인터페이스를 다른 언어로 옮기기 간단하게 만듭니다. 보통은, 각 언어를 위해 문자열 표를 만듭니다. 응용프로그램에 직접 하드코딩한 텍스트 대신, 각 언어별 텍스트는 오직 문자열 표로 만든 참조입니다. XML은 비슷한 목적으로 쓸 수 있는 엔티티를 제공합니다.

-

여러분이 HTML를 써 봤다면 엔티티와는 벌써 친숙할 겁니다. 코드 &lt;&gt;는 텍스트에 less than(~보다 적은)과 greater than(~보다 큰) 기호로 놓고 쓸 수 있는 엔티티 예입니다. XML에는 사용자 정의 엔티티를 선언하게 하는 문법이 있습니다. 여러분은 엔티티가 그 값(하나로 이어진 텍스트일 수 있는)으로 치환되도록 사용자 정의 엔티티를 쓸 수 있습니다. 엔티티가 속성값을 포함하는 텍스트마다 쓰일 지도 모릅니다. 아래 예는 버튼에 쓰이는 엔티티를 실제로 보입니다.

-
<button label="&findLabel;"/>
-
-

label에 나타날 텍스트는 엔티티 &findLabel;의 값입니다. 파일은 지원하는 각 언어를 위한 엔티티 선언을 포함하여 만듭니다. 영어에서, &findLabel; 엔티티는 아마도 "Find" 텍스트 값으로 선언될 겁니다.

-

DTD 파일

-

엔티티는 DTD ( - - 문서 형 선언 - ) 파일에 선언합니다. 이 형의 파일은 보통 특정 XML 파일의 문법과 의미를 선언하는데 쓰지만 또한 엔티티 선언에 씁니다. Mozilla chrome 시스템에서, <tt>locales</tt> 하위디렉토리에 있는 DTD 파일을 발견할 겁니다. 보통 XUL 파일당 DTD 파일(확장자가 <tt>.dtd</tt>) 하나입니다.

-

chome 디렉토리를 들여다보면, 당신 언어를 위한 압축(archive) 파일이 보입니다. (<tt>en-US.jar</tt>는 영어 기본값입니다.) 여러 언어 locale 파일이 있을 지도 모릅니다. 예를 들어, 미국 영어(en-US)와 프랑스어(fr). 이 압축 파일 안에서, 각 창을 위한 지역화 텍스트를 담은 파일을 발견할 겁니다. 압축 파일의 구조는 스킨에 쓰는 디렉토리 구조와 매우 비슷합니다.

-

압축 파일 안에, 엔티티를 선언한 DTD 파일을 둡니다. 대체로, 각 XUL 파일에 DTD 파일 하나이고 보통은 <tt>.dtd</tt> 확장자를 빼면 같은 파일명입니다. 그래서 파일 찾기(find files) 대화상자는 findfile.dtd로 이름 붙인 파일이 필요합니다.

-

설치하지 않은 chrome 파일을 위해서는, 그냥 XUL 파일과 같은 디렉토리에 DTD 파일을 둘 수 있습니다.

-
- 주의: 아스키가 아닌 문자를 위해 DTD 파일을 UTF-8N으로 인코드해야 합니다.
-

한 번 XUL에 DTD 파일을 만들면, XUL 파일에 쓰고 싶은 DTD 파일을 나타내는 줄이 XUL 파일에 필요합니다. 그렇지 않으면, 엔티티를 찾을 수 없을 거라는 에러가 발생합니다. 이를 위해, XUL 파일 위쪽쯤에 다음 꼴로 한 줄을 추가하세요.

-
<!DOCTYPE window SYSTEM "chrome://findfile/locale/findfile.dtd">
-
-

이 줄은 나타낸 URL이 파일을 위한 DTD로 쓰임을 지정합니다. 이 경우에, 우리는 <tt>findfile.dtd</tt> 파일을 쓰기 원한다고 선언했습니다. 이 줄은 보통 window 요소 바로 앞에 둡니다.

-

엔티티 선언하기

-

엔티티는 아래 보는 대로 간단한 문법을 써서 선언합니다.

-
<!ENTITY findLabel "Find">
-
-

이 예는 이름이 findLabel이고 값이 "Find"인 엔티티를 만듭니다. 이는 텍스트 "&findLabel;"가 XUL 파일에 나타날 때마다, 텍스트 "Find"로 바꿈을 뜻합니다. 엔티티 선언은 선언 끝에 끌리는(trailing) 빗금(/)이 없음을 유념하세요. 다른 언어를 위한 DTD 파일에서는, 그 언어를 위한 텍스트가 대신 쓰입니다.

-
for Korean:
-<!ENTITY findLabel "찾기">
-
-

예를 들면, 다음 텍스트는

-
<description value="&findLabel;"/>
-
-

아래처럼 옮깁니다.

-
English version:
-<description value="Find"/>
-
-Korean version:
-<description value="찾기"/>
-
-

여러분은 인터페이스에 쓸 라벨이나 텍스트 문자열을 위한 엔티티를 선언합니다. XUL 파일에 직접 표시할 텍스트가 전혀 없어도 좋습니다.

-

텍스트 라벨를 위한 엔티티 사용 외에도, 엔티티를 다른 언어에서는 서로 다른 아무 값에 써도 좋습니다. 예를 들면, 키보드 단축키

-
 XUL
- <menuitem label="&undo.label;" accesskey="&undo.key;"/>
- DTD
- <!ENTITY undo.label "Undo">
- <!ENTITY undo.key "u">
-
-

위 예는 엔티티 둘을 씁니다. 실행 취소 메뉴 항목 라벨에 하나 그리고 단축키를 위해 하나.

-

 

-
-

Find Files 예제 바꾸기

-

모든 텍스트 문자열을 위해 DTD 파일을 쓰도록 find files 대화상자를 수정하여 어떻게 이 모두를 함께 놓는지 살펴봅시다. 전체 XUL 파일은 빨간색으로 쓴 바뀐 부분과 함께 아래에 보입니다.

-
<?xml version="1.0"?>
-
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="findfile.css" type="text/css"?>
-
-<!DOCTYPE window SYSTEM "chrome://findfile/locale/findfile.dtd">
-
-<window
-  id="findfile-window"
-  title="&findWindow.title;"
-  persist="screenX screenY width height"
-  orient="horizontal"
-  onload="initSearchList()"
-  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-<script src="findfile.js"/>
-
-<popupset>
-   <popup id="editpopup">
-     <menuitem label="Cut" accesskey="&cutCmd.accesskey;"/>
-     <menuitem label="Copy" accesskey="&copyCmd.accesskey;"/>
-     <menuitem label="Paste" accesskey="&pasteCmd.accesskey;" disabled="true"/>
-   </popup>
-</popupset>
-
-<keyset>
-   <key id="cut_cmd" modifiers="accel" key="&cutCmd.commandkey;"/>
-   <key id="copy_cmd" modifiers="accel" key="&copyCmd.commandkey;"/>
-   <key id="paste_cmd" modifiers="accel" key="&pasteCmd.commandkey;"/>
-   <key id="close_cmd" keycode="VK_ESCAPE" oncommand="window.close();"/>
-</keyset>
-
-<vbox flex="1">
-
- <toolbox>
-
-  <menubar id="findfiles-menubar">
-    <menu id="file-menu" label="&fileMenu.label;"
-        accesskey="&fileMenu.accesskey;">
-      <menupopup id="file-popup">
-        <menuitem label="&openCmd.label;"
-                  accesskey="&openCmd.accesskey;"/>
-        <menuitem label="&saveCmd.label;"
-                  accesskey="&saveCmd.accesskey;"/>
-        <menuseparator/>
-        <menuitem label="&closeCmd.label;"
-                  accesskey="&closeCmd.accesskey;" key="close_cmd" oncommand="window.close();"/>
-      </menupopup>
-    </menu>
-    <menu id="edit-menu" label="&editMenu.label;"
-          accesskey="&editMenu.accesskey;">
-      <menupopup id="edit-popup">
-        <menuitem label="&cutCmd.label;"
-                  accesskey="&cutCmd.accesskey;" key="cut_cmd"/>
-        <menuitem label="&copyCmd.label;"
-                  accesskey="&copyCmd.accesskey;" key="copy_cmd"/>
-        <menuitem label="&pasteCmd.label;"
-                  accesskey="&pasteCmd.accesskey;" key="paste_cmd" disabled="true"/>
-      </menupopup>
-    </menu>
-  </menubar>
-
-  <toolbar id="findfiles-toolbar">
-    <toolbarbutton id="opensearch" label="&openCmdToolbar.label;"/>
-    <toolbarbutton id="savesearch" label="&saveCmdToolbar.label;"/>
-  </toolbar>
- </toolbox>
-
- <tabbox>
-  <tabs>
-    <tab label="&searchTab;" selected="true"/>
-    <tab label="&optionsTab;"/>
-  </tabs>
-
-  <tabpanels>
-
-   <tabpanel id="searchpanel" orient="vertical" context="editpopup">
-
-   <description>
-     &findDescription;
-   </description>
-
-   <spacer class="titlespace"/>
-
-   <groupbox orient="horizontal">
-     <caption label="&findCriteria;"/>
-
-     <menulist id="searchtype">
-       <menupopup>
-         <menuitem label="&type.name;"/>
-         <menuitem label="&type.size;"/>
-         <menuitem label="&type.date;"/>
-       </menupopup>
-     </menulist>
-   <spacer class="springspace"/>
-     <menulist id="searchmode">
-       <menupopup>
-         <menuitem label="&mode.is;"/>
-         <menuitem label="&mode.isnot;"/>
-       </menupopup>
-     </menulist>
-   <spacer class="springspace"/>
-
-   <menulist id="find-text" flex="1"
-             editable="true"
-             datasources="file:///mozilla/recents.rdf"
-             ref="http://www.xulplanet.com/rdf/recent/all">
-     <template>
-       <menupopup>
-         <menuitem label="rdf:http://www.xulplanet.com/rdf/recent#Label" uri="rdf:*"/>
-       </menupopup>
-     </template>
-   </menulist>
-
-   </groupbox>
-
-  </tabpanel>
-
-  <tabpanel id="optionspanel" orient="vertical">
-     <checkbox id="casecheck" label="&casesensitive;"/>
-     <checkbox id="wordscheck" label="&matchfilename;"/>
-    </tabpanel>
-
-  </tabpanels>
- </tabbox>
-
- <tree id="results" style="display: none;" flex="1">
-   <treecols>
-     <treecol id="name" label="&results.filename;" flex="1"/>
-     <treecol id="location" label="&results.location;" flex="2"/>
-     <treecol id="size" label="&results.size;" flex="1"/>
-   </treecols>
-
-   <treechildren>
-     <treeitem>
-       <treerow>
-         <treecell label="mozilla"/>
-         <treecell label="/usr/local"/>
-         <treecell label="&bytes.before;2520&bytes.after;"/>
-       </treerow>
-     </treeitem>
-   </treechildren>
- </tree>
-
- <splitter id="splitbar" resizeafter="grow" style="display: none;"/>
-
- <spacer class="titlespace"/>
-
- <hbox>
-   <progressmeter id="progmeter" value="50%" style="display: none;"/>
-   <spacer flex="1"/>
-   <button id="find-button" label="&button.find;"
-           oncommand="doFind()"/>
-   <button id="cancel-button" label="&button.cancel;"
-           oncommand="window.close();"/>
- </hbox>
-</vbox>
-
-</window>
-
-

각 텍스트 문자열은 엔티티 참조로 바뀝니다. DTD 파일은 XUL 파일의 시작 부분쯤에 포함됩니다. 추가될 각 엔티티는 DTD 파일에 선언하면 좋습니다. 창은 XUL 파일에서 찾은 엔티티가 선언되지 않았으면 표시되지 않습니다.

-

엔티티 이름은 중요하지 않음을 유념하세요. 위 예제에서, 엔티티에 쓰인 단어는 마침표로 구분됐습니다. 여러분은 이렇게 하지 않아도 됩니다. 여기 엔티티 이름은 Mozilla 코드 나머지와 비슷한 관례(convention)를 따릅니다.

-

여러분이 텍스트 '2520 bytes'는 두 엔티티로 바뀌었음에 알아챌지도 모릅니다. 이는 구(phrase) 구조가 딴 locale에서 다를 지도 모르기 때문입니다. 예를 들면, 숫자는 대응하는 'bytes' 뒤 말고 앞에 나올 필요가 있을지도 모릅니다. 물론, 이는 필요에 따라 KB나 MB 표시를 위해 더 복잡할 지도 모릅니다.

-

단축키(access key와 keyboard shortcut)도 아마 딴 locale에서 다를 지도 모르기 때문에 또한 엔티티로 번역됩니다.

-

다음은, DTD 파일(findfile.dtd)입니다.

-
<!ENTITY findWindow.title "Find Files">
-<!ENTITY fileMenu.label "File">
-<!ENTITY editMenu.label "Edit">
-<!ENTITY fileMenu.accesskey "f">
-<!ENTITY editMenu.accesskey "e">
-<!ENTITY openCmd.label "Open Search...">
-<!ENTITY saveCmd.label "Save Search...">
-<!ENTITY closeCmd.label "Close">
-<!ENTITY openCmd.accesskey "o">
-<!ENTITY saveCmd.accesskey "s">
-<!ENTITY closeCmd.accesskey "c">
-<!ENTITY cutCmd.label "Cut">
-<!ENTITY copyCmd.label "Copy">
-<!ENTITY pasteCmd.label "Paste">
-<!ENTITY cutCmd.accesskey "t">
-<!ENTITY copyCmd.accesskey "c">
-<!ENTITY pasteCmd.accesskey "p">
-<!ENTITY cutCmd.commandkey "X">
-<!ENTITY copyCmd.commandkey "C">
-<!ENTITY pasteCmd.commandkey "V">
-<!ENTITY openCmdToolbar.label "Open">
-<!ENTITY saveCmdToolbar.label "Save">
-<!ENTITY searchTab "Search">
-<!ENTITY optionsTab "Options">
-<!ENTITY findDescription "Enter your search criteria below and select the Find button to begin the search.">
-<!ENTITY findCriteria "Search Criteria">
-<!ENTITY type.name "Name">
-<!ENTITY type.size "Size">
-<!ENTITY type.date "Date Modified">
-<!ENTITY mode.is "Is">
-<!ENTITY mode.isnot "Is Not">
-<!ENTITY casesensitive "Case Sensitive Search">
-<!ENTITY matchfilename "Match Entire Filename">
-<!ENTITY results.filename "Filename">
-<!ENTITY results.location "Location">
-<!ENTITY results.size "Size">
-<!ENTITY bytes.before "">
-<!ENTITY bytes.after "bytes">
-<!ENTITY button.find "Find">
-<!ENTITY button.cancel "Cancel">
-
-

이제, 새 언어를 위한 텍스트를 추가하기 위해 필요한 모든 것은 다른 DTD 파일을 만드는 겁니다. 딴 locale에 DTD 파일을 추가하기 위해 chrome 시스템을 써서, 같은 XUL 파일을 다른 언어에 쓸 수 있습니다.

-

지금까지 Find files 예제: Source

-
-


- 다음은, 프로퍼티 파일을 보겠습니다.

-

-

« 이전다음 »

-

-

diff --git a/files/ko/mozilla/tech/xul/xul_tutorial/manifest_files/index.html b/files/ko/mozilla/tech/xul/xul_tutorial/manifest_files/index.html deleted file mode 100644 index bf2e970432..0000000000 --- a/files/ko/mozilla/tech/xul/xul_tutorial/manifest_files/index.html +++ /dev/null @@ -1,118 +0,0 @@ ---- -title: Manifest Files -slug: Mozilla/Tech/XUL/XUL_Tutorial/Manifest_Files -tags: - - XUL - - XUL_Tutorial -translation_of: Archive/Mozilla/XUL/Tutorial/Manifest_Files ---- -

-

« 이전다음 »

-

-


- 이번 섹션에서는 꾸러미에 chrome과 XUL 파일을 넣는 방법과 꾸러미를 위한 선언 파일(manifest file)을 생성하는 방법에 대해 알아 보겠습니다.

-

꾸러미

-

꾸러미는 사용자 인터페이스의 기능을 정의하는 XUL 파일과 스크립트의 집합입니다. 꾸러미는 모질라에 설치될 수 있으며, chrome URL로 참조될 수도 있습니다. 꾸러미는 어떤 종류의 파일도 포함할 수 있고, 필요한 경우에는 꾸러미의 여러 부분을 하위 디렉토리에 나누어 담을 수도 있습니다. 꾸러미는 디렉토리나 JAR 아카이브로 저장될 수 있습니다.

-

선언 파일

-

선언 파일은 꾸러미를 설명하고 꾸러미의 디스크에서의 위치와 chrome URL을 연결하는데 사용됩니다. Mozilla 응용 프로그램이 시작될 때 어떤 꾸러미들이 설치되어 있는지 확인하기 위해 chrome 디렉토리에 있는 선언 파일을 검사합니다. 이것은 새로운 꾸러미를 설치하기 위해 여러분이 해야 할 작업은 새로운 선언 파일을 어플리케이션 chrome 디렉토리나 사용자 chrome 디렉토리에 추가하는 것 뿐이라는 것을 의미합니다. 후자의 chrome 디렉토리는 보통 어플리케이션 디렉토리에 쓰기 권한이 없을 수 있기 때문에 사용되는 방법입니다.

-

만일 여러분이 권한이 있는 XUL 코드를 Firefox 브라우저에서 테스트 하려고 한다며, 다음의 절차와 같이 한줄만 있는 선언 파일을 가지고 쉽게 할 수 있습니다.

-
    -
  1. 어딘가에 새로운 디렉토리를 생성하세요. 예를 들어, Windows일 경우 C:\testfiles일 수 있겠습니다.
  2. -
  3. Chrome 디렉토리에 test.manifest라는 이름을 가진 새로운 ASCII1 파일을 만드세요. 파일은 .manifest라는 확장자를 가지기만 하면 어떤 이름이든 상관 없습니다. (1. BOM을 가진 UTF-8은 작동하지 않습니다.)
  4. -
  5. 선언 파일에 다음 라인을 추가하세요.
  6. -
-
 content tests file:///C:/testfiles/
-
-

위 라인상의 파일 경로는 앞서 생성한 디렉토리를 가리켜야 합니다. 파일 경로를 정확히 모를 경우에는 브라우저에서 해당 경로를 열고 주소 영역에서 URL을 복사하세요.

-

이게 답니다! 이제 여러분이 새로운 디렉토리에 몇 가지 XUL 파일들을 추가만 하면, chrome://tests/content/<filename> 형식으로 chrom URL을 입력하여 해당 파일을을 로드할 수 있을 것입니다. 물론 변경된 내용을 반영하기 위해서는 브라우저를 재시작 해야 합니다. 만일 파일이 로드되지 않는다면, 파일 경로가 정확한지 확인하세요.

-

내용(content) 꾸러미를 위한 선언 파일 라인의 기본 구문은 다음과 같습니다.

-

'content <packagename> <filepath>'

-

첫 번째 필드인 'content'는 내용(content) 꾸러미라는 것을 나타냅니다. 테마일 경우에는 'skin'을 쓰고, 로케일인 경우에는 'locale'을 사용합니다. 위 예제에서 packagename은 'tests'이고, 이것은 chrome://tests/content/sample.xul의 chrome URL 첫번째 필드가 'tests'라는 것을 의미합니다. 만일 꾸러미 이름이 'browser'였다면 chrom URL은 chrome://browser/content/가 될 수 있습니다. 마지막 필드는 파일들이 위치한 경로 입니다. 이것은 파일 URL을 사용한 로컬 파일 경로이거나 jar URL을 사용한 JAR 아카이브(archive) 일 수 있습니다. JAR 아카이브에 대해서는 잠시 후에 설명할 것입니다. 선언 파일에 또 다른 라인을 포함하여 여러개의 꾸러미를 명시할 수도 있습니다.

-

Firefox에서 사용하는 browser.manifest 파일은 다음과 같습니다.

-
content branding jar:browser.jar!/content/branding/ xpcnativewrappers=yes
-content browser jar:browser.jar!/content/browser/ xpcnativewrappers=yes
-overlay chrome://global/content/viewSource.xul chrome://browser/content/viewSourceOverlay.xul
-overlay chrome://global/content/viewPartialSource.xul chrome://browser/content/viewSourceOverlay.xul
-overlay chrome://browser/content/pageInfo.xul chrome://pippki/content/PageInfoOverlay.xul
-
-

여기에는 'branding'과 'browser' 두 개의 꾸러미가 나열되어 있습니다. 또 세 개의 overlays가 명시되어 있는데, 이는 다른 꾸러미의 내용(content)이 함께 조합될 수 있게 해 줍니다. 확장기능들은 대부분 브라우저의 UI와 확장기능의 UI가 병합(merge)되기 때문에 overlays를 사용하게 됩니다.

-

branding과 browser 꾸러미의 파일 경로는 content가 아카이브로 꾸려져 있기 때문에 jar URL을 사용하고 있습니다. JAR 아카이브는 ZIP 유틸리티를 이용해 생성할 수 있습니다. Chrome 디렉토리에 위치한 JAR 파일인 경우에는 다음과 같이 아주 간단합니다.

-

jar:<filename.jar>!/<path_in_archive>

-

browser 꾸러미에서 아카이브는 browser.jar이며 chrome 디렉토리에 선언 파일과 함께 위치합니다. 'content/browser' 경로는 XUL 파일이 위치한 아카이브 내의 경로를 나타냅니다. 만일 아카이브 내에 어떤 경로도 존재하지 않을 경우에는 경로를 명시할 필요가 없습니다. 여기서는 하나의 아카이브에 branding 꾸러미가 다른 경로로 저장되어 있으므로 명시되어 있습니다.

-

위에서 생성한 'tests' 꾸러미의 경우, 아카이브로 파일을 꾸리지 않았기 때문에 파일 경로가 직접 사용되었습니다. 개발시에는 변경이 발생할 때마다 매번 모든 파일을 꾸릴 필요가 없기 때문에, 이렇게 하는 것이 좋습니다. 그러나 응용프로그램이나 확장기능으로 배포할 경우에는 조그만 다수의 파일을 설치해야 하는 번거로움을 피하기 위해 하나의 아카이브로 묶길 원할 것입니다.

-

선언 파일의 라인 끝에 있는 xpcnativewrappers=yes 부분은 선택적으로 사용되는 플래그입니다. 자바스크립트에서는 웹 페이상에서 있는 코드가 내장(built-in) 함수를 재정의(override) 할 수 있습니다. 만일 xpcnativewrappers 플래그(flag)가 명시되어 있다면, 권한이 부여된 컨텍스트(privileged context)에서 실행되는 스크립트는 재정의된 함수가 아닌 원래의 내장 함수를 호출한다는 것을 의미합니다. 플래그 없이 확장기능이 수정된 버전의 함수를 호출하려고 하면 제대로 작동하지 않을 수도 있고, 더욱이 보안 구멍이 생겨날 수 있습니다. 이 플래그는 이러한 문제점을 방지하기 위해 추가되었으며, 새로운 확장 기능들에서는 항상 사용하는게 좋습니다. 그러나 이러한 변화에 호환되지 않는 오래된 학장기능들에서는 무시됩니다. 이 기능에 대한 자세한 정보는 XPCNativeWrapper를 참조하세요.

-

테마와 로케일

-

테마와 로케일에서의 구문은 내용 꾸러미와 유사하지만, 여러분은 테마나 로케일을 제공할 내용 꾸러미를 명시해야 할 필요가 있습니다.

-
skin browser classic/1.0 jar:classic.jar!/skin/classic/browser/
-locale browser en-US jar:en-US.jar!/locale/browser/
-
-

위의 예에서 browser에 스킨과 로케일을 적용한다는 것을 나타내기 위한 특별한 필드가 추가되었습니다. 스킨 이름은 'classic/1.0'입니다. 이 경우에 테마 이름의 일부분으로 버전 번호가 사용되었지만, 여러분의 테마를 만들 경우에는 선택적인 사항입니다. Mozilla는 버전 번호를 특별한 방법으로 처리하지 않습니다. 위의 경우 버전 번호는 그냥 테마 이름의 일부분일 뿐입니다. 로케일은 'en-US'입니다. 이것들을 연결하는 chrome URL은 chrome://browser/skin과 chrome://browser/locale일 수 있습니다. 여러분의 테마나 로케일을 작성할 경우에는 위의 두 줄중 하나를 가진 선언 파일을 생성하고 테마나 로케일에 맞게 수정하기만 하면 됩니다.

-

테마에 대한 자세한 정보는 Themes를 참조하시고 로케일에 대한 자세한 정보는 Localization을 참조하세요.

-
-

우리의 파일 찾기 대화상자 예제

-

이제 우리가 작성하려고 하는 파일 찾가 대화 상자를 위한 선언 파일을 만들어 보도록 하겠습니다. 원한다면 세 가지 타입을 하나의 파일에 넣을 수 있습니다. 모든 부분(content, skin, locale)이 하나의 파일에 포함되는 확장 기능을 작성할 때 보통 이렇게 합니다. 파일 찾기 대화상자에서는 이러한 방법을 사용할 것입니다. Chrome 디렉토리에 findfile.manifest 파일을 생성하고 다음의 내용을 추가하세요.

-
content findfile file:///findfile/content/
-skin findfile classic/1.0 file:///findfile/skin/
-locale findfile en-US file:///findfile/locale/
-
-

위에서 열거된 새로운 디렉토리들을 생성하세요. 디렉토리를 어디에 생성하는지에는 상관이 없지만 선언 파일에서 명시한 파일 경로는 반드시 해당 디렉토리를 가리켜야 합니다. 당연히 여러분의 시스템에 맞는 디렉토리 경로를 사용하면 됩니다. 만일 꾸러미를 배포할 경우에는 JAR 파일로 묶길 원할 수도 있고 그렇게 되면 경로를 수정해야 합니다. 이번 경우에는 선언 파일에 대해 설명하고 다음 섹션에서 볼 예제를 위한 디렉토리를 준비할 목적으로 생성할 것입니다.

-

스킨과 로케일 줄의 두번째 필드가 'findfile'로 명시되었다는 것을 확인하세요. 이것은 스킨과 로케일이 첫 번째 줄에서 명시한 findfile 꾸러미를 수정한다는 것을 의미합니다. 위의 세 가지 경로는 각 부분을 위한 하위 디렉토리를 명시합니다. 여러분은 각 부분에 해당하는 파일을 분리하여 관리하기 위해 하위 디렉토리를 작성하길 원할 것입니다.

-
-

꾸러미 설치하기

-

응용 프로그램을 설치하기 위해서는 설치 프로그램을 만들거나 다른 응용 프로그램에 포함시킬 필요가 있습니다. 어떤 방법을 사용할 것인지는 여러분이 작성하는 응용 프로그램의 종류에 따라 달라집니다. 확장 기능일 경우에는 설치 파일인 install.rdf를 작성해야 하는데, 이는 어떤 것들을 설치할 것인지, 확장기능의 제작자가 누구인지, 호환되는 브라우저 버전이나 응용프로그램 등과 같은 내용을 포함하고 있습니다. 또한 확장 기능은 파일이 설치되는 장소에 제약이 있으므로 고유의 디렉토리 구조를 필요로 합니다. 확장 기능은 XPI 파일로 꾸려지게 됩니다. XPI는 XPInstall의 약자로 Mozilla에서 컴포넌트를 설치할 때 사용됩니다. JAR 파일과 마찬가지로 XPI 파일도 확장자만 다른 ZIP 파일 이기 때문에 ZIP 유틸리티로 보거나 생성할 수 있습니다.

-

Firefox의 확장 기능 관리자는 XPI 파일로 꾸려져 있는 확장 기능의 설치를 자동으로 처리해 줍니다. 작성한 확장 기능은 사용자들이 설치를 위해 위치할 수 있는 Mozilla Add-ons site로 업로드 할 것을 권장합니다. 어떤 사이트에서나 설치할 수는 있지만, 특정 사이트는 기본적으로 설치가 허가되지 않도록 되어 있을 수 있습니다.

-

파일들을 설치하기 위해서는 JavaScript로 작성된 스크립트를 이용할 수도 있습니다. 이러한 방법은 아무 위치에나 파일을 복사할 수 있으며, 다른 방법의 파일 관리 작업을 수행할 수 있게 해 줍니다. 그러나 스크립트로 설치된 응용프로그램은 확장 기능 관리자에 표시되지 않을 것이고, 따라서 자동화된 설치 해제 방법이 존재하지 않습니다. 이런 이유로 설치 스크립트는 잘 사용되지 않습니다.

-

독립형 응용 프로그램일 경우에는 XULRunner를 사용하여 꾸려질 수 있습니다. 이렇게 하면 별도의 실행 파일이 가능하며, 브라우저와는 독립적으로 응용 프로그램을 배포할 수 있습니다.

-

확장기능을 작성하는 좀 더 자세한 정보는 Extensions을 참조하시고, XULRunner에 대한 상세한 정보는 XULRunner를 참조하세요.

-

오래된 어플리케이션

-

만일 Mozilla 소프트웨어의 옛 버전(Firefox 1.5나 Mozilla 1.8 이전 버전)을 위한 응용 프로그램을 작성할 경우에는 좀 더 많은 단계가 추가됩니다. 다음은 옛 버전을 위한 꾸러미를 설정하는 방법에 대해 설명합니다. 여러분이 새로운 확장기능이나 XUL 응용 프로그램을 작성할 경우에는 본 섹션을 건너 뛰어도 됩니다.

-
- 주의: 언급되는 예전 절차는 새로운 SeaMonkey 1.0에도 적용됩니다. SeaMonkey 1.0의 코드베이스는 아직 "선언" 포맷을 채택하지 않고 있습니다.
-
<?xml version="1.0"?>
-
-<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-         xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
-
-  <RDF:Seq about="urn:mozilla:package:root">
-    <RDF:li resource="urn:mozilla:package:myapplication"/>
-  </RDF:Seq>
-
-  <RDF:Description about="urn:mozilla:package:myapplication"
-          chrome:displayName="Application Title"
-          chrome:author="Author Name"
-          chrome:name="myapplication"
-          chrome:extension="true"/>
-
-</RDF:RDF>
-
-
content,install,url,file:///main/app/
-
-
    -
  1. Create a directory somewhere on your disk. Many people put this as a subdirectory inside Mozilla's chrome directory, but this isn't necessary. The directory could be anywhere and on any disk. Put your XUL files in this directory.
  2. -
  3. Create a file called contents.rdf and place it in this directory. Copy the text in the box below into the new contents.rdf file. This file is used to identify the application id, its name, author, version and so on.
  4. -
  5. Change the highlighted parts of the file above to your own information. The red text 'myapplication' should be the ID of your application. You make this up, but typically, the ID is similar to your application's name. Replace the blue highlighted text above with your application's title and author.
  6. -
  7. If the 'chrome:extension' field is true, the application is a Mozilla Firefox Extension and it will show up in the Extensions window of the browser. If false, it will not appear.
  8. -
  9. Save the contents.rdf and make sure it is in the directory you created in step 1.
  10. -
  11. Open the file <mozilla-directory>/chrome/installed-chrome.txt, where <mozilla-directory> is the directory where Mozilla is installed. Exit Mozilla before you do this.
  12. -
  13. Next, you are going to register the new application with Mozilla so it will know where to find it. Add a line at the end of installed-chrome.txt pointing to the new directory you created in step 1. Change the highlighted text to the file URL below of the directory. Make sure that it URL ends with a slash and that you press enter at the end of the line. If you aren't sure what the URL is, open the directory created in step 1 into a Mozilla browser and copy the URL from the location field. Note that the reference should always be a directory, not a file.
  14. -
  15. Delete the file <mozilla-directory>/chrome/chrome.rdf.
  16. -
  17. Start Mozilla. You should be able to view any XUL files you put into the directory using a URL of the form: chrome://applicationid/content/file.xul where file.xul is the filename. Your main XUL file should be applicationid.xul which you can load using the shortcut URL chrome://applicationid/content/.
  18. -
-

If you are creating skin and/or locale portions, repeat the steps above, except that the format of the contents.rdf file is slightly different. Look at the contents.rdf files in other applications for details.

-

문제 해결

-

Chrome 꾸러미를 작성하는 것은 종종 꼼수가 필요하고, 문제 발생의 원인을 찾기가 어려울 수 있습니다. 여기에서는 여러분들이 작업을 시작하는데 있어서의 몇 가지 팁을 제공하고자 합니다.

- -

선언 파일에 대한 좀더 자세한 정보는 Chrome Registration를 참조하세요.

-

다음 섹션에서는 XUL 언어에 대해 좀 더 자세히 알아보겠습니다.

-

-

« 이전다음 »

-

-

diff --git a/files/ko/mozilla/tech/xul/xul_tutorial/more_button_features/index.html b/files/ko/mozilla/tech/xul/xul_tutorial/more_button_features/index.html deleted file mode 100644 index a34556a984..0000000000 --- a/files/ko/mozilla/tech/xul/xul_tutorial/more_button_features/index.html +++ /dev/null @@ -1,69 +0,0 @@ ---- -title: More Button Features -slug: Mozilla/Tech/XUL/XUL_Tutorial/More_Button_Features -tags: - - XUL - - XUL_Tutorial -translation_of: Archive/Mozilla/XUL/Tutorial/More_Button_Features ---- -

-

« 이전다음 »

-

-

이번 단원에서는 버튼의 부가적인 기능들에 대해 알아 보겠습니다.

-

그림 넣기

-

버튼에 그림을 넣을 때는 image 속성에 URL을 지정해 주면 됩니다. 그림은 상대든 절대 URL이든 상관없이 로드되며, 읽어온 그림을 버튼에 표시합니다.

-

아래의 버튼은 labelimage(happy.png)을 모두 포함하고 있습니다. 그림은 라벨의 왼쪽에 표시되는데 다른 두 가지 속성을 이용하여 그림의 위치를 바꿀 수 있습니다. 이에 대해서는 잠시 후에 설명하겠습니다.

-

예제 1 : Source View

-
<button label="Help" image="happy.png"/>
-
-

CSS로 그림 넣기

-

이미지를 지정하는 또 다른 방법은 버튼에 CSS의 list-style-image 스타일 속성을 이용하는 것입니다. 이 방법은 XUL 파일을 바꾸지 않고도 '스킨'(이 경우는 그림)을 변경할 수 있도록 고안된 것입니다. 예제는 아래와 같습니다.

-

예제 2 : Source View

-
<button id="find-button"
-  label="Find" style="list-style-image: url('happy.png')"/>
-
-

위의 예에서도 'happy.png'라는 그림이 버튼에 표시됩니다. style 속성은 HTML에서의 style 속성과 비슷하게 동작합니다. 일반적으로, style 속성은 모든 XUL 요소에 사용할 수 있습니다. 스타일 선언은 별도의 스타일 시트에 넣는 것이 좋다는 점을 명심하세요.

-

그림 위치 지정하기

-

기본적으로 버튼의 그림은 글씨의 왼쪽에 표시됩니다. 그림의 위치를 지정하기 위해서는 두 가지의 속성을 사용할 수 있습니다.

-

dir 속성은 그림과 글씨의 방향을 제어합니다. dir 속성값을 reverse로 지정하면 그림이 글씨의 오른쪽에 출력됩니다. 반대로 normal을 사용하거나 값을 지정하지 않으면 그림은 글씨의 왼쪽에 나타납니다.

-

orient 속성을 사용하면 그림과 글씨의 상하 관계를 조정할 수 있습니다. 기본값은 horizontal로 그림이 글자의 왼쪽이나 오른쪽에 표시되도록 합니다. 이 값을 vertical로 지정하면 그림이 글자의 위나 아래에 나타나게 됩니다. 이 때는 dir 속성은 위, 아래의 방향을 지정하기 위해 사용할 수 있는데 normal일 때는 그림이 글씨 위에, reverse일 때는 그림이 글씨 아래에 표시됩니다.

-

예제 3 : Source View

-
- Image:advbtns1.png
-
<button label="Left" image="happy.png"/>
-<button label="Right" image="happy.png" dir="reverse"/>
-<button label="Above" image="happy.png" orient="vertical"/>
-<button label="Below" image="happy.png" orient="vertical" dir="reverse"/>
-
-

위의 예제는 앞에서 말한 네 가지 정렬 방식이 모두 사용되었습니다. 기본값을 사용할 때는 위와 같이 속성값을 지정하지 않아도 됩니다.

-

특별한 내용을 가지는 버튼

-

버튼 내부에는 임의의 마크업을 포함할 수 있으며 이런것들은 버튼의 안쪽에 표시됩니다. 이 기능을 자주 사용하지는 않겠지만, XUL이 제공하지 않는 사용자 정의 요소(custom element)를 만들 때 유용하게 쓰일 수 있습니다.

-

아래는 두 단어가 빨간색인 버튼을 만드는 예입니다.

-

예제 4 : Source View

-
<button>
-  <description value="This is a"/>
-  <description value="rather strange" style="color: red;"/>
-  <description value="button"/>
-</button>
-
-

어떠한 XUL 요소도 button에 삽입될 수 있습니다. 하지만 HTML 요소들은 무시되기 때문에, 대신 description을 사용해야 합니다. 그리고 버튼에 label 속성값을 지정하면 버튼 내부의 모든 내용이 사라진다는 것에 유념하세요.

- -

여러분은 menulist처럼 버튼을 눌렀을때 드롭 다운 메뉴가 나오도록 하기 위해, menupopup 요소를 버튼 내부에 넣을 수 있습니다. 이 때 type 속성을 반드시 menu로 지정해야 합니다.

-

예제 5 : Source View

-
- Image:advbtns2.png
-
<button type="menu" label="Device">
-  <menupopup>
-    <menuitem label="Printer"/>
-    <menuitem label="Mouse"/>
-    <menuitem label="Keyboard"/>
-  </menupopup>
-</button>
-
-

위의 예를 실행시키고 버튼을 클릭하면 세 가지 항목이 있는 메뉴가 펼쳐집니다. 하지만 menulist와 달리 항목을 선택해도 버튼의 라벨은 변하지 않습니다. 이런 종류의 버튼은 각 항목마다 스크립트를 지정하여 작업을 수행하게 함으로써 메뉴처럼 사용할 수 있습니다. 메뉴에 대한 더 자세한 내용은 나중에 알아보겠습니다.

-

여러분은 type 속성을 menu-button으로 지정하여 메뉴가 있는 버튼을 만들 수 있는데, 이렇게 만들어진 버튼은 위의 버튼과는 모양이 다릅니다. 위 그림의 왼쪽은 'menu'이고 두번째는 'menu-button'을 사용한 것입니다. 둘 다 메뉴를 가리키는 화살표를 가지고 있습니다. 하지만 'menu'를 사용한 버튼은 사용자가 버튼의 아무 곳이나 클릭하면 메뉴가 나타나는 반면 'menu-button'을 사용한 버튼은 사용자가 화살표를 눌러야 메뉴가 나타납니다.

-

다음에서는 XUL 요소가 창내에 배치되는 방법에 대해 좀 더 자세히 알아보겠습니다.

-

-

« 이전다음 »

-

-

diff --git a/files/ko/mozilla/tech/xul/xul_tutorial/more_event_handlers/index.html b/files/ko/mozilla/tech/xul/xul_tutorial/more_event_handlers/index.html deleted file mode 100644 index 17f4af786a..0000000000 --- a/files/ko/mozilla/tech/xul/xul_tutorial/more_event_handlers/index.html +++ /dev/null @@ -1,140 +0,0 @@ ---- -title: More Event Handlers -slug: Mozilla/Tech/XUL/XUL_Tutorial/More_Event_Handlers -tags: - - XUL - - XUL_Tutorial -translation_of: Archive/Mozilla/XUL/Tutorial/More_Event_Handlers ---- -

 

-

-

« 이전다음 »

-

-

이번 단원에서는 이벤트 객체에 대해 검토해보고, 추가적인 이벤트들에 대해 설명하겠습니다.

-

이벤트 객체

-

각 이벤트 핸들러는 event 객체가 저장된 하나의 인자를 가집니다. 속성 형식의 이벤트 리스너에서의 이벤트 객체는 명시하지 않더라도 스크립트 코드에서 'event'라는 이름으로 참조할 수 있습니다. addEventListener 형태일 경우에는 리스너 함수의 첫 번째 인자가 이벤트 객체가 됩니다. 이벤트 객체에는 이벤트가 처리되는 동안 사용할 수 있는 많은 속성이 있습니다. 전체 목록은 XULPlanet object reference에서 보실 수 있습니다.

-

우리는 지난 단원에서 이벤트의 target 속성에 대해 알아 보았습니다. 이 속성은 이벤트가 발생한 대상 요소에 대한 참조를 가지고 있습니다. 이와 유사한 currentTarget 속성은 현재 이벤트 리스너가 처리하고 있는 대상 요소에 대한 참조를 가집니다. 아래 예제에서 target 속성은 활성화된 버튼이나 체크박스 중 하나에 대한 참조인 반면 currentTarget 속성은 항상 vbox가 됩니다.

-

예제 1 : Source View

-
<vbox oncommand="alert(event.currentTarget.tagName);">
-  <button label="OK"/>
-  <checkbox label="Show images"/>
-</vbox>
-
-

이벤트 전파 중지

-

일단 이벤트를 처리하였으면, 이벤트의 전파 단계 중 어디에 있는지에 상관없이, 이벤트의 버블링이나 캡처 단계를 중지하여 다른 요소들로 이벤트가 전파되는 것을 막고자 할때가 있을 것입니다. 이는 이벤트 핸들러를 대상 요소에 어떻게 부착했는지에 따라 그 방법이 달라집니다.

-

캡처 단계는 버블링 단계 이전에 발생한다고 했던 것을 기억하세요. 그렇게 때문에 캡처 단계에서 실행되는 리스너는 버블 단계의 리스너보다 먼저 실행됩니다. 만일 캡처 단계에서 이벤트 전파가 중지된다면, 이후에 발생할 수 있는 캡처 리스너나 버블링 리스너는 해당 이벤트에 대해 아무런 알림도 받지 못하게 됩니다. 이벤트 전파를 막기 위해서는 다음 예제와 같이 이벤트 객체의 stopPropagation 메소드를 호출하면 됩니다.

-

예제 2 : Source View

-
<hbox id="outerbox">
-  <button id="okbutton" label="OK"/>
-</hbox>
-
-<script>
-function buttonPressed(event){
-  alert('Button was pressed!');
-}
-
-function boxPressed(event){
-  alert('Box was pressed!');
-  event.stopPropagation();
-}
-
-var button = document.getElementById("okbutton");
-button.addEventListener('command',buttonPressed,true);
-
-var outerbox = document.getElementById("outerbox");
-outerbox.addEventListener('command',boxPressed,true);
-</script>
-
-

예제에서, 한 이벤트 리스너는 버튼에 또 다른 이벤트 리스너는 상자에 추가되었습니다. stopPropagation 메소드는 상자의 리스너에서 호출되므로, 버튼의 리스너는 절대 호출되지 않습니다. 만일 이 메소드가 제거되면 모든 리스너가 호출되고 2개의 알림창(alert)이 나타날 것입니다.

-

기본 행위 막기

-

어떤 요소에 아무런 이벤트 핸들러도 등록되어 있지 않다면, 캡처와 버블링 단계가 다 끝난후에 내장된(default) 방법으로 이벤트가 처리됩니다. 이 내장된 방법은 이벤트와 대상 요소의 종류에 따라 다릅니다. 예를 들어 'popupshowing' 이벤트는 팝업이 출력되기 전에 전달받는 이벤트이며, 기본(default) 동작은 팝업을 출력하는 것입니다. 만일 기본 동작이 일어나지 않도록 하면, 팝업은 출력되지 않을 것입니다. 기본 동작은 이벤트 객체의 preventDefault 메소드로 막을 수 있으며, 아래의 예제와 같습니다.

-

예제 3 : Source View

-
<button label="Types" type="menu">
-  <menupopup onpopupshowing="event.preventDefault();">
-    <menuitem label="Glass"/>
-    <menuitem label="Plastic"/>
-  </menupopup>
-</button>
-
-

속성 형태로 작성된 이벤트 리스너에서는 해당 코드에서 false값을 반환하도록 해서 기본 행위를 막을 수 있는 방법도 있습니다. 기본 동작을 막는 것은 stopPropagation 메소드로 이벤트 전파를 막는 것과는 다르다는 사실을 알아두세요. 기본 행위가 막혀 있더라도, 이벤트는 계속 진행됩니다. 마찬가지로, stopPropagation 메소드를 호출한다고 해서 기본 동작이 실행되지 않는 것은 아닙니다. 여러분은 두 동작을 모두 실행되지 않게 하기 위해서는 두 메소드 모두 호출해야 합니다.

-

일단 이벤트 전파나 기본 동작을 막았다면 다음 이벤트에서도 동일하게 동작할 것입니다.

-

다음 단원의 내용은 자주 사용되는 몇가지 이벤트 목록입니다. 전체 목록은 XULPlanet event reference를 참조하세요.

-

마우스 이벤트

-

마우스만의 동작을 처리하는데 사용되는 여러가지 이벤트가 있으며, 간략한 설명은 아래와 같습니다.

-
-
- click 
-
- 마우스로 대상 요소를 클릭했을때(버튼을 눌렀다 땔때) 호출됩니다.
-
-
-
- dblclick 
-
- 마우스 버튼을 더블클릭했을때 호출됩니다.
-
-
-
- mousedown 
-
- 마우스 버튼이 대상 요소에 눌러졌을때 호출됩니다. 이벤트 핸들러는 마우스 버튼이 눌러지면 떨어지지 않더라도 호출됩니다.
-
-
-
- mouseup 
-
- 마우스 버튼이 떨어질때 호출됩니다.
-
-
-
- mouseover 
-
- 마우스 포인터가 요소위로 움직이면 호출됩니다. 이 이벤트는 요소를 강조(highlight)하기 위해서 사용할 수 있지만, CSS에서 이런 것을 자동으로 처리하므로 이벤트로 처리할 필요는 없습니다. 그래도 상태바에 몇 가지 도움말을 제공하고자 할 때 사용할 수 있습니다.
-
-
-
- mousemove 
-
- 마우스 포인터가 요소 위에서 움직이면 호출됩니다. 이 이벤트는 마우스를 움직임에 따라 자주 호출될 수 있기 때문에 긴 시간이 걸리는 작업을 이 핸들러에서 수행하도록 하는 것은 바람직하지 않습니다.
-
-
-
- mouseout 
-
- 마우스 포인터가 대상 요소의 밖으로 나갈 때 호출됩니다. 강조된 대상 요소를 원래데로 바꾸거나 상태바의 텍스트를 제거할 때 사용할 수 있습니다.
-
-

이것들 외에도 드래그와 관련된 이벤트들이 있으며 이는 사용자가 마우스 버튼을 누른 상태에서 주위로 끌 때 발생합니다. 이러한 이벤트들에 대해서는 Drag and Drop에서 설명하겠습니다.

-

마우스 버튼 이벤트 속성

-

마우스 버튼 이벤트가 발생하면, 어떤 마우스 버튼이 눌러졌는지와 마우스 포인터의 위치가 어디인지를 확인할 수 있는 속성을 사용할 수 있습니다. 이벤트의 button 속성은 어떤 버튼이 눌러졌는지를 나타내는 속성으로, 왼쪽 버튼은 0, 오른쪽 버튼은 1, 가운데 버튼은 2의 값을 가집니다. 마우스의 버튼이 다르게 설정되었다면 값이 달라질 수 있습니다.

-

detail 속성은 버튼이 빠른 시간 내 순차적으로 클릭된 횟수를 저장합니다. 이 속성을 이용해서 한번 클릭인지, 더블 클릭인지 혹은 3회 클릭인지를 확인할 수 있습니다. 물론 더블 클릭만 확인하고자 하면 dblclick 이벤트를 사용할 수 있습니다. click 이벤트가 첫 번째 클릭에 의해 발생하고 두번째 클릭, 세번째 클릭 각각에 대해 이벤트가 발생하지만 dblclick 이벤트는 더블 클릭시 한번만 발생합니다.

-

buttondetail 속성은 마우스 버튼과 관련된 이벤트에만 해당됩니다. 마우스의 움직임과 관련된 이벤트에서는 해당 속성값이 0으로 설정될 것입니다.

-

마우스 위치 관련 이벤트 속성

-

그러나 모든 마우스 이벤트에는 이벤트가 발생한 마우스 위치 좌표를 저장하는 속성이 있습니다. 이 속성에는 두 가지 종류의 좌표가 있습니다. 첫 번째는 screenXscreenY 속성으로 화면의 좌상단에 상대적인 좌표입니다. 두 번째는 clientXclientY로 문서의 좌상단에 상대적인 좌표입니다. 다음은 현재의 마우스 좌표를 출력하는 예제입니다.

-

예제 4 : Source View

-
<script>
-
-function updateMouseCoordinates(event){
-  var text = "X:" + event.clientX + " Y:" + event.clientY;
-  document.getElementById("xy").value = text;
-}
-</script>
-
-<label id="xy"/>
-<hbox width="400" height="400" onmousemove="updateMouseCoordinates(event);"/>
-
-

예제에서는 상자의 크기를 명시적으로 지정했기 때문에 효과를 좀더 쉽게 볼 수 있습니다. 이벤트 핸들러는 clientXclientY 속성값을 얻어 문자열을 만들었습니다. 그리고 이 문자열을 라벨의 value 속성에 할당했습니다. updateMouseCoordinates 함수의 인자로 event가 넘어오는 것을 기억하세요. 만일 상자의 경계을 넘어 빠르게 마우스가 이동한다면, 아마 마우스 좌표가 400에 정확히 멈추지 않는 것을 알게 될것입니다. 이것은 mousemove 이벤트가 일정한 간격으로 발생하며, 다음 이벤트가 발생하기 전에 마우스의 위치가 밖으로 빠져나갔기 때문입니다. 당연히 마우스가 움직이는 매 픽셀마다 mousemove 이벤트가 전송된다면 너무 비효율적일 것입니다.

-

요소에 상대적인 좌표

-

여러분은 전체 창이 아닌 이벤트가 발생한 요소에 상대적인 좌표(요소 내에서의 좌표)를 얻고자 할때가 있을 것입니다. 이는 이벤트의 위치에서 요소의 위치를 빼주면 얻을 수 있으며 코드는 다음과 같습니다.

-
var element = event.target;
-var elementX = event.clientX - element.boxObject.x;
-var elementY = event.clientY - element.boxObject.y;
-
-

XUL 요소들에는 boxObject라는 속성을 사용해서 얻을 수 있는 상자 객체가 있습니다. 상자 객체에 대해서는 이후 단원에서 배우겠지만, 간단히 말해서 이 객체는 요소가 출력되는 방법에 대한 정보(요소의 x, y 좌표등)를 가지고 있다고 보면 됩니다. 예제 코드에서는 요소 기준의 이벤트 좌표를 얻기 위해 이벤트 좌표에서 상자 객체의 좌표를 뺐습니다.

-

로드(load) 이벤트

-

로드 이벤트는 XUL 파일의 로딩이 완료되고 내용이 출력되기 직전에 문서(window 태그)로 전송됩니다. 이 이벤트는 일반적으로 변수들을 초기화하고 사용자가 창을 사용할 수 있기 전에 해야 할 일들을 처리하는데 사용됩니다. 여러분은 이러한 초기화 작업을 함수 외부의 최상위 레벨 스크립트로 처리하는 것보다는 로드 이벤트를 사용하는 것이 좋습니다. 이것은 XUL 요소들이 로드되지 않았거나 초기화되지 않았을수도 있기 때문이며, 따라서 어떤 것들은 원하는데로 동작하지 않을 수 있습니다. 로드 이벤트를 사용하려면 window 태그에 onload 속성을 넣으면 됩니다. 초기화를 필요로 하는 것들은 로드 이벤트 핸들러에서 호출하세요.

-

또한 창이 닫힐 때 혹은 브라우저의 관점에서는 페이지가 다른 URL로 넘어갈 때 발생하는 언로드(unload) 이벤트가 있습니다. 이 이벤트는 창이 닫히기 전 변경된 정보를 저장하는 것과 같은 용도로 사용할 수 있습니다.

-

다음에는 단축키를 추가하는 방법에 대해 알아보겠습니다.

-

-

« 이전다음 »

-

-

diff --git a/files/ko/mozilla/tech/xul/xul_tutorial/more_menu_features/index.html b/files/ko/mozilla/tech/xul/xul_tutorial/more_menu_features/index.html deleted file mode 100644 index 897dbaa148..0000000000 --- a/files/ko/mozilla/tech/xul/xul_tutorial/more_menu_features/index.html +++ /dev/null @@ -1,109 +0,0 @@ ---- -title: More Menu Features -slug: Mozilla/Tech/XUL/XUL_Tutorial/More_Menu_Features -tags: - - XUL - - XUL_Tutorial -translation_of: Archive/Mozilla/XUL/Tutorial/More_Menu_Features ---- -

 

-

-

« 이전다음 »

-

-

이번 단원에서는 하위 메뉴와 체크 메뉴를 만드는 방법을 알아 보겠습니다.

-

하위 메뉴 만들기

-

여러분은 기존에 있는 요소들을 사용하여 다른 메뉴 내에 있는 서브메뉴(중첩 메뉴)를 만들 수 있습니다. menupopup안에는 어떤 요소든 넣을 수 있다는 것을 기억해보세요. 지난 단원에서는 menupopup안에 menuitemmenuseparator를 넣는 방법을 알아 보았습니다. 그러나 여러분은 menupopup 요소내에 menu를 넣기만 하면 하위 메뉴를 만들 수 있습니다. 이것은 menu 요소가 꼭 메뉴바의 바로 아래에 있지 않더라도 유효한 것이기 때문에 동작하게 됩니다. 아래는 File 메뉴내에 간단한 하위 메뉴가 존재하는 예제입니다.

-

예제 1 : Source View

-
- Image:menubar-ex3.png
-
<toolbox flex="1">
-  <menubar id="sample-menubar">
-    <menu id="file-menu" label="File">
-      <menupopup id="file-popup">
-        <menu id="new-menu" label="New">
-          <menupopup id="new-popup">
-            <menuitem label="Window"/>
-            <menuitem label="Message"/>
-          </menupopup>
-        </menu>
-        <menuitem label="Open"/>
-        <menuitem label="Save"/>
-        <menuseparator/>
-        <menuitem label="Exit"/>
-      </menupopup>
-    </menu>
-  </menubar>
-</toolbox>
-
-
-

우리의 파일 찾기 예제에 메뉴 추가하기

-

이제 파일 찾기 대화창에 메뉴를 넣어 봅시다. 우리는 File 메뉴와 Edit 메뉴에 간단한 명령 몇 가지를 넣을 것입니다. 이 방법은 위의 예제와 비슷합니다.

-
<toolbox>
-
- <menubar id="findfiles-menubar">
-  <menu id="file-menu" label="File" accesskey="f">
-    <menupopup id="file-popup">
-      <menuitem label="Open Search..." accesskey="o"/>
-      <menuitem label="Save Search..." accesskey="s"/>
-      <menuseparator/>
-      <menuitem label="Close" accesskey="c"/>
-    </menupopup>
-  </menu>
-  <menu id="edit-menu" label="Edit" accesskey="e">
-    <menupopup id="edit-popup">
-      <menuitem label="Cut" accesskey="t"/>
-      <menuitem label="Copy" accesskey="c"/>
-      <menuitem label="Paste" accesskey="p" disabled="true"/>
-    </menupopup>
-  </menu>
- </menubar>
-
-<toolbar id="findfiles-toolbar>
-
-
- Image:menubar1.png
-

여기서 여러개의 명령을 가진 두 개의 메뉴를 만들었습니다. 툴박스 내에 어떻게 메뉴바가 추가되었는지를 유심히 보세요. Open Search와 Save Search 뒤에 불은 세 개의 점은 사용자가 해당 명령을 선택할 때 대화창이 열릴것이라는 것을 알려주는 일반적인 방법입니다. 각 메뉴와 메뉴 항목에는 접근글쇠(Access key)가 지정되어 있습니다. 그림을 보면 지정된 글자가 메뉴 제목에 밑줄로 표시된 것을 알 수 있습니다. 또 붙이기(Paste) 명령은 현재 사용불가 상태입니다. 우리는 아무 것도 붙일 것이 없다고 가정할 것입니다.

-

지금까지의 파일 찾기 예제 : Source View

-
-

메뉴에 체크 표시 넣기

-

많은 프로그램들에서는 체크할 수 있는 메뉴를 사용합니다. 예를 들어 현재 사용하고 있는 기능은 명령 옆에 체크가 있고 그렇지 않은 기능은 체크가 없는 메뉴 같은 것입니다. 사용자가 메뉴를 선택하면 체크 상태가 바뀝니다. 또 메뉴 항목에 라디오 버튼을 넣고 싶을 때도 있을 것입니다.

-

체크 메뉴를 만드는 방법은 checkboxradio를 만드는 방법과 비슷합니다. 이를 위해서는 두 개의 속성이 필요한데, type 속성은 체크의 형식을 지정할 때, name 속성은 관련된 명령을 하나로 묶을 때 사용합니다. 아래는 체크 항목을 가진 메뉴를 만드는 예제입니다.

-

예제 2 : Source View

-
<toolbox>
-  <menubar id="options-menubar">
-    <menu id="options_menu" label="Options">
-      <menupopup>
-        <menuitem label="Make Backups" type="checkbox"/>
-        <menuitem label="Email Administrator" type="checkbox" checked="true"/>
-      </menupopup>
-    </menu>
-  </menubar>
-</toolbox>
-
-

메뉴 항목이 체크될 수 있도록 type 속성이 추가되었습니다. 해당 속성값을 checkbox로 설정하면 메뉴 항목을 클릭할 때마다 체크가 설정/해제됩니다.

-

라디오버튼이 있는 메뉴

-

일반 체크 외에도 type 속성의 값을 radio로 지정하면 라디오 형식의 체크를 만들 수 있습니다. 라디오 체크는 한 그룹의 메뉴 항목 중 하나만 선택할 수 있도록 만들 때 사용됩니다. 예를 들면 한번에 하나의 글꼴만 선택할 수 있는 글꼴 메뉴 같은 것입니다. 이 때 다른 항목이 선택되면 이전에 선택되었던 항목은 체크가 해제됩니다.

-

여러 개의 메뉴 항목을 하나의 그룹으로 묶을 때는 각 메뉴 항목의 name 속성을 같은 값으로 지정하면 됩니다. 아래 예제를 보겠습니다.

-

예제 3 : Source View

-
<toolbox>
-  <menubar id="planets-menubar">
-    <menu id="planet-menu" label="Planet">
-      <menupopup>
-        <menuitem id="jupiter" label="Jupiter" type="radio" name="ringed"/>
-        <menuitem id="saturn" label="Saturn" type="radio" name="ringed" checked="true"/>
-        <menuitem id="uranus" label="Uranus" type="radio" name="ringed"/>
-        <menuseparator/>
-        <menuitem id="earth" label="Earth" type="radio" name="inhabited" checked="true"/>
-        <menuitem id="moon" label="Moon" type="radio" name="inhabited"/>
-      </menupopup>
-    </menu>
-  </menubar>
-</toolbox>
-
-

예제를 실행시키면, 처음 세 개의 메뉴 항목 중 한 가지만 선택할 수 있다는 것을 알게 될 것입니다. 이 메뉴 항목들은 모두 동일한 name 속성값을 가지고 있기 때문에 하나의 그룹으로 엮인 것입니다. 마지막 메뉴 항목인 Earth는 라디오 메뉴이지만 name 속성값이 다르기 때문에 그 무리에 속하지 않습니다.

-

물론 하나의 그룹 항목들은 모두 동일한 메뉴 안에 있어야 합니다. 꼭 붙어 있어야 할 필요는 없지만, 상식적으로 생각할 때 서로 붙어 있는 것이 좋을 것입니다.

-

다음 단원에서는 팝업 메뉴를 작성하는 방법에 대해 알아보겠습니다.

-

-

« 이전다음 »

-

-

diff --git a/files/ko/mozilla/tech/xul/xul_tutorial/popup_menus/index.html b/files/ko/mozilla/tech/xul/xul_tutorial/popup_menus/index.html deleted file mode 100644 index a3062b42d7..0000000000 --- a/files/ko/mozilla/tech/xul/xul_tutorial/popup_menus/index.html +++ /dev/null @@ -1,190 +0,0 @@ ---- -title: Popup Menus -slug: Mozilla/Tech/XUL/XUL_Tutorial/Popup_Menus -tags: - - XUL - - XUL_Tutorial -translation_of: Archive/Mozilla/XUL/Tutorial/Popup_Menus ---- -

 

-

-

« 이전다음 »

-

-

이전 단원에서는 메뉴바에 들어가는 메뉴를 만드는 방법에 대해 알아보았습니다. XUL은 팝업 메뉴를 만들 수 있는 능력도 가지고 있습니다. 팝업 메뉴는 대개 오른쪽 마우스 버튼을 누를 때 표시됩니다.

-

팝업 메뉴 만들기

-

XUL은 아래에서 설명하는 3가지 다른 형태의 팝업이 있습니다. 주된 차이는 표시되는 방식에 있습니다.

-
-
- 일반 팝업(Plain Popups)
-
- 일반 팝업은 대상 요소에 마우스 왼쪽 버튼을 클릭하였을 때 나타나는 팝업창입니다. 일반 팝업은 어디에나 위치할 수 있으며, 어떤 내용이든 담을 수 있다는 점을 제외하고 메뉴바에 있는 메뉴와 아주 비슷합니다. 브라우저 창에서 뒤로와 앞으로 가기 버튼 옆에 있는 조그만 아래방향 화살표를 눌렀을 때 나타나는 드롭 다운 메뉴가 이의 좋은 예입니다.
-
-
-
- 문맥 팝업(Context Popups)
-
- 문맥 팝업은 사용자가 문맥 메뉴 버튼(대개 마우스 오른쪽 버튼)을 누를 때 나타나는 팝업창입니다. 일부 플랫폼에서는 다른 버튼일 수도 있지만, 이것은 항상 문맥전용 메뉴를 호출하는 버튼 또는 키와 마우스의 조합입니다. 예를 들어 맥킨토시에서는 사용자가 제어키(Ctrl)를 누르고 마우스 버튼을 클릭하거나, 잠깐 동안 마우스 버튼을 누르고 있어야 합니다.
-
-
-
- 툴팁(Tooltips)
-
- 툴팁 팝업창은 사용자가 어떤 요소위에 마우스를 올렸을 때 나타납니다. 이런 유형의 팝업은 보통 버튼 자체에서 제공되는 것보다 좀더 구체적인 버튼에 대한 설명을 제공하는 데 사용됩니다.
-
-

이들 세 가지 유형의 팝업은 사용자가 이것들을 호출하는 방식이 서로 다릅니다. 그래서 팝업 유형은 팝업을 호출하는 요소에 의해 결정됩니다.

-

팝업 내용 선언하기

-

팝업은 menupopup 요소를 사용하여 선언됩니다. 이는 특별한 속성이 없는 상자의 한 유형입니다. 팝업이 호출되면, 여러분이 menupopup에 넣은 모든 요소를 포함하는 창이 화면에 출력될 것입니다. 여러분은 menupopupid 속성을 항상 넣어주어야 합니다. 이것은 이 속성이 팝업과 특정 요소를 연결하는데 사용되기 때문인데, 이 의미에 대해서는 곧 알게될 것입니다. 먼저, 예제를 보겠습니다.

-
<popupset>
-  <menupopup id="clipmenu">
-    <menuitem label="Cut"/>
-    <menuitem label="Copy"/>
-    <menuitem label="Paste"/>
-  </menupopup>
-</popupset>
-
-

여기서 볼 수 있듯이, 3개의 메뉴가 있는 단순 팝업메뉴가 만들어졌습니다. menupopup 요소는 3개 메뉴 항목을 둘러싸고 있습니다. 여러분은 id 속성이 menupopup 요소 자체에 설정된 것을 볼 수 있습니다.

-

popupset 요소는 전체 팝업메뉴 선언부를 둘러싸고 있습니다. 이 요소는 팝업의 일반적인 컨테이너로 선택사항입니다. 이 요소는 화면에 나타나지는 않지만 사용할 모든 팝업들을 선언할 위치 역할로 사용됩니다. popupset이라는 이름이 의미하듯, 내부에 여러개의 팝업을 선언할 수 있습니다. 첫 번째 popup 요소 다음에 그냥 추가하기만 하면 됩니다. 하나의 파일에 여러개의 popupset을 둘 수도 있지만, 대개는 하나만 존재할 것입니다.

-

요소와 팝업을 연결하기

-

이제 팝업을 만들었으니 팝업이 나타나도록 해야할 시간입니다. 이를 위해 팝업과 팝업이 나타날 요소를 연결시켜야 합니다. 이렇게 하는 것은 사용자가 창의 어떤 영역을 클릭했을 때만 팝업이 나타나야 하기 때문입니다. 대개, 이 요소는 특정 버튼이거나 상자가 됩니다.

-

팝업을 요소와 연결시키려면 3가지 속성 중 하나를 해당 요소에 추가하면 됩니다. 추가할 요소는 만들고자 하는 팝업의 종류에 따라 달라집니다. 일반 팝업의 경우에는 해당 요소에 popup 속성을 사용하고, 문맥 팝업은 context 속성을 사용합니다. 마지막으로 툴팁 팝업은 tooltip 속성을 사용합니다.

-

위의 속성에는 출력하고자 하는 menupopupid 속성값을 지정해야 합니다. 보통 하나의 파일이 여러개의 팝업을 포함하는 이유가 이 때문입니다.

-

위의 예제를 이용해 문맥 팝업을 만들고자 합니다. 이것은 context 속성을 사용해야 하며, 연결하고자 하는 팝업의 id 속성값을 이 속성값으로 지정해야 한다는 것을 의미합니다. 아래 예제는 이러한 사항을 어떻게 처리할 수 있는 지를 보여주고 있습니다.

-

예제 1 : Source View

-
- Image:popups-ex1.png
-
<popupset>
-  <menupopup id="clipmenu">
-    <menuitem label="Cut"/>
-    <menuitem label="Copy"/>
-    <menuitem label="Paste"/>
-  </menupopup>
-</popupset>
-
-<box context="clipmenu">
-  <label value="Context click for menu"/>
-</box>
-
-

여기서 팝업은 상자와 연결되었습니다. 상자 어디서든 문맥 클릭(context-click, 오른쪽 클릭)을 하면 팝업메뉴가 나타날 것입니다. 또한 상자의 자식 요소를 클릭할 때도 팝업이 나타나기 때문에 label 요소를 클릭해도 동일하게 동작할 것입니다. context 속성은 상자와 해당 id를 가진 팝업을 연결하기 위해 사용되었습니다. 이 경우, idclipmenu인 팝업이 나타날 것입니다. 이런 식으로 수많은 팝업을 가질 수 있으며, 이들을 다른 요소와 연결할 수 있습니다.

-

여러분은 하나의 요소에 다른 종류의 팝업 속성을 설정하여 여러개의 팝업과 연결할 수 있습니다. 또 하나의 팝업을 여러개의 요소에도 연결할 수 있는데 이는 XUL의 팝업 구문이 가진 장점 중 하나입니다. 팝업은 XUL 요소에만 연결할 수 있으며, HTML 요소와는 연결할 수 없습니다.

-

툴팁

-

여기서는 툴팁을 만드는 단순한 방법을 살펴보겠습니다. 툴팁을 만드는데는 두 가지 방법이 있습니다. 일반적으로 사용되는 가장 단순한 방법은 툴팁을 적용하고자 하는 요소에 tooltiptext 속성을 추가하는 것입니다.

-

두 번째 방법은 툴팁의 내용을 담고 있는 tooltip 요소를 사용하는 것입니다. 이 방법은 각각의 툴팁 내용을 포함하는 별도의 블록 또는 내용을 설정하는 스크립트의 작성을 필요로 합니다. 그러나 이러한 방법을 이용하면 툴팁에 텍스트 외에도 어떠한 내용도 사용할 수 있는 장점이 있습니다.

-

예제 2 : Source View

-
<button label="Save" tooltiptext="Click here to save your stuff"/>
-
-<popupset>
-  <tooltip id="moretip" orient="vertical" style="background-color: #33DD00;">
-    <description value="Click here to see more information"/>
-    <description value="Really!" style="color: red;"/>
-  </tooltip>
-</popupset>
-
-<button label="More" tooltip="moretip"/>
-
-

이 2개의 버튼은 각각 툴팁을 가지고 있습니다. 첫 번째는 기본 툴팁 방식을, 두 번째는 다른 배경색과 서식이 적용된 텍스트로 구성된 커스텀 툴팁을 사용하고 있습니다. 툴팁은 More 버튼과 연결되어 있으며, 이를 위해 버튼의 tooltip 속성에 해당 tooltip 요소의 id 속성값이 설정되어 있습니다. 여기서 tooltip 요소는 다른 팝업 유형처럼 popupset 내부에 위치하고 있다는 점에 유의하세요.

-

팝업 정렬

-

기본적으로, 팝업과 문맥 창은 마우스 포인터가 위치한 곳에 나타납니다. 툴팁은 해당 요소의 약간 아래 위치하는데, 이는 마우스 포인터가 이를 가리지 않게 하기 위해서 입니다. 그렇다 하더라, 팝업이 나타날 위치를 좀 더 상세히 지정하고 싶은 경우가 있을 것입니다. 예를 들어, 브라우저의 뒤로 가기 버튼을 클릭했을 때 나타나는 팝업 메뉴는 마우스 포인터가 있는 곳이 아닌, 뒤로 가기 버튼 바로 아래 나타나도록 하는 것이 좋을 것입니다.

-

팝업 위치를 변경하기 위해서는 popup 요소에 position이라는 또 다른 속성을 사용할 수 있습니다. 또한 menupopup 요소에도 이를 추가할 수 있습니다. 이 속성은 팝업을 발생시키는 요소에 상대적인 팝업 위치를 지시하는 데 사용됩니다. 여러가지 값을 설정할 수 있으며, 각각을 간단히 설명하면 아래와 같습니다.

-
-
- after_start
-
- 팝업은 요소의 아래에 왼쪽으로 정렬되어 나타납니다(팝업의 왼쪽 = 요소의 왼쪽, 팝업의 위 = 요소의 아래). 해당 팝업창이 요소보다 큰 경우, 오른쪽으로 확장됩니다. 이것은 브라우저의 뒤로와 앞으로 가기 버튼과 연결된 드롭다운 메뉴에 사용되는 값입니다.
-
-
-
- after_end
-
- 팝업창은 요소의 아래에 오른쪽으로 정렬되어 나타납니다(팝업의 오른쪽 = 요소의 오른쪽, 팝업의 위 = 요소의 아래).
-
-
-
- before_start
-
- 팝업창은 요소의 위쪽에 왼쪽으로 정렬되어 나타납니다(팝업의 왼쪽 = 요소의 왼쪽, 팝업의 아래 = 요소의 위).
-
-
-
- before_end
-
- 팝업창은 요소의 위쪽에 오른쪽으로 정렬되어 나타납니다(팝업의 오른쪽 = 요소의 오른쪽, 팝업의 아래 = 요소의 위).
-
-
-
- end_after
-
- 팝업은 요소의 오른쪽에 아래쪽으로 정렬되어 나타납니다(팝업의 왼쪽 = 요소의 오른쪽, 팝업의 아래 = 요소의 아래).
-
-
-
- end_before
-
- 팝업은 요소의 오른쪽에 위쪽으로 정렬되어 나타납니다(팝업의 왼쪽 = 요소의 오른쪽, 팝업의 위 = 요소의 위).
-
-
-
- start_after
-
- 팝업은 요소의 왼쪽에 아래쪽으로 정렬되어 나타납니다(팝업의 오른쪽 = 요소의 왼쪽, 팝업의 아래 = 요소의 아래).
-
-
-
- start_before
-
- 팝업은 요소의 왼쪽에 위쪽으로 정렬되어 나타납니다(팝업의 오른쪽 = 요소의 왼쪽, 팝업의 위 = 요소의 위).
-
-
-
- overlap
-
- 팝업은 요소의 위에 나타납니다(요소의 왼쪽 위 = 팝업의 왼쪽 위).
-
-
-
- at_pointer
-
- 팝업은 마우스 포인터 위치에 나타납니다.
-
-
-
- after_pointer
-
- 팝업은 마우스 포인터와 가로 위치는 같으면서 세로 위치는 마우스 포인터 아래 부분에 나타납니다. 이것은 툴팁이 나타나는 방식입니다.
-
-

팝업 요소에 position 속성을 추가함으로써 팝업이 나타날 위치를 정확하게 지정할 수 있습니다. 그러나 정확한 픽셀 위치를 지정할 수는 없습니다. 아마도 툴팁 요소에 대한 이 속성값은 변경하려고 하지 않겠지만, position 속성은 세 가지 팝업 유형 모두에 사용될 수 있습니다. 아래 예제는 팝업 메뉴를 가진 뒤로가기 버튼을 만드는 것을 보여주는 것입니다.

-

예제 3 : Source View

-
<popupset>
-  <menupopup id="backpopup" position="after_start">
-    <menuitem label="Page 1"/>
-    <menuitem label="Page 2"/>
-  </menupopup>
-</popupset>
-
-<button label="Pop Me Up" popup="backpopup"/>
-
-
-

Our find files example

-

파일 찾기 대화창에 간단한 팝업 메뉴를 추가해 보겠습니다. 단순하게 하기 위해, Edit 메뉴의 내용을 그냥 복사했습니다. 첫 번째 탭 패널위에서 클릭했을 때 팝업이 나타나도록 해 봅시다.

-
<popupset>
-  <menupopup id="editpopup">
-    <menuitem label="Cut" accesskey="t"/>
-    <menuitem label="Copy" accesskey="c"/>
-    <menuitem label="Paste" accesskey="p" disabled="true"/>
-  </menupopup>
-</popupset>
-
-<vbox flex="1">
-.
-.
-.
-
-<tabpanel id="searchpanel" orient="vertical" context="editpopup">
-
-

여기에 있는 eidt 메뉴와 유사한 단순 팝업이 첫 번째 탭패널에 추가되었습니다. 첫 번째 패널 어디서든 마우스 오른쪽 버튼을 클릭하면(맥킨토시에서는 Ctrl-클릭), 팝업이 나타날 것입니다. 그러나 해당 팝업은 그 이외 장소에서 클릭하면 나타나지 않을 것입니다. 주의할 사항은 글상자의 경우 자체 내장 팝업메뉴가 있어서 우리가 지정한 팝업 메뉴가 나타나지 않을 것입니다.

-

지금까지의 파일 찾기 예제 : Source View

-
-

다음 단원에서는 스크롤 메뉴를 작성하는 방법에 대해 알아보겠습니다.

-

-

« 이전다음 »

-

-

diff --git a/files/ko/mozilla/tech/xul/xul_tutorial/progress_meters/index.html b/files/ko/mozilla/tech/xul/xul_tutorial/progress_meters/index.html deleted file mode 100644 index 2593628bfa..0000000000 --- a/files/ko/mozilla/tech/xul/xul_tutorial/progress_meters/index.html +++ /dev/null @@ -1,59 +0,0 @@ ---- -title: Progress Meters -slug: Mozilla/Tech/XUL/XUL_Tutorial/Progress_Meters -tags: - - XUL - - XUL_Tutorial -translation_of: Archive/Mozilla/XUL/Tutorial/Progress_Meters ---- -

-

« 이전다음 »

-

-

본 섹션에서는 진행 지시자를 생성하는 방법에 대해 알아보겠습니다.

-

진행 지시자 추가하기

-

진행 지시자는 작업이 얼마나 진행되었는지를 나타내는 막대입니다. 여러분은 보통 파일을 다운로드 받을때나 시간이 긴 작업이 진행될 때 보실 수 있습니다. XUL에서는 이러한 진행 지시자를 생성하기 위해 progressmeter 요소를 사용합니다. 진행 지시자에는 결정(determinate)과 미결정(undeterminate)의 두가지 종류가 있습니다.

-

결정 진행 지시자는 어떠한 작업이 수행될 전체 시간의 길이를 알고 있을 때 사용합니다. 진행 지시자는 점점 차게 되고 다 차게 되면 작업이 완료되었음을 나타냅니다. 이러한 진행 지시자는 파일의 크기를 알고 있는 다운로드 대화상자의 경우에 사용할 수 있습니다.

-

미결정 진행 지시자는 작업이 수행될 전체 시간 길이를 모를때 사용합니다. 진행 지시자는 사용중인 플랫폼이나 테마에 따라, 회전하는 이발소 간판(barbaer pole)이나 미끄러지는 상자와 같은 에니메이션으로 표시됩니다.

-

결정 진행 지시자: Image:prog-det.png

-

미결정 진행 지시자: Image:prog-udet.png

-

진행 지시자는 다음과 같은 구문으로 표현됩니다.:

-
<progressmeter
-    id="identifier"
-    mode="determined"
-    value="50%"/>
-
-

속성은 다음과 같습니다.

-
-
- id 
-
- 진행 지시자의 유일 식별자 입니다.
-
- mode
-
- 진행 지시자의 유형을 나타냅니다. 만일 determined로 지정하면 결정 진행 지시자를 의미하는 것으로 작업이 진행됨에 따라 채워지게 됩니다. 만일 undetermined로 지정하면 미결정 진행 지시자를 나타내는 것으로 작업이 진행될 시간을 모르는 경우에 사용됩니다. 본 속성을 지정하지 않은 경우에는 determined가 기본값입니다.
-
- value 
-
- 진행 지시자의 현재값을 나타내며, 결정 진행 지시자일 경우에만 사용할 수 있습니다. 값은 0에서 100사이의 백분률(퍼센트)로 입력해야 합니다. 보통은 작업이 진행됨에 따라 스크립트로 변경하게 됩니다.
-
-
-
파일 찾기 예제
-

우리의 파일 찾기 대화상자에 진행 지시자를 추가해 보겠습니다. 파일 찾기에서는 얼마나 많은 파일이 검색될지, 검색 시간이 얼마나 걸릴지 모르기 때문에 보통 미결정 진행 지시자를 사용합니다. 그러나 개발단계에서는 좀 혼란스러울 수 있으므로, 여기서는 결정 진행 지시자를 추가하겠습니다. 진행 지시자는 보통 검색이 진행중인 때만 나타납니다. 진행 지시자를 켜고 끄기 위한 스크립트는 나중에 추가하겠습니다.

-
<hbox>
-
-  <progressmeter value="50%" style="margin: 4px;"/>
-
-  <spacer flex="1"/>
-</hbox>
-
-

창에서 계기값을 볼 수 있도록 value를 50%로 설정하였습니다. 창의 가장자리와 구분하기 위해 지시자의 여백을 4픽셀로 설정하였습니다. 앞서 말씀드린 바와 같이, 우리는 검색이 수행될 동안만 진행 바가 표시되기를 원합니다. 필요에 따라 스크립트가 보이거나 숨길 것입니다.

-

여태까지의 예제입니다. Source View

-

Image:progress1.png

-

 

-
-

다음 섹션에서는 HTML을 사용하여 창에 더 많은 요소를 추가하는 방법에 대해 배울 것입니다.

-

-

« 이전다음 »

-

-

diff --git a/files/ko/mozilla/tech/xul/xul_tutorial/property_files/index.html b/files/ko/mozilla/tech/xul/xul_tutorial/property_files/index.html deleted file mode 100644 index 7c99944148..0000000000 --- a/files/ko/mozilla/tech/xul/xul_tutorial/property_files/index.html +++ /dev/null @@ -1,64 +0,0 @@ ---- -title: Property Files -slug: Mozilla/Tech/XUL/XUL_Tutorial/Property_Files -tags: - - Localization - - XUL - - XUL_Tutorial -translation_of: Archive/Mozilla/XUL/Tutorial/Property_Files ---- -

-

« 이전다음 »

-

-

스크립트에서는, 엔티티를 쓸 수 없습니다. 대신 프로퍼티(property) 파일을 씁니다.

-

프로퍼티

-

DTD 파일은 XUL 파일에 텍스트가 있을 때 적당합니다. 그러나, 스크립트는 for 엔티티 분석되지 않습니다. 게다가, 예를 들어 혹시 여러분이 표시되는 텍스트를 정확히 모를 경우 스크립트에서 생성된 메시지를 표시하고 싶을지도 모릅니다. 이런 목적에, 프로퍼티 파일을 쓸 수 있습니다.

-

프로퍼티 파일에는 문자열 집합이 담깁니다. DTD 파일과 함께 확장자가 .properties인 프로퍼티 파일이 있습니다. 이 파일에서 프로퍼티는 이름=값 구문으로 선언합니다. 예를 아래에 보입니다:

-
notFoundAlert=No files were found matching the criteria.
-deleteAlert=Click OK to have all your files deleted.
-resultMessage=%2$S files found in the %1$S directory.
-
-

이 프로퍼티 파일은 세 프로퍼티를 담고 있습니다. 스크립트로 이 프로퍼티를 읽고 사용자에게 표시됩니다.

-

Stringbundle

-

여러분이 직접 프로퍼티를 읽는 코드를 작성할 수 있으나 XUL이 여러분을 위해 이 일을 하는 stringbundle 요소(element)를 제공합니다. 요소에는 프로퍼티 파일에서 문자열를 얻고 다른 locale 정보를 얻는데 쓸 수 있는 많은 함수가 있습니다. 이 요소는 프로퍼티 파일의 content를 읽어들이고 여러분을 위해 프로퍼티 목록을 만듭니다. 그러면 여러분은 이름으로 특정 프로퍼티를 찾아볼 수 있습니다.

-
<stringbundleset id="strbundles">
-<stringbundle id="strings" src="strings.properties"/>
-</stringbundleset>
-
-

이 요소를 포함하면 XUL 파일과 같은 디렉토리의 'strings.properties' 파일에서 프로퍼티를 읽습니다. locale에서 파일을 읽으려면 chrome URL을 쓰세요. 다른 비표시 요소처럼, 여러분은 stringbundle을 모두 한데 모으기 위해 stringbundleset 요소 안에 여러분의 stringbundle 모두를 선언해야 합니다.

-

Bundle에서 문자열 얻기

-

stringbundle 요소에는 많은 프로퍼티가 있습니다. 처음은 bundle에서 문자열을 읽기 위해 스크립트에 쓰일 수 있는 getString입니다.

-
var strbundle = document.getElementById("strings");
-var nofilesfound=strbundle.getString("notFoundAlert");
-
-alert(nofilesfound);
-
- -

텍스트 포맷팅

-

다음 메소드는 getFormattedString()입니다. 이 메소드 또한 bundle에서 주어진 키 이름으로 문자열을 얻습니다. 게다가, 포맷팅 코드(예컨대, %S)가 나올 때마다 주어진 배열의 연속하는 각 요소로 바뀝니다.

-
var dir = "/usr/local/document";
-var count = 10;
-
-var strbundle = document.getElementById("strings");
-var result = strbundle.getFormattedString("resultMessage", [ dir, count ]);
-
-alert(result);
-
-

이 예제는 다음 메시지를 경고 대화 상자에 표시합니다.

-
10 files found in the /usr/local/document directory.
-
-

여러분은 포맷팅 코드 %1$S%2$S가 쓰이고 배열에서 다른 순서로 바뀜을 알아챌 겁니다. 포맷팅 코드 % - - n - $S는 직접 대응하는 매개변수(parameter)의 위치를 지정합니다. 비록 낱말 순서가 모든 언어에서 같지 않더라도, getFormattedString()을 써서 지정한 순서로 프로퍼티 파일을 작성할 수 있습니다.

-

비아스키 문자 이스케이프

-

비록 많은 언어에서 비ASCII 문자가 필요하더라도, 프로퍼티 파일은 오직 ASCII 문자를 써서 작성해야 합니다. 그러나, 프로퍼티 파일은 XXXX가 문자 코드인 \uXXXX 형식 이스케이프 시퀀스를 써서 다른 문자를 지원합니다. 그러므로, 혹시 여러분의 프로퍼티 파일이 비ASCII 문자를 담고 있으면, 여러분은 이를 'escaped-unicode' 형식으로 변환해야 합니다. 이를 위해, 여러분은 Sun사의 Java Development Kit (JDK)와 같이 묶인 native2ascii 명령줄 유틸리티를 쓸 수 있습니다.

-

다음 절에서는, 요소의 behavior를 정의하는 데 쓸 수 있는 XBL을 보겠습니다.

-

-

« 이전다음 »

-

-

diff --git a/files/ko/mozilla/tech/xul/xul_tutorial/scroll_bars/index.html b/files/ko/mozilla/tech/xul/xul_tutorial/scroll_bars/index.html deleted file mode 100644 index 583447186e..0000000000 --- a/files/ko/mozilla/tech/xul/xul_tutorial/scroll_bars/index.html +++ /dev/null @@ -1,71 +0,0 @@ ---- -title: Scroll Bars -slug: Mozilla/Tech/XUL/XUL_Tutorial/Scroll_Bars -tags: - - XUL - - XUL_Tutorial -translation_of: Archive/Mozilla/XUL/Tutorial/Scroll_Bars ---- -

 

-

-

« 이전다음 »

-

-

이제, 창에 스크롤바를 추가해 보도록 하겠습니다.

-

스크롤바 추가하기

-

스크롤바는 대개 사용자가 긴 문서를 이동하기 위해 사용됩니다. 또한 어떤 범위에 해당하는 값을 선택하기 위해서도 사용될 수 있습니다. 스크롤바는 여러 방식으로 생성될 수 있는데, XUL에서는 scrollbar 태그를 이용해서 만들어 집니다. 글상자와 같은 일부 요소는 내용이 너무 긴 경우와 같이, 필요에 따라 스크롤바를 추가할 수 있습니다.

-

이 단원에서는 독립적인 스크롤바의 생성 방법에 대해 다룰 것입니다. 사용자는 스크롤바를 조정하여 값을 설정하게 될 것입니다. 여러분은 그리 많이 사용할 일이 없을 것입니다. 스크롤바는 주요 부분인 조정 가능한 스크롤상자(thumb)와 양 끝단에 있는 2개의 화살표 버튼들로 구성됩니다. 스크롤바는 이러한 모든 요소들을 자동으로 생성합니다.

-

Image:scroll1.png

-

스크롤바의 구문은 다음과 같습니다.

-
<scrollbar
-    id="identifier"
-    orient="horizontal"
-    curpos="20"
-    maxpos="100"
-    increment="1"
-    pageincrement="10"/>
-
-

속성은 다음과 같습니다.

-
-
- id
-
- 스크롤바의 유일 식별자.
-
-
-
- orient
-
- 이 속성은 스크롤바의 방향을 지정합니다. 기본값은 horizontal로, 좌측에서 우측으로 늘어나는 스크롤바를 만듭니다. vertical이라는 속성을 지정할 수도 있는데, 이는 상단에서 하단으로 늘어나는 스크롤바를 만듭니다.
-
-
-
- curpos
-
- 이 속성은 스크롤상자(여러분이 스크롤바에서 앞뒤로 움직일 수 있는 막대)의 현재 위치를 나타냅니다. 이 속성값은 0부터 maxpos 속성에 지정한 값의 범위를 가집니다. 이 속성값은 단위를 필요로 하지 않으며, 기본값은 0입니다.
-
-
-
- maxpos
-
- 이것은 스크롤상자의 최대 위치를 가리킵니다. 숫자로 나타내며 단위는 없습니다. 기본값은 100입니다.
-
-
-
- increment
-
- 여기에 명시한 값은 사용자가 스크롤바에 있는 화살표 버튼을 클릭했을 때 curpos 값을 얼마나 변경할 지 지정합니다. 기본값은 1입니다.
-
-
-
- pageincrement
-
- 여기에 명시한 값은 사용자가 스크롤바의 구간의 쪽를 클릭했을 때, 즉 스크롤상자와 화살표 사이의 영역을 클릭할 때 얼만큼의 curpos값이 변경될지를 지정합니다. 기본값은 10입니다.
-
-

위에 있는 구문 예제는 0부터 100까지의 범위를 가지는 스크롤바를 생성할 것입니다. 100이라는 값은 목록에 있는 줄 수 일수 있지만, 여러분이 원하는 어떤 것일 수도 있습니다. 이 예제에서 초기값은 20입니다. 스크롤바의 화살표 중 하나를 클릭하면, 값은 위나 아래로 1씩 바뀌게 됩니다. 스크롤바의 페이지 영역(스크롤박스와 화살표 버튼 사이 영역)을 클릭하면 10만큼 바뀌게 됩니다.

-

사용자가 스크롤바 화살표를 클릭하면 스크롤상자는 increment값에 지정한 양만큼 이동하게 됩니다. 이 속성값을 증가시키면 클릭할 때마다 더 멀리 이동하게 됩니다. 스크롤바의 좌측단 또는 최상단 위치는 0값을 가지며 우측단과 최하단 위치는 maxpos에 지정된 값을 가집니다.

-

스크롤바의 값을 조정함으로써, 스크롤상자 부분을 원하는 곳에 위치시키고 화살표를 클릭했을 때 이동범위를 변경할 수 있습니다.

-

다음에는 툴바를 만드는 방법에 대해 알아보겠습니다.

-

-

« 이전다음 »

-

-

diff --git a/files/ko/mozilla/tech/xul/xul_tutorial/scrolling_menus/index.html b/files/ko/mozilla/tech/xul/xul_tutorial/scrolling_menus/index.html deleted file mode 100644 index bf2600329a..0000000000 --- a/files/ko/mozilla/tech/xul/xul_tutorial/scrolling_menus/index.html +++ /dev/null @@ -1,46 +0,0 @@ ---- -title: Scrolling Menus -slug: Mozilla/Tech/XUL/XUL_Tutorial/Scrolling_Menus -tags: - - XUL - - XUL_Tutorial -translation_of: Archive/Mozilla/XUL/Tutorial/Scrolling_Menus ---- -

 

-

-

« 이전다음 »

-

-

이번 단원에서는 스크롤 메뉴와 스크롤 기능의 사용 방법에 대해 알아보겠습니다.

-

큰 메뉴 만들기

-

화면에 다 넣을수 없을만큼 많은 명령을 가진 메뉴를 작성하면 어떻게 될지 궁금하실 것입니다. Mozilla에서는 이런 경우를 위해 항목이 스크롤되는 기능을 제공합니다.

-
- Image:menuscroll1.png
-

만약 사용할 수 있는 공간이 모자라면 메뉴의 양 끝에 화살표가 나타납니다. 이 때 마우스를 화살표 위에 갖다 대면 메뉴가 위, 아래로 스크롤됩니다. 공간이 충분하다면 화살표는 나타나지 않습니다. 이 때 주의할 것은 스크롤의 작동 방식은 테마에 따라 다르다는 것입니다.

-

스크롤 기능은 자동으로 실행됩니다. 따라서 스크롤 메뉴를 만들기 위해 다른 것을 건드릴 필요는 없습니다. 스크롤 기능은 menubar, popup, menulist에 있는 메뉴에 적용됩니다. 이 기능은 arrowscrollbox 요소를 이용하여 구현됩니다. arrowscrollbox 요소는 화살표가 있는 스크롤 상자를 만들 때도 사용할 수 있습니다.

-

arrowscrollbox 요소는 일반 상자가 사용될 수 있는 곳 어디서나 사용될 수 있습니다. 꼭 메뉴에만 사용해야 하는 것은 아닙니다. arrowscrollbox 요소는 항상 세로 상자이며 어떤 요소든 포함할 수 있습니다. 여러분은 드롭다운이 아닌 목록을 구현하기 위해 arrowscrollbox 요소를 사용할 수도 있습니다.

-

예제 - 스크롤되는 버튼 목록

-

아래는 스크롤할 수 있는 버튼 목록을 만드는 방법을 보여주는 예제입니다(화살표를 보려면 창을 줄여야 할것입니다).

-

예제 1 : Source View

-
<arrowscrollbox orient="vertical" flex="1">
-  <button label="Red"/>
-  <button label="Blue"/>
-  <button label="Green"/>
-  <button label="Yellow"/>
-  <button label="Orange"/>
-  <button label="Silver"/>
-  <button label="Lavender"/>
-  <button label="Gold"/>
-  <button label="Turquoise"/>
-  <button label="Peach"/>
-  <button label="Maroon"/>
-  <button label="Black"/>
-</arrowscrollbox>
-
-

예제를 실행하면 전체 화면으로 표시될 것입니다. 하지만 창의 높이를 줄이면, 스크롤 화살표가 나타날 것입니다. 다시 창을 키우면 화살표가 사라질 것입니다.

-

항상 화살표가 보이도록 하고 싶다면 arrowscrollbox에 CSS의 max-height 속성을 사용하여 크기를 제한하면 됩니다.

-

arrowscrollbox는 주로 메뉴와 팝업에서 유용하게 사용됩니다.

-

다음에는 XUL 요소에 이벤트 핸들러를 지정하는 방법에 대해 알아보겠습니다.

-

-

« 이전다음 »

-

-

diff --git a/files/ko/mozilla/tech/xul/xul_tutorial/simple_menu_bars/index.html b/files/ko/mozilla/tech/xul/xul_tutorial/simple_menu_bars/index.html deleted file mode 100644 index 2ba8d57bcf..0000000000 --- a/files/ko/mozilla/tech/xul/xul_tutorial/simple_menu_bars/index.html +++ /dev/null @@ -1,160 +0,0 @@ ---- -title: Simple Menu Bars -slug: Mozilla/Tech/XUL/XUL_Tutorial/Simple_Menu_Bars -tags: - - XUL - - XUL_Tutorial -translation_of: Archive/Mozilla/XUL/Tutorial/Simple_Menu_Bars ---- -

 

- -

-

« 이전다음 »

-

- -

이번 단원에서는 메뉴를 포함하는 메뉴바의 작성 방법에 대해 알아보겠습니다.

- -

메뉴 만들기

- -

XUL에는 메뉴를 만들 수 있는 여러가지 다양한 방법이 있습니다. 가장 기본적인 방식은 많은 응용프로그램이 그러하듯이 메뉴들을 포함하는 메뉴바를 추가하는 방법이며, 또한 팝업 메뉴도 만들 수 있습니다. XUL의 메뉴 기능은 메뉴바나 팝업 메뉴를 만들 수 있는 여러가지 요소들로 구성되어 있습니다. 메뉴에 있는 항목들은 쉽게 커스터마이징 할 수 있습니다. 우리는 이미 menulist를 사용해서 메뉴를 만드는 방법을 살펴보았습니다. 이 단원은 이 내용을 기반으로 진행될 것입니다.

- -

메뉴바는 대개 툴바와 비슷한 방법으로 작성됩니다. 메뉴바는 toolbox 요소 내부에 위치할 수 있으며, 메뉴바의 왼쪽에 이를 닫을 수 있는 그리피가 나타납니다(주의: Firefox에서는 더 이상 그리피를 지원하지 않습니다). 메뉴는 툴바와 작동방식도 비슷합니다. XUL은 메뉴에만 특별한 몇 가지 요소를 가지고 있습니다.

- -

메뉴바와 메뉴의 작성과 관련된 4가지 요소가 있으며, 여기서는 간략하게 다루고 진행하면서 자세히 다루겠습니다.

- -
-
menubar
-
메뉴들의 컨테이너.
-
- -
-
menu
-
이름과 달리, 실제로는 메뉴바에 있는 메뉴의 제목을 나타낼 뿐입니다. 이 요소는 메뉴바 내에 위치하거나 독립적으로 위치할 수 있습니다.
-
- -
-
menupopup
-
메뉴 제목을 클릭하였을 때 나타나는 팝업 상자입니다. 이 상자는 메뉴 명령 목록을 포함합니다.
-
- -
-
menuitem
-
메뉴의 개별 명령으로 menupopup에 위치합니다.
-
- -
-
menuseparator
-
메뉴의 구분 막대로 menupopup에 위치합니다.
-
- -
-

맥킨토시를 제외한 모든 플랫폼에서 원하는 대로 메뉴바에 있는 메뉴를 변경할 수 있습니다. 이것은 메킨토시에는 시스템에 의해 화면 상단을 따라 자신만의 메뉴를 만들기 때문입니다. 여러분은 커스텀 메뉴를 만들 수는 있지만, 메뉴에 적용한 특별한 서식 규칙이나 비(非)-메뉴 요소는 적용되지 않을 수 있습니다. 메뉴를 만들 때 이 점을 염두에 두어야 합니다.

-
- -
간단한 메뉴바 예제
- -

예제 1 : Source View

- -
Image:menubar-ex1.png
- -
<toolbox flex="1">
-  <menubar id="sample-menubar">
-    <menu id="file-menu" label="File">
-      <menupopup id="file-popup">
-        <menuitem label="New"/>
-        <menuitem label="Open"/>
-        <menuitem label="Save"/>
-        <menuseparator/>
-        <menuitem label="Exit"/>
-      </menupopup>
-    </menu>
-    <menu id="edit-menu" label="Edit">
-      <menupopup id="edit-popup">
-        <menuitem label="Undo"/>
-        <menuitem label="Redo"/>
-      </menupopup>
-    </menu>
-  </menubar>
-</toolbox>
-
- -

위 예제에서는 menubar 요소를 사용해서 간단한 메뉴바와 메뉴바에 위치한 메뉴들을 만들었습니다. 여기서는 File과 Edit 2개 메뉴가 작성되었습니다. menu 요소는 메뉴상단에 제목을 만들며, 메뉴바에 나타납니다. 팝업은 menupopup 요소를 사용하여 만들어집니다. 팝업은 사용자가 이의 부모 메뉴 제목을 클릭할 때 튀어나오게 됩니다. 팝업의 크기는 팝업에 포함된 명령에 맞게 충분히 크게 나타납니다. 명령 자체는 menuitem를 사용해서 만들어집니다. 각 menuitem은 메뉴 팝업에서 하나의 명령을 나타냅니다.

- -

menuseparator 요소를 사용해서 메뉴에 구분자를 만들 수도 있습니다. 이것은 menuitem 그룹들을 나눌 때 사용됩니다.

- - - -

menubar는 메뉴를 담는 상자입니다. 메뉴바가 flex 속성을 갖는 toolbox 내부에 위치하고 있다는 점을 주의깊게 보시기 바랍니다. 메뉴바는 특별한 속성을 가지지는 않지만 상자 유형에 속합니다. 이것은 orient 속성값을 vertical로 하면 세로 방향의 메뉴바를 만들 수 있다는 것을 의미합니다.

- - - -

menu 요소는 button 요소와 비슷하게 동작합니다. menu 요소는 button과 몇 가지 동일한 속성을 가지며 그 외 추가적인 속성을 포함합니다.

- -
-
id
-
메뉴의 유일 식별자.
-
- -
-
label
-
File 또는 Edit와 같은 메뉴에 나타나는 텍스트.
-
- -
-
disabled
-
이 불린(boolean) 속성은 메뉴 사용여부를 결정합니다. 할 수는 있지만, 전체 메뉴를 사용 중지할 필요는 극히 드뭅니다. 이 속성은 true 또는 false 중 한가지 값을 가집니다. 물론, 기본값은 후자입니다.
-
- -
-
accesskey
-
이 속성은 사용자가 메뉴 항목을 활성화하기 위해 누를 수 있는 키입니다. 이 문자는 대개 메뉴 제목에 밑줄이 그어진 문자로 출력됩니다. Mozilla는 label 속성을 검토해서 여기에 지정된 문자를 찾아 밑줄을 추가합니다. 그렇기 때문에 라벨 텍스트에 있는 문자 중 하나를 이 속성으로 지정하는 것이 좋습니다. 물론 여기에 지정한 문자가 라벨 텍스트에 없더라도 동작합니다.
-
- -
Image:menubar-ex2.png
- -

꼭은 아니지만, menu 요소는 보통 menubar에 위치합니다. 만약 menubar에 포함되어 있지 않으면 다른 형태로 출력됩니다. 여기에 있는 그림은 메뉴바가 없는 경우 앞서의 예제가 어떤 모습이 되는지 보여주고 있습니다.

- - - -

menupopup 요소는 메뉴 명령들을 포함하는 팝업창을 만듭니다. 이 요소는 세로 방향을 기본으로 하는 상자입니다. 원할 경우 가로 방향으로 바꿀 수 있으며, 그렇게 하면 menuitem들은 행으로 위치하게 됩니다. 일반적으로 menuitemmenuseparatormenupopup에 위치합니다. 여려분은 menupopup에 어떤 요소든 넣을 수 있지만, 앞서 말한바와 같이 맥킨토시에서는 무시될 것입니다.

- - - -

menuitem 요소는 menu 요소와 아주 비슷하며 일부 동일한 속성들을 가지고 있습니다.

- -
-
id
-
메뉴 제목버튼의 유일 식별자.
-
- -
-
label
-
Open 또는 Save같은 메뉴 항목에 나타날 텍스트.
-
- -
-
disabled
-
이 불린(boolean) 속성은 메뉴 사용여부를 결정합니다. 이 속성은 true 또는 false 중에서 하나의 값으로 지정될 수 있으며 후자가 기본값입니다.
-
- -
-
accesskey
-
이 속성은 사용자가 메뉴 항목을 활성화하기 위해 누를 수 있는 키입니다. 이 문자는 대개 메뉴제목에 밑줄이 그어진 문자로 출력됩니다. Mozilla는 label 속성을 검토해서 여기에 지정한 문자를 찾아 밑줄을 추가합니다. 그렇기 때문에 라벨 텍스트에 있는 문자 중 하나를 이 속성으로 지정하는 것이 좋습니다.
-
- -
-
acceltext
-
이것은 메뉴 명령글 옆에 표시될 단축키 텍스트를 지정합니다. 그렇다고 해당 단축키와 menuitem을 바로 연결하는 것은 아닙니다(이 속성을 지정한다고 단축키를 눌렀을때 해당 메뉴가 실행되는 것은 아닙니다). 이 방법에 대해서는 이후에 다룰 것이다.
-
- - - -

menuseparator에는 특별한 속성이 없습니다. 단지 메뉴 항목들 사이에 가로막대를 만들 뿐입니다.

- -

다음 단원에서는 다양한 메뉴 기능들에 대해 알아 보겠습니다.

- -

-

« 이전다음 »

-

- -

diff --git a/files/ko/mozilla/tech/xul/xul_tutorial/splitters/index.html b/files/ko/mozilla/tech/xul/xul_tutorial/splitters/index.html deleted file mode 100644 index 796b8fcb52..0000000000 --- a/files/ko/mozilla/tech/xul/xul_tutorial/splitters/index.html +++ /dev/null @@ -1,139 +0,0 @@ ---- -title: Splitters -slug: Mozilla/Tech/XUL/XUL_Tutorial/Splitters -tags: - - XUL - - XUL_Tutorial -translation_of: Archive/Mozilla/XUL/Tutorial/Splitters ---- -

-

« 이전다음 »

-

- -

이번 단원에서는 splitter를 창에 추가하는 방법에 대해 알아보겠습니다.

- -

상자 나누기

- -

하나의 창 안에 사용자가 크기를 변경할 수 있는 2개 영역이 있었으면 할 때가 있습니다. Mozilla 브라우저 창이 이러한 예로, 브라우저 창에서는 메인 영역과 사이드바 패널 프레임 사이에 있는 막대를 드래그 해서 사이드바 패널의 크기를 조정할 수 있습니다. 또한 빗살대(notch)를 클릭해서 사이드바를 숨길 수도 있습니다.

- -

Splitter 요소

- -

이러한 기능은 splitter라는 요소를 사용하여 구현할 수 있습니다. 이 요소는 2개 영역 사이에 좁은 막대를 만들어서 영역의 크기를 변경할 수 있게 해 줍니다. Splitter 요소는 넣고 싶은 곳 아무데서나 사용할 수 있으며, 동일한 상자 내에서 splitter 앞에 오는 요소와 다음에 오는 요소의 크기를 변경할 수 있습니다.

- -

Splitter가 가로상자 내부에 사용되면 가로 방향으로, 세로상자 내부에 사용되면 세로 방향으로 크기를 변경할 수 있게 해 줍니다.

- -

Splitter 구문은 다음과 같습니다:

- -
<splitter
-    id="identifier"
-    state="open"
-    collapse="before"
-    resizebefore="closest"
-    resizeafter="closest">
-
- -

속성은 다음과 같습니다.

- -
-
id
-
splitter 유일 식별자.
-
- -
-
state
-
splitter의 상태를 나타냅니다. 기본값은 open으로 이값을 설정하면 기본적으로 열린 상태가 되며, collapsed로 설정하면 패널 중 하나는 닫힌 상태가 되어 다른 쪽이 나머지 공간을 차지하는 상태로 출력됩니다.
-
- -
-
collapse
-
이 속성은 splitter의 빗살대(또는 그리피(grippy))를 클릭하거나 닫힘 상태로 설정하였을 경우, 패널의 어느 면이 닫히게 될지를 지정합니다. 이 속성값을 before로 설정하면 splitter 앞에 오는 요소가 닫히게 되며, after로 설정하면 splitter 다음에 오는 요소가 닫히게 됩니다. 만일 기본값인 none으로 설정하면, 그리피를 클릭하더라도 패널은 닫히지 않습니다.
-
- -
-
resizebefore
-
Splitter를 드래그하면, splitter의 왼쪽(혹은 위쪽)에 있는 요소들은 크기가 변하게 됩니다. 이 속성은 왼쪽(혹은 위쪽)에 있는 요소들 중 어떤 요소의 크기가 변하게 될지를 지정합니다. 이 속성값을 closest로 설정하면 splitter의 바로 왼쪽에 있는 요소의 크기가 변경됩니다. 반면, farthest로 설정하면 splitter의 왼쪽에 있는 요소들 중 가장 멀리있는 요소의 크기를 변경하게 됩니다(상자 내 첫번째 요소). 기본값은 closest 입니다.
-
- -
-
resizeafter
-
Splitter를 드래그하면, splitter의 오른쪽(혹은 아래쪽)에 있는 요소들은 크기가 변하게 됩니다. 이 속성은 오른쪽(혹은 아래쪽)에 있는 요소들 중 어떤 요소의 크기가 변하게 될지를 지정합니다. 이 속성값을 closest로 설정하면 splitter의 바로 오른쪽에 있는 요소의 크기가 변경됩니다. 반면, farthest로 설정하면 splitter의 오른쪽에 있는 요소들 중 가장 멀리있는 요소의 크기를 변경하게 됩니다(상자 내 마지막 요소). 이 속성은 grow값을 가질 수도 있는데, 이것은 splitter를 드래그하더라도 오른쪽에 있는 요소들의 크기가 변경되지 않도록 하며, 대신 이들을 포함하는 전체 상자의 크기가 변경됩니다. 기본값은 closest입니다.
-
- -

Splitter에 collapse 속성을 설정하였다면 사용자가 해당 요소를 닫을 수 있도록 grippy 요소도 추가해 주는 것이 좋습니다. Firefox 브라우저에서는 grippy 요소를 지원하지 않습니다. 따라서 해당 요소를 splitter 요소에 넣더라도 출력되지 않으며, splitter를 클릭하더라도 한번에 닫히지 않습니다.

- -

Splitter 예제

- -

다음 예제를 보면 도움이 될 것입니다.

- -

예제 1 : Source View

- -
<hbox flex="1">
-  <iframe id="content-1" width="60" height="20" src="w1.html"/>
-  <splitter collapse="before" resizeafter="farthest">
-    <grippy/>
-  </splitter>
-  <iframe id="content-2" width="60" height="20" src="w2.html"/>
-  <iframe id="content-3" width="60" height="20" src="w3.html"/>
-  <iframe id="content-4" width="60" height="20" src="w4.html"/>
-</hbox>
-
- -
Image:splitter-ex1.jpg
- -

예제에서는 4개의 iframe이 생성되어 있으며 splitter는 첫 번째와 두 번째 사이에 위치하고 있습니다. collapse 속성에는 before값이 설정되어 있으며, 이것은 그리피를 클릭하면 첫 번째 프레임이 사라지고 나머지 프레임들이 왼쪽으로 이동하게 된다는 것을 의미합니다. 그리피는 splitter 내 중앙에 그려집니다.

- -

splitter의 resizeafter 속성 값은 farthest로 설정되어 있습니다. 이것은 splitter를 드래그하면 splitter 다음에 위치한(그림에서는 오른쪽) 요소들 중 가장 멀리있는 요소의 크기가 변경된다는 것을 의미합니다. 이 경우 4번 프레임의 크기가 변경됩니다.

- -

resizebefore 속성의 값은 지정하지 않았기 때문에 기본값인 closest로 지정됩니다. 위의 예제에서는, splitter 앞에 하나의 프레임밖에 없기 때문에, 1번 프레임의 크기가 변하게 됩니다.

- -

2번과 3번 프레임은 4번 프레임이 최소크기가 될 때까지 드래그 한 이후에 크기가 변경됩니다.

- -
Image:splitter-ex2.jpg
- -

그림은 splitter가 닫힌 상태인 4개 패널 모습입니다.

- -
Image:splitter-ex3.jpg
- -

그림은 splitter가 오른쪽으로 크기를 변경한 상태의 패널 모습입니다. 주목해야할 점은 중간의 2개 패널은 크기가 변하지 않았다는 것입니다. 1번과 4번 패널만 크기가 바뀌었습니다. 4번째 패널을 보면 알 수 있습니다. splitter를 오른쪽으로 계속해서 드래그하면, 다른 2개의 패널이 오그라들게 됩니다.

- -

상자에서의 최소 또는 최대 너비를 지정하기 위해 iframe에 min-width, max-height 같은 스타일 속성을 사용할 수 있습니다. 그럴 경우, splitter가 이를 감지하여 최소와 최대크기를 넘어서 끌기할 수 없게 해 줍니다.

- -

예를 들어, 4번 패널에 최소 넓이를 30픽셀로 지정했다면, 그 이하 크기로 줄지않게 됩니다. 그 외 다른 2개 패널은 줄어들게 될 것입니다. 만약 1번 패널의 최소넓이를 50픽셀로 설정했다면, splitter를 오른쪽으로 10픽셀 드래그 할 수 있을 것입니다(왜냐하면 60픽셀 넓이로 시작했기 때문입니다). 그렇다 하더라도 여전히 splitter를 닫을 수는 있습니다.

- -

원할 경우 상자에 하나 이상의 splitter를 사용할 수도 있는데, 이 경우 splitter의 다른 부분을 닫을 수있습니다. 마찬가지로 iframe 뿐만 아니라 어떠한 요소든 닫을 수 있습니다.

- -

우리의 파일 찾기 예제

- -
-

파일 찾기 대화창에 splitter를 사용하였을 경우 어떠한 모양이 될지 알아 봅시다. 한 가지는 대화창에 검색결과를 추가하려는 것입니다. 우리는 검색 조건과 아래의 버튼들 사이에 공간을 추가할 것입니다. 여러분은 splitter를 이용해 검색결과를 닫거나 감출 수 있을 것입니다.

- -
</tabbox>
-
- <iframe src="results.html"/>
- <splitter resizeafter="grow"/>
-
- <hbox>
-
- -

여기에 보면, splitter와 iframe이 대화창에 추가되었습니다. tabbox 뒤에 있던 spacer는 더 이상 필요없기 때문에 이를 삭제할 수 있습니다. 프레임의 내용은 '<tt>results.html</tt>'이라는 파일에 포함되어 있습니다. 지금은 이 파일을 만들어서 아무거나 입력을 하시면 됩니다. iframe은 결과 목록을 만드는 방법에 대해 알게되는 시점에 결과 목록으로 대체될 것입니다. 지금은 splitter를 설명하기 위한 목적으로만 사용하는 것입니다.

- -

splitter의 collapse 속성에는 splitter 앞에 오는 요소를 닫는다는 의미의 before값이 설정되어 있으며, 여기서는 iframe이 이에 해당됩니다. 아래 보이는 그림에서처럼 그리피를 클릭하면 iframe이 닫히고 버튼이 위로 움직이게 됩니다.

- -

resizeafter 속성에는 grow값이 설정되어 있어 splitter 아래의 요소들은 splitter를 아래로 드래그 하면 아래로 밀려가게 됩니다. 결과적으로 프레임의 내용은 어떠한 방향으로든 커질 수 있는 것입니다. 주의할 점은 창의 크기가 자동으로 변경되지는 않는다는 것입니다. 그리고, 세로상자 안에 splitter가 포함되어 있어, 예제에서는 가로 방향 splitter가 된다는 것을 유념해 보기 바랍니다.

- -

일반 상태:

- -

Image:splitter1.png

- -

닫힌 상태:

- -

Image:splitter2.png

- -

지금까지의 파일 찾기 예제 : Source View

-
- -

다음에는 스크롤바를 만드는 방법에 대해 알아보겠습니다.

- -

-

« 이전다음 »

-

diff --git a/files/ko/mozilla/tech/xul/xul_tutorial/stack_positioning/index.html b/files/ko/mozilla/tech/xul/xul_tutorial/stack_positioning/index.html deleted file mode 100644 index c237926ae8..0000000000 --- a/files/ko/mozilla/tech/xul/xul_tutorial/stack_positioning/index.html +++ /dev/null @@ -1,35 +0,0 @@ ---- -title: Stack Positioning -slug: Mozilla/Tech/XUL/XUL_Tutorial/Stack_Positioning -tags: - - XUL - - XUL_Tutorial -translation_of: Archive/Mozilla/XUL/Tutorial/Stack_Positioning ---- -

 

-

-

« 이전다음 »

-

-

이 단원에서는 스택 내에 있는 요소들의 위치를 지정하는 방법에 대해 알아보겠습니다.

-

스택 내 자식 요소의 위치

-

일반적으로 stack의 자식 요소는 스택의 크기에 맞추어 늘어납니다. 그러나 여려분은 특정 좌표에 자식 요소를 배치할 수도 있습니다. 예를 들어, 스택에 두개의 자식 버튼이 있다면, 첫번째 버튼은 좌측에서 20픽셀 그리고 상단에서는 50픽셀 떨어진 곳에, 두번째 버튼은 좌측에서 100픽셀 그리고 상단에서 5픽셀 떨어진 곳에 위치시킬 수 있습니다.

-

자식 요소의 위치는 요소에 두 가지 속성을 사용해서 지정할 수 있습니다. 가로 위치의 경우 left 속성을 사용하고 세로위치는 top속성을 사용합니다. 스택의 자식에 이들 속성을 사용하지 않으며, 해당 자식들은 stack 크기에 맞쳐 늘어나게 됩니다.

-

예제 1 : Source View

-
- Image:bulletins1.png
-
<stack>
-  <button label="Goblins" left="5" top="5"/>
-  <button label="Trolls" left="60" top="20"/>
-  <button label="Vampires" left="10" top="60"/>
-</stack>
-
-

여기서 stack은 3가지 요소를 포함하고 있는데, 각 요소들에 lefttop 속성이 지정되어 있어 그림과 같이 위치하고 있습니다. 예제에서 3가지 자식 요소가 모두 버튼이지만, 요소들이 모두 같은 형식일 필요는 없습니다. 그것은 상자와 다른 스택을 포함해서 어떤 요소든 될 수 있습니다.

-

stack의 크기는 자식 요소의 위치에 의해 결정됩니다. 즉, 모든 자식 요소가 볼 수 있도록 항상 크기가 조정됩니다. 따라서 left 속성을 400으로 설정했으면, 스택은 해당 요소의 넓이에 400픽셀을 더한 정도의 너비를 가지게 됩니다. widthmax-width 같은 여러 스타일 속성을 사용해서 이 크기를 재정의할 수 있습니다.

-

여러분은 스크립트를 사용해서 lefttop 속성 값을 조정할 수 있으며, 요소를 이동하게 만들 수 있습니다. 스택은 절대위치값을 가지는 요소가 위치를 바꿀 때, 다른 요소의 위치에는 영향을 주지 않는다는 장점이 있습니다. 보통 상자에서는 요소의 위치를 옮기면, 다른 요소의 위치가 섞이게 됩니다.

-

자식 요소가 겹쳐질 수 있도록 하는 것 역시 가능합니다. 자식 요소들이 그려질 때는, stack에 나타난 순서대로 보이게 됩니다. 즉, stack의 첫 번째 자식이 맨 뒤에 나타나고, 다음 자식 요소는 그 위에 나타나고, 마지막 요소는 최상위에 오게 됩니다. 해당 요소의 순서를 옮기기 위해 DOM 함수를 이용할 수 있습니다.

-

마우스 이벤트에 응답하는 경우, 상위에 있는 요소가 해당 이벤트를 먼저 인식하게 됩니다. 이것은 두 개의 버튼이 겹쳐있을 경우, 다른 버튼을 덮고 있는 상위 버튼이 마우스 클릭을 인식하게 된다는 것을 의미합니다.

-

다음 섹션에서는 덱과 비슷하지만 고유한 네비게이션 방법을 제공하는 탭박스에 대해 설명하겠습니다.

-

-

« 이전다음 »

-

-

diff --git a/files/ko/mozilla/tech/xul/xul_tutorial/stacks_and_decks/index.html b/files/ko/mozilla/tech/xul/xul_tutorial/stacks_and_decks/index.html deleted file mode 100644 index 76e39325c6..0000000000 --- a/files/ko/mozilla/tech/xul/xul_tutorial/stacks_and_decks/index.html +++ /dev/null @@ -1,61 +0,0 @@ ---- -title: Stacks and Decks -slug: Mozilla/Tech/XUL/XUL_Tutorial/Stacks_and_Decks -tags: - - XUL - - XUL_Tutorial -translation_of: Archive/Mozilla/XUL/Tutorial/Stacks_and_Decks ---- -

 

-

-

« 이전다음 »

-

-

여러분은 여러 요소를 카드를 쌓아 올리듯이 표시해야 할 때가 있을 수도 있습니다. 스택(stack)과 덱(deck) 요소를 이런 용도로 사용하실 수 있습니다.

-

컨테이너(containers)

-

XUL의 모든 상자 요소는 다른 요소를 포함할 수 있는 개체입니다. 툴바탭패널처럼 특수화된 상자도 여러 가지가 있습니다. box 태그는 아무런 특징이 없는 가장 단순한 상자를 만듭니다. 하지만 특수화된 상자들은 일반 상자처럼 내부의 요소들을 배치하는 것 외에 다른 기능들도 가지고 있습니다.

-

실제로 여러 가지 구성 요소들은 다른 요소를 포함할 수 있습니다. 우리는 앞에서 버튼이 다른 요소를 포함하는 것을 살펴 보았습니다. 스크롤바는 여러분이 지정하지 않아도 필요한 요소를 만드는 특수화된 상자입니다. 그리고 막대가 이동하는 것도 스스로 제어합니다.

-

앞으로 몇 단원에 걸쳐 다른 요소를 포함하는 요소들에 대해 알아 볼 것입니다. 그들은 모두 특수화된 상자로서 상자의 모든 속성을 사용할 수 있습니다.

-

스택(stack)

-

Stack 요소는 단순한 상자입니다. 일반 상자와 똑같이 작동하지만 자식 요소를 아래에서부터 쌓는 특징을 가지고 있습니다. 첫 번째 자식 요소가 바닥에 표시되고, 두 번째 자식 요소가 그 위에, 그리고 세 번째 자식 요소가 그 위에 표시되는 방식입니다. 쌓아 올릴 수 있는 요소의 수에는 제한이 없습니다.

-

스택은 자식 요소가 나란히 표시되는 상자와 달리, 아래에서부터 위로 쌓이기 때문에 orient 속성의 의미가 없습니다. 스택의 크기는 가장 큰 자식 요소에 의해 결정되지만 스택과 그 자식 요소에 width, height, min-width 등의 CSS 속성을 사용할 수도 있습니다.

-

stack 요소는 기존의 요소 위에 상태를 표시하는 개체를 표시하고 싶을 때 사용할 수도 있습니다. 예를 들어, 상태바를 막대와 그 위에 중첩된 라벨로 만들 수도 있습니다.

-

스택을 이용해서 그림자 효과 주기

-

또한 stack을 사용하여 손쉽게 많은 CSS 속성을 흉내낼 수 있습니다. 아래는 text-shadow 속성과 비슷한 효과를 내는 예제입니다.

-

예제 1 : Source View

-
<stack>
-  <description value="Shadowed" style="padding-left: 1px; padding-top: 1px; font-size: 15pt"/>
-  <description value="Shadowed" style="color: red; font-size: 15pt;"/>
-</stack>
-
-
- Image:stacks1.png
-

두 개의 description은 15포인트 크기의 문자열을 생성합니다. 하지만 첫 번째 것은 왼쪽과 위쪽에 여백을 주어 1픽셀씩 오른쪽과 아래쪽으로 밀려나게 하였습니다. 그래서 똑같이 'Shadowed'란 문자열을 표시하지만 두 번째 것과 조금 위치가 다릅니다. 두 번째 description 요소는 빨간색으로 표시되기 때문에 효과를 쉽게 알아 볼 수 있습니다.

-

이 방법이 text-shadow보다 좋은 이유는 그림자를 원하는 대로 꾸밀 수 있기 때문입니다. 예를 들어 그림자를 다른 글꼴과 크기로 표시하거나 밑줄을 그을 수도 있습니다. (깜빡이는 효과도 줄 수 있습니다). 게다가 아직까지 Mozilla는 CSS의 text-shadow를 지원하지 않고 있습니다. 단점은 그림자가 차지하는 공간 때문에 스택의 크기가 커진다는 것입니다. 그림자 효과는 사용 불가 버튼을 표시할 때 매우 유용합니다.

-

예제 2 : Source View

-
<stack style="background-color: #C0C0C0">
-  <description value="Disabled" style="color: white; padding-left: 1px; padding-top: 1px;"/>
-  <description value="Disabled" style="color: grey;"/>
-</stack>
-
-

이렇게 하면 사용 불가능한 것처럼 보입니다.

-

한 가지 주의할 점은 마우스 클릭과 키 누름 같은 이벤트는 가장 위의 요소 즉, 스택의 마지막 요소에만 적용된다는 것입니다. 이는 버튼이 스택의 마지막 요소일때만 제대로 동작한다는 것을 의미합니다.

-

덱(decks)

-

deck 요소는 stack처럼 자식 요소들을 쌓아 놓지만 한 번에 하나의 자식 요소만 표시하는 요소입니다. 덱은 유사한 여러 판넬이 순차적으로 표시되는 마법사 인터페이스를 만들 때 유용하게 사용할 수 있습니다. 개별 창을 만들고 각 창에 네비게이션 버튼을 만드는 것보다, 하나의 창에서 내용이 변하는 곳에 덱을 사용하는 것이 보다 편리합니다.

-

스택에서처럼 deck의 바로 아래 자식 요소들은 덱의 한 쪽(page)이 됩니다. deck의 자식 요소가 세 개라면 덱은 세 쪽을 갖고 있는 셈입니다. 화면에 나타나는 쪽은 selectedIndex 속성을 이용하여 조절할 수 있습니다. 인덱스는 표시하고 싶은 쪽에 해당하는 번호입니다. 쪽의 번호는 0부터 시작하기 때문에 덱의 첫 번째 자녀 요소는 0, 두 번째는 1의 순서가 됩니다.

-

예제 3 : Source View

-
<deck selectedIndex="2">
-  <description value="This is the first page"/>
-  <button label="This is the second page"/>
-  <box>
-    <description value="This is the third page"/>
-    <button label="This is also the third page"/>
-  </box>
-</deck>
-
-

예제에는 세 쪽이 있는데 기본적으로 표시되는 것은 세 번째 쪽입니다. 세 번째 쪽은 두 개의 요소를 포함하는 상자입니다. 상자와 그 안의 요소들이 쪽을 구성합니다. 덱의 크기는 가장 큰 자식 요소의 크기와 같기 때문에 여기서는 세 번째 자식 요소의 크기가 덱의 크기가 됩니다.

-

여러분은 스크립트를 사용하여 selectedIndex의 값을 변경하면 표시되는 쪽을 바꿀 수 있습니다. 이에 대해서는 이벤트와 DOM에 대한 단원에서 좀더 알아 보도록 하겠습니다.

-

다음 섹션에서는 자식 요소의 위치를 지장하기 위해 어떻게 스택을 사용할 수 있는지에 대해 설명하겠습니다.

-

-

« 이전다음 »

-

-

diff --git a/files/ko/mozilla/tech/xul/xul_tutorial/tabboxes/index.html b/files/ko/mozilla/tech/xul/xul_tutorial/tabboxes/index.html deleted file mode 100644 index 74de7d0cb8..0000000000 --- a/files/ko/mozilla/tech/xul/xul_tutorial/tabboxes/index.html +++ /dev/null @@ -1,159 +0,0 @@ ---- -title: Tabboxes -slug: Mozilla/Tech/XUL/XUL_Tutorial/Tabboxes -tags: - - XUL - - XUL_Tutorial -translation_of: Archive/Mozilla/XUL/Tutorial/Tabboxes ---- -

-

« 이전다음 »

-

- -

환경설정 대화창은 탭을 사용하여 나타내는 것이 일반적입니다. 본 섹션에서는 탭 패널의 작성 방법에 대해 알아보겠습니다.

- -

탭상자

- -

탭상자는 환경설정 창에서 자주 사용됩니다. 일련의 탭들이 창의 상단부에 표시되며, 사용자는 서로 다른 선택사항들을 보기 위해 각각의 탭을 클릭할 수 있습니다. 이 기능은 선택 사항들을 한 화면에 다 담을 수 없을 때 유용하게 사용될 수 있습니다.

- -

XUL에서도 이러한 대화창을 구현할 수 있는 방법을 제공합니다. 이를 위해서는 다섯 개의 요소에 대해 먼저 알아야 하는데 여기서는 각 요소들에 대해 대략적으로 설명하고 상세한 내용은 아래에서 설명하도록 하겠습니다.

- -
-
tabbox
-
탭과 탭 페이지를 포함하는 외부 상자입니다.
-
tabs
-
각 탭을 포함하는 내부 상자로 다시 말하면 탭을 포함하는 행을 나타냅니다.
-
tab
-
개별 탭을 나타내며 탭을 클릭하면 탭 페이지가 전면에 표시됩니다.
-
tabpanels
-
여러 개의 탭 페이지를 포함하는 요소입니다.
-
tabpanel
-
단일 탭 페이지를 나타내며 실제 내용들이 위치하게 됩니다. 첫 번째 tabpanel은 첫 번째 탭에 해당하고, 두 번째 tabpanel은 두 번째 탭에 해당하는 식입니다.
-
- -

tabbox는 최외곽 요소로 탭을 포함하는 tabs요소와 각 탭 페이지을 포함하는 tabpanels 요소로 구성됩니다.

- -

다음은 탭상자의 일반적인 구문입니다.

- -
<tabbox id="tablist">
-  <tabs>
-    <!-- tab elements go here -->
-  </tabs>
-  <tabpanels>
-    <!-- tabpanel elements go here -->
-  </tabpanels>
-</tabbox>
-
- -

tab 요소들은 일반 상자와 비슷한 tabs 요소 안에 놓입니다. 그리고 tabs 요소 자신은 tabbox 안에 놓이게 됩니다. 또한 tabboxtabpanels 요소를 포함하는데 이는 탭 상자의 수직 정렬 속성에 따라 탭의 아래에 표시됩니다.

- -

실제로 탭 상자는 일반 상자와 별반 다른 게 없습니다. 상자와 마찬가지로 탭 또한 어떤한 요소든 포함할 수 있습니다. 다른 점이 있다면 모양이 조금 다르고 deck처럼 한번에 하나의 탭 패널 밖에 표시되지 않는다는 것입니다.

- -

각 탭 페이지의 내용은 tabpanel에 포함됩니다. tab에 포함된다고 생각하기 쉽지만, tab은 상단에 표시되는 탭의 내용을 포함하는 요소입니다.

- -

tabpanel 요소는 하나의 탭 페이지를 나타냅니다. 첫 번째 패널은 첫 번째 탭에, 두 번째 패널은 두 번째 탭에 대응됩니다. 따라서 tabtabpanel 사이에는 일대일 대응 관계가 성립합니다.

- -

tabbox의 크기는 가장 큰 탭 페이지의 크기에 의해 결정됩니다. 예를 들어 한 탭 페이지에 열 개의 글상자가 있고 다른 탭 페이지에는 하나의 글상자 밖에 없다고 하면, 탭 페이지의 크기는 가장 많은 공간을 차지하는 열 개의 글상자를 가진 탭 페이지의 크기에 맞춰진다는 것을 의미합니다. 사용자가 다른 탭을 선택해도 탭 영역의 크기는 변하지 않습니다.

- -

탭상자 예제

- -

예제 1 : Source View

- -
Image:tabpanel1.png
- -
<tabbox>
-  <tabs>
-    <tab label="Mail"/>
-    <tab label="News"/>
-  </tabs>
-  <tabpanels>
-    <tabpanel id="mailtab">
-      <checkbox label="Automatically check for mail"/>
-    </tabpanel>
-    <tabpanel id="newstab">
-      <button label="Clear News Buffer"/>
-    </tabpanel>
-  </tabpanels>
-</tabbox>
-
- -

예제에는 두 개의 탭이 포함되어 있으며, 첫 번째 탭은 라벨이 'Mail'이고, 두 번째는 'News' 입니다. 사용자가 Mail 탭을 클릭하면 첫 번째 탭 페이지의 내용이 탭 아래에 표시됩니다. 이 경우, 'Automatically check for mail'이라는 라벨이 붙은 체크박스가 나타날 것입니다. 두 번째 탭을 클릭하면 'Clear News Buffer'라는 라벨을 가진 버튼을 포함하는 상자가 표시될 것입니다.

- -

기본적으로 선택된 탭페이지를 지정하기 위해서는 tabboxselectedIndex 속성을 설정하면 됩니다. 이 속성은 deck과 마찬가지로 0에서 시작하며 tabs에 포함되어 있는 탭의 순서 번호를 입력할 수 있습니다. 해당 값에 0미만의 값을 입력하면 0을 입력한 것과 같이 첫번째 탭이 선택된 것으로 출력됩니다. 그리고, 탭의 갯수보다 큰 값을 입력하면 탭은 아무것도 선택되지 않은 것으로 출력되지만, 탭패널에는 첫번째 페이지가 출력될 것입니다.

- -

탭의 위치

- -

끝으로, 탭의 위치를 바꿔서 탭 페이지의 원하는 방향에 탭이 표시되도록 하는 방법을 알아 보겠습니다. 이러한 작업을 하기 위해 특별한 문법이 있는 것이 아니라 간단히 orientdir 속성 값을 설정하면 됩니다. 레이아웃에 관한한 탭 요소들은 일반 상자와 아주 유사하다는 점을 기억하세요. tabbox는 기본적으로 수직 정렬 방식인 일반 컨테이너 상자이고, tabs 요소는 기본적으로 수평 정렬 방식인 일반 컨테이너 상자이라는 점을 알고 있으면 됩니다.

- -

예를 들어 탭을 왼쪽에 표시하려고 한다며, 탭들이 수직적으로 쌓이게 출력되도록 tabsorient 속성을 vertical로 변경한 후 tabboxorient 속성을 horizontal로 설정하면 됩니다. 이렇게 하면 탭 페이지의 상단이 아닌 왼쪽에 탭이 수직방향으로 쌓이게 출력됩니다. 탭 페이지는 겹쳐 있기 때문에 tabpanels 요소의 orient 속성을 바꾸는 것은 아무런 의미가 없습니다.

- -

여러분은 코드상에서 tabpanels 요소 다음으로 tabs 요소 위치를 옮겨서 오른쪽이나 아래쪽에 탭이 배치되도록 할 수 있습니다. 또 다른 방법으로는 tabboxdir 속성을 reverse로 지정하셔도 됩니다. 그러나 탭의 위치를 옮기면 특정 테마에서 보기가 좋지 않을 수 있기 때문에 그냥 상단에 두는게 좋을 것입니다.

- -
-

파일찾기 대화창에 탭 넣기

- -

파일찾기 대화창에 두 번째 패널을 넣어 보겠습니다. 우리는 검색과 관련된 설정을 포함할 Options 탭(기본적으로 선택되어 있도록 하겠습니다)을 만들 것입니다. 이렇게 하는 것이 그다지 좋은 인터페이스는 아니지만, 탭을 설명하기 위해 사용할 목적으로 이렇게 만들 것입니다. 위쪽의 라벨과 검색 상자는 첫 번째 탭에 넣어야 합니다. 두 번째 탭에는 몇가지 설정 사항을 넣겠습니다. 진행막대와 버튼은 탭 외부의 메인 대화창 위에 두도록 하겠습니다.

- -
<vbox flex="1">
-
-<tabbox selectedIndex="1">
-  <tabs>
-    <tab label="Search"/>
-    <tab label="Options"/>
-  </tabs>
-
-  <tabpanels>
-   <tabpanel id="searchpanel" orient="vertical">
-
-    <description>
-     Enter your search criteria below and select the Find button to begin
-     the search.
-    </description>
-
-    <spacer style="height: 10px"/>
-
-    <groupbox orient="horizontal">
-      <caption label="Search Criteria"/>
-
-      <menulist id="searchtype">
-        <menupopup>
-          <menuitem label="Name"/>
-          <menuitem label="Size"/>
-          <menuitem label="Date Modified"/>
-        </menupopup>
-      </menulist>
-      <spacer style="width: 10px;"/>
-      <menulist id="searchmode">
-        <menupopup>
-          <menuitem label="Is"/>
-          <menuitem label="Is Not"/>
-        </menupopup>
-      </menulist>
-
-      <spacer style="height: 10px"/>
-      <textbox id="find-text" flex="1" style="min-width: 15em;"/>
-
-    </groupbox>
-   </tabpanel>
-
-   <tabpanel id="optionspanel" orient="vertical">
-    <checkbox id="casecheck" label="Case Sensitive Search"/>
-    <checkbox id="wordscheck" label="Match Entire Filename"/>
-   </tabpanel>
-
- </tabpanels>
-</tabbox>
-
- -
Image:tabpanel2.png
- -

탭 요소들이 창의 중심부에 추가되었습니다. Search와 Options의 두 탭을 볼 수 있는데, 각 탭을 클릭하면 그에 맞는 탭 페이지가 표시됩니다. 그림에서 보듯이, 두 번째 탭에는 두 개의 선택 사항이 있으며, 첫 번째 탭은 상단에 탭이 있는 것을 제외하면 이전의 파일찾기 창과 차이가 없습니다.

- -

지금까지의 파일 찾기 예제 : Source View

-
- -

다음에는 격자 형식의 컨텐츠를 작성하는 방법에 대해 배워보겠습니다.

- -

-

« 이전다음 »

-

diff --git a/files/ko/mozilla/tech/xul/xul_tutorial/templates/index.html b/files/ko/mozilla/tech/xul/xul_tutorial/templates/index.html deleted file mode 100644 index dd1af0a361..0000000000 --- a/files/ko/mozilla/tech/xul/xul_tutorial/templates/index.html +++ /dev/null @@ -1,126 +0,0 @@ ---- -title: Templates -slug: Mozilla/Tech/XUL/XUL_Tutorial/Templates -tags: - - XUL - - XUL_Tutorial -translation_of: Archive/Mozilla/XUL/Tutorial/Templates ---- -

템플릿

-

이 절에서는 데이터로부터 요소를 생성시키는 방법에 대해 살펴보고 갑니다.

-

요소의 생성

-

XUL 에는 RDF 파일 혹은 내부 데이터 소스에 의한 RDF 로부터 공급되는 데이터로부터 요소를 생성하는 기능이 있습니다. Mozilla 에서는 북마크나 히스토리 혹은 메일 메세지등의 여러 가지의 데이터 소스가 제공되고 있습니다. 이것들에 대한 자세한 것은 다음 절에 취급합니다.

-

보편적으로, 트리 항목(treeitem)이나 메뉴 항목(menuitem)등의 요소가 데이터로부터 생성되게 됩니다. 그렇지만, 필요하면 다른 요소에 이용하는 일도 가능합니다. 그렇게 말한 요소가 보다 유용이 되는 것은 특수한 상황에 있어야하지만 트리나 메뉴에는 긴 코드를 필요로 하므로 우선은 그러한 요소에 대하고 나서 시작합니다.

-

RDF 데이터에 근거한 요소의 생성을 가능하게 하기 위해서는, 생성되는 요소 마다 복제되는 것 같은 단순한 템플릿을 줄 필요가 있습니다. 요컨데, 최초의 요소만을 주어 두어 나머지의 요소는 그것을 바탕으로 구축시키는 것입니다.

-

템플릿은 template 요소에 의해 작성됩니다. 그 중에 구축되는 각 요소에 대해 이용하고 싶은 요소를 둡니다. template 요소는 구축되는 요소를 포함하게 되는 요소내에 둘 필요가 있습니다. 예를 들면 트리의 경우, template 요소를 tree 요소내에 둡니다.

-

예를 보는 편이 빠를 것입니다. 간단한 예로서 탑 레벨의 각 북마크에 대응하는 버튼을 작성해 봅시다. Mozilla 에는 북마크 데이터 소스가 있으므로 데이터의 취득에는 그것을 이용합니다. 이 예에서는 버튼을 작성하는 대상으로 탑 레벨의 북마크(혹은 북마크 폴더)만을 취득합니다. 아래층의 북마크에 대해서는 트리나 메뉴등의 계층을 표시하는 요소가 필요하게 됩니다.

-

내부의 RDF 데이터 소스를 참조하는 것 같은 이 예나 다른 것은 chrome URL 로부터 읽혔을 경우에 대해서만 유효합니다. 안전상의 이유로부터 Mozilla 에서는 다른 소스로부터 남을 수 있는 데이터 소스에의 액세스는 할 수 없게 되어 있습니다.

-

이 예를 실제로 보기 위해서(때문에)는, chrome 패키지를 작성해 파일을 거기로부터 읽어들이게 할 필요가 있습니다. chrome URL 를 브라우저의 URL 필드에 입력합니다.

-

Example 9.2. 1: 소스

-
<vbox datasources="rdf:bookmarks" ref="NC:BookmarksRoot" flex="1">
-  <template>
-    <button uri="rdf:*" label="rdf:http://home.netscape.com/NC-rdf#Name"/>
-  </template>
-</vbox>
-
-

여기에서는, 각 탑 레벨의 북마크에 대응하는 버튼을 포함한 세로 줄의 박스가 작성됩니다만, 위에 보여지듯이, template 요소는 button 요소를 1개만 포함하고 있습니다. 이 버튼이 생성할 필요가 있는 모든 버튼의 바탕으로 됩니다. 화면으로부터 알듯이, 각 북마크에 대응하는 일련의 버튼이 작성되고 있습니다.

-

이 예의 윈도우를 연 채로 해서 브라우저로 북마크를 추가해 보세요. 일련의 버튼이 즉시 갱신되는 것을 알 수 있습니다.(다만, 윈도우에 한 번 포커스를 댈 필요가 있을지도 모릅니다).

-

템플릿 자체는 세로 줄의 박스내에 놓여져 있습니다. 박스에는 템플릿을 이용하기 위한 2개의 특별한 속성이 주어지고 있어 이용하는 데이터를 어디에서 얻는지를 지정하고 있습니다. 우선 datasources 속성입니다만, 이것은 RDF 데이터 소스를 요소 생성에 있어서의 데이터 공급원으로 하는 경우에 이용합니다. 이 경우 rdf:bookmarks 가 이용됩니다. 이것은 북마크 데이터 소스라고 짐작이 되겠지요. 이 데이터 소스는 Mozilla 가 제공하는 것입니다. 당신 자신에 의한 데이터 소스를 이용하고 싶은 경우는, 아래의 예에 나타나고 있듯이 datasources 속성에 RDF 파일의 URL 를 지정합니다.

-
<box datasources="chrome://zoo/content/animals.rdf"
-     ref="http://www.some-fictitious-zoo.com/all-animals">
-
-
-


- 공백 캐릭터로 나눠지는 것으로 한 번에 복수의 데이터 소스를 속성으로 지정할 수도 있습니다. 이것은 복수의 소스로부터의 데이터를 표시시키고 싶은 경우에 이용할 수 있습니다.

-

다음에 ref 속성에는 데이터 소스내의 어디에서 데이터를 취득하는지를 지정합니다. 위의 북마크의 경우, 북마크 계층에 있어서의 루트를 지시하는 값 NC:BookmarksRoot 가 이용되고 있습니다. 여기로 지정 가능한 값은 이용하는 데이터 소스에 의존합니다. 당신 자신에 의한 데이터 소스를 이용하는 경우, 지정하는 값은 RDF 의 Bag, Seq, Alt 몇개의 요소에 있어서의 about 속성의 값에 대응하는 것이 됩니다.

-

이것들 2개의 속성을 위의 박스에 나누어주는 것으로 템플릿으로부터의 요소의 생성이 가능하게 됩니다. 다만, 템플릿내의 요소는 다른 방법으로 선언될 필요가 있습니다. 위의 예로 보여지듯이, button 요소에는 uri 속성이 주어지고 있고 label 속성의 값이 통상과 다른 것이 되어 있습니다.

-

템플릿내에 있어서의 속성값은 데이터 소스로부터 값을 취득해야 하는 것을 지시하기 때문에 'rdf:'로 시작됩니다. 전의 예에서는 label 속성이 이것에 해당합니다. 속성값의 나머지의 부분은 데이터 소스내의 name 프롭퍼티를 참조합니다. [역주:The remainder of the value refers to the name property is the datasource. 문법적으로 이상한 느낌이지만, 문중의 'property is ...'는 'property in ...'의 오타라고 생각된다. ] 그것은 데이터 소스로 이용되고 있는 이름 공간 URL 에 프롭퍼티명을 부가한 것으로 구성되어 있습니다. 여기를 이해할 수 없는 경우는 전 장의 마지막 부분을 읽어 봐 주세요. 거기에 RDF 내의 리소스가 어떤 형태로 참조될지가 진술되고 있습니다. 여기에서는 북마크명 밖에 이용하지 않았습니다만, 그 밖에도 여러 가지의 필드를 이용할 수 있습니다.

-

버튼의 label에는 북마크명을 설정하고 싶었기 때문에, 버튼의 label 속성은 이 특별한 URI 로 설정되어 있습니다. URI 를 button 요소의 임의의 속성이나 다른 요소의 속성으로 설정할 수도 있었습니다. 이러한 속성의 값은 데이터 소스 - 여기에서는 북마크 데이터 소스 - 로부터 공급되는 데이터로 옮겨집니다. 그 결과, 버튼의 label는 북마크명이 되는 것입니다.

-

아래의 예에서는 데이터 소스를 이용해 버튼에 있어서의 다른 속성을 어떻게 설정 할 수 있는지를 나타내고 있습니다. 물론, 데이터 소스에는 적절한 리소스가 주어지고 있는 것으로 합니다. 만약 속성에 대응하는 리소스가 눈에 띄지 않는 경우, 그 속성의 값은 캐릭터 라인이 됩니다.

-
<button class="rdf:http://www.example.com/rdf#class"
-        uri="rdf:*"
-        label="rdf:http://www.example.com/rdf#name"/>
-        crop="rdf:http://www.example.com/rdf#crop"/>
-
-
-


- 보듯이 다른 데이터 소스로부터 공급되는 속성을 이용해 동적으로 요소의 리스트를 생성시킬 수가 있습니다.

-

내용 생성을 시작하는 장소의 요소는 uri 속성으로 지정합니다. 보다 이전의 내용의 생성은 한 번 잘른 것인데 비해 내부의 내용은 각각의 리소스에 대해 생성됩니다. 이 점에 대해서는 트리에 대한 템플릿의 작성에 대해 말할 때에 자세하게 살펴보기로 하겠습니다.

-

이러한 기능을 템플릿을 포함한 컨테이너 - 여기에서는 박스 - 에 부가하는 것으로써, 외부의 데이터로부터 여러 가지의 흥미를 끄는 내용 리스트를 생성시킬 수가 있습니다. 물론, 템플릿내에는 복수의 요소를 두어도 어느 요소에도 고유의 RDF 참조를 줄 수가 있습니다. 아래에 그 예를 나타냅니다.

-

Example 9.2. 2: 소스

-
<vbox datasources="rdf:bookmarks" ref="NC:BookmarksRoot" flex="1">
-  <template>
-    <vbox uri="rdf:*">
-      <button label="rdf:http://home.netscape.com/NC-rdf#Name"/>
-      <label value="rdf:http://home.netscape.com/NC-rdf#URL"/>
-    </vbox>
-  </template>
-</vbox>
-
-


- 이 예는 각 북마크에 대해 버튼과 label를 가지는 세로 줄의 박스를 생성합니다. 버튼은 북마크명, label는 URL 를 가지게 됩니다.

-

생성되는 새로운 요소는 XUL 내에 직접 기록된 요소와 기능적으로는 아무런 바뀔 것은 없습니다. 템플릿에 의해 생성되는 모든 요소에 대해 리소스를 특정하는 id 속성이 주어집니다. 이것을 이용해 리소스를 특정할 수 있습니다.

-

아래의 예와 같이 같은 속성에 복수의 리소스치를 공백 캐릭터로 단락지어 지정할 수도 있습니다. 리소스 구문의 상세입니다.

-

Example 9.2. 3: 소스

-
<vbox datasources="rdf:bookmarks" ref="NC:BookmarksRoot"
-     flex="1">
-  <template>
-    <label uri="rdf:*" value="rdf:http://home.netscape.com/NC-rdf#Name rdf:http://home.netscape.com/NC-rdf#URL"/>
-  </template>
-</vbox>
-
-

템플릿 구축 방법

-

요소가 데이터소스의 속성을 가질 때, 그 요소는 템플릿으로부터 구축되는 것을 의미합니다. 내용이 구축될지 어떨지는 template 태그는 아니고, datasources 속성으로 정해지는 것에 주의해 주세요. 이 속성이 존재할 때, 빌더로 불리는 오브젝트가 요소에 부가됩니다. 이 오브젝트가 템플릿으로부터의 내용 생성의 역할을 하게 됩니다. JavaScript 로부터는 builder 속성으로부터 빌더객체에 액세스 할 수가 있습니다. 통상, 내용 생성이 자동적으로 행해지지 않을 때에 빌더에 내용의 재생성을 실시하게 하고 싶은 경우를 제외하면, 이 필요성은 없을 것입니다.

-

빌더에는 2 종류가 있습니다. 1개는 대부분의 경우에 이용되는 내용 빌더로 불려지고 또 하나는 트리에 대해서만 이용되는 트리빌더입니다.

-

내용 빌더는 template 요소내의 내용을 꺼내 항목 마다 복제합니다. 예를 들면, 위의 예로 유저가 10 개의 북마크를 가지고 있는 경우, 10 개의 label 요소가 생성되어 vbox 요소의 아이 요소로서 추가되겠지요. 문서 트리의 주사에 DOM 함수를 사용하면, 이러한 요소를 찾아내 프롭퍼티를 조사할 수 있습니다. 이러한 요소는 표시되는 한편, template 요소 자체는 문서 트리내에는 존재하는 것의 표시는 되지 않습니다. 더욱, 각 label의 id 속성은 그 항목의 RDF 리소스로 설정됩니다.

-

내용 빌더는 항상 uri="rdf:*" 가 지정되었는데로부터 생성을 개시합니다. uri 속성이 요소 트리에 대해 하위의 요소에게 줄 수 있는 경우, 상위의 요소는 한 번 밖에 작성되지 않습니다. 아래의 예에서는 hbox 가 1개 작성되어 그 내용은 항목 마다 생성되는 label로 채워질 수 있게 됩니다.

-
<template>
-  <hbox>
-    <label uri="rdf:*" value="rdf:http://home.netscape.com/NC-rdf#Name"/>
-  </hbox>
-</template>
-
-

데이터소스 속성을 가지는 요소내에 존재하지만 템플릿의 외측에 있는 내용도 표시됩니다. 이와 같이, 템플릿에 대해 정적인 내용과 동적인 내용을 혼합할 수가 있습니다.

-

한편, 트리빌더는 항목 마다 DOM 요소를 생성할 것은 없습니다. 그 대신 필요가 생길 때에 RDF 데이터소스로부터 데이터를 직접 취득합니다. 트리는 몇천줄의 항목을 표시하는 것이 되고 있으므로 이 편이 효율적인 것입니다. 셀의 하나하나에 대해서 요소를 생성하는 것은 비용이 너무 비싸게 듭니다. 다만, 트리에서는 텍스트 밖에 표시할 수 없습니다. [역주:8.1 절 「트리」에서는 트리는 화상도 내용으로서 포함할 수 있다고 기록되고 있다. ] 더욱, 요소는 생성되지 않기 때문에 트리의 셀에 대한 스타일에 CSS 프롭퍼티를 이용하는 것은 통상의 방법에서는 할 수 없습니다.

-

트리빌더는 트리에 대해서만 이용됩니다. 다른 요소에서는 콘텐츠빌더만 이용됩니다만, 이것은 특히 문제가 되는 것이 아닙니다. 메뉴등의 다른 요소에는 그러한 다수의 항목을 표시하는 것은 상정되어 있지 않기 때문입니다. 내용빌더를 트리에 이용하는 일도 가능하여 treeitem 요소와 관련하는 요소가 항목 마다 작성됩니다.

-

-

전에 언급한 예에 있어서 화상에서는 3번째의 버튼에는 하이픈만이 표시되고 있는 것을 알 것입니다. 이것은 북마크의 리스트에 있어서의 separator 입니다. 지금까지의 이용과 같이 RDF 북마크 데이터 소스도 마치 통상의 북마크와 같게 separator를 공급합니다. separator의 리소스에 대해서는 사실은 버튼의 대신에 작은 틈새를 두고 싶었습니다만. 즉, 통상의 북마크와 separator에 대해 다른 종류의 내용을 작성시키고 싶은 것입니다.

-

이것을 실시하려면 rule 요소를 이용합니다. 작성시키고 싶은 요소의 종류 마다 룰을 정의합니다. 여기의 예에서는 북마크에 대한 룰과 separator에 대한 룰이 필요하게 됩니다. 어느 룰을 어느 RDF 리소스에 적용할까는 rule 요소에 나누어주는 속성에 의해 정해집니다.

-

어느 룰을 데이터에 적용할까를 주시하는 과정에 대해서는 각 rule 요소에 대해 합치할지 어떨지가 차례로 조사할 수 있습니다. 즉, 룰을 정의하는 차례가 중요하게 됩니다. 먼저 정의되고 있는 룰이 다음에 정의되고 있는 룰보다 우선됩니다.

-

다음의 예는 이전의 예에 2개의 룰을 더한 것입니다.

-

Example 9.2. 4: 소스

-
<window
-  id="example-window"
-  title="Bookmarks List"
-  xmlns:html="http://www.w3.org/1999/xhtml"
-  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <vbox datasources="rdf:bookmarks" ref="NC:BookmarksRoot" flex="1">
-   <template>
-
-    <rule rdf:type="http://home.netscape.com/NC-rdf#BookmarkSeparator">
-     <spacer uri="rdf:*" height="16"/>
-    </rule>
-
-    <rule>
-      <button uri="rdf:*" label="rdf:http://home.netscape.com/NC-rdf#Name"/>
-    </rule>
-
-  </template>
- </vbox>
-
-</window>
-
-

2개의 룰을 이용하는 것으로써, 템플릿내의 내용은 선택적으로 생성되게 됩니다. 최초의 rule 요소에서는 rdf:type 속성으로 보여지도록, 북마크 separator가 선택됩니다. 후의 룰에서는 rule 요소에 어떤 속성도 나누어주어지지 않기 때문에, 모든 데이터가 일치합니다.

-

rule 태그에 놓여진 모든 속성이 일치 조건에 이용됩니다. 이 경우, 북마크 데이터 소스는 separator인가 어떤가를 구별할 수 있듯이 rdf:type 프롭퍼티를 공급하고 있습니다. 이 속성은, RDF 북마크 데이터 소스에 대해, separator에 대한 고유의 값으로 설정됩니다. 이것에 의해 separator가 아닌 것이라는 구별을 붙일 수 있게 됩니다. 동일한 기법은 RDF 의 Description 요소에게 줄 수 있고 있는 임의의 속성에 대해 적용할 수가 있습니다.

-

위의 예의 최초의 룰로 주어지고 있는 특별한 URL 값은 separator에게 이용되는 것입니다. 즉, separator에 대해서는 최초의 룰에 따라 16 픽셀의 틈새를 비우는 spacer 요소가 생성됩니다. separator가 아닌 모든 요소에 대해서는 최초의 룰에 일치하지 않고 후의 룰에 따르게 됩니다. 후의 룰에서는 속성이 일절 지정되어 있지 않기 때문에 모든 데이터에 일치하게 됩니다. 이것은 물론, 나머지의 데이터에 대해서 실시하고 싶었던 것입니다.

-

하나 더, RDF 네임스페이스( rdf:type )으로부터 속성을 꺼내고 싶었기 때문에 네임스페이스 선언을 window 태그에 부가할 필요가 있었던 것에 깨닫았을 것입니다. 이것을 해 두지 않으면 속성은 XUL 네임스페이스에 포함되는 것이라고 보여져 버립니다. 물론 거기에는 존재하지 않기 때문에, 룰은 합치하지 않게 됩니다. 자기 부담의 네임스페이스의 속성을 이용하는 경우도 룰에 일치시키기 위해서는 이름 공간 선언이 필요하게 됩니다.

-

2번째의 룰이 제거되었을 때에 무엇이 일어날까는 상상이 붙겠지요. 그 결과는 다만 separator 1개가 표시되는 것만으로 있어, 북마크는 합치하는 룰이 없기 때문에 표시되지 않습니다.

-

간단하게 말하면, rule 요소에 나누어주어진 모든 속성이 RDF 리소스의 대응하는 속성에 일치할 때 룰이 일치한다고 하는 것입니다. RDF 파일의 경우는 리소스는 Description 요소가 됩니다.

-

다만, 소수의 예외가 있습니다. 속성 id, rdf:property, rdf:instanceOf 에는 일치시킬 수가 없습니다. 어쨌든, 자기 부담의 속성을 자기 부담의 네임스페이스에서 준비하면 끝나는 것이므로, 문제가 되는 것은 없을 것입니다.

-

최초의 룰이 존재하지 않는 템플릿에 대해서는, 실제는 속성을 가지지 않는 다만 하나의 룰이 지정되고 있는 것이라고 되는 것에 주의해 주세요.

-

다음절에서는 트리에 대한 템플릿의 이용을 살펴보고 갑니다.

-

-

« 이전다음 »

-

diff --git a/files/ko/mozilla/tech/xul/xul_tutorial/the_box_model/index.html b/files/ko/mozilla/tech/xul/xul_tutorial/the_box_model/index.html deleted file mode 100644 index c5c3d5fa1d..0000000000 --- a/files/ko/mozilla/tech/xul/xul_tutorial/the_box_model/index.html +++ /dev/null @@ -1,118 +0,0 @@ ---- -title: The Box Model -slug: Mozilla/Tech/XUL/XUL_Tutorial/The_Box_Model -tags: - - XUL - - XUL_Tutorial -translation_of: Archive/Mozilla/XUL/Tutorial/The_Box_Model ---- -

-

« 이전다음 »

-

-

이 단원에서는, XUL이 레이아웃을 어떻게 처리하는지에 대해 알아보겠습니다.

-

상자 소개

-

XUL에서 레이아웃의 주된 형식은 '상자모델'이라고 하는 것입니다. 이 모델은 창을 여러개의 상자로 분할 할 수 있도록 해 줍니다. 상자 내부의 요소는 가로 또는 세로 orient(방향)을 가지게 됩니다. 여러개의 상자와 공백, flex속성을 가진 요소들을 묶음으로써, 창의 레이아웃을 제어할 수 있습니다.

-

상자는 XUL의 요소들을 배치하기 위해 가장 중요한 부분이지만, 몇 가지 단순한 규칙만을 가집니다. 상자는 가로 또는 세로 두 방향 중 하나의 형태로 자식이 배치되도록 할 수 있습니다. 가로상자는 상자에 포함된 요소를 가로 방향으로 세로 상자는 세로 방향으로 정렬시킵니다. 여러분은 상자를 HTML 테이블의 행 또는 열로 생각하실 수 있습니다. CSS 스타일 속성과 더불어 자식 요소에 사용되는 여러 속성은 자식 요소의 위치와 크기를 정확하게 제어할 수 있게 해 줍니다.

-

상자 요소들

-

상자의 기본 구문은 다음과 같습니다.

-
<hbox>
-  <!-- horizontal elements -->
-</hbox>
-
-<vbox>
-  <!-- vertical elements -->
-</vbox>
-
-

hbox 요소는 가로 방향의 상자를 만드는 데 사용됩니다. hbox에 포함되는 요소들은 하나의 행 안에 수평적으로 배치됩니다. vbox 요소는 세로 방향의 상자를 만드는 데 사용됩니다. 상자에 추가되는 요소들은 아래쪽으로 배치됩니다.

-

또한 가로 방향을 기본으로 하는 기본적인 box 요소가 존재하는데, 이것은 hbox와 같은 역할을 한다는 의미입니다. 그렇다 하더라도, 상자의 방향을 제어하기 위해서 orient 속성을 사용할 수 있습니다. 이 속성을 이용하면 가로 상자를 만들기 위해서는 horizontal값을 세로 상자는 vertical값을 설정하면 됩니다.

-

따라서 다음의 두 줄은 동일한 것입니다.

-
<vbox></vbox>
-
-<box orient="vertical"></box>
-
-

다음의 예제는 3개의 버튼을 세로로 나타내는 방법을 보여주고 있습니다.

-

예제 1 : Source View

-
- Image:boxes-ex1.png
-
<vbox>
-  <button id="yes" label="Yes"/>
-  <button id="no" label="No"/>
-  <button id="maybe" label="Maybe"/>
-</vbox>
-
-

여기에 있는 3개 버튼은 상자가 지시한 대로 세로 방향으로 배치되어 있습니다. 버튼을 가로 방향으로 배치되도록 하려면 vboxhbox로 변경하기만 하면 됩니다.

-

로그인 대화상자 예제

-

여러분은 다른 상자를 포함해서 상자내에 원하는데로 많은 요소를 추가할 수 있습니다. 가로 상자의 경우에, 추가되는 요소는 이전 요소의 오른쪽에 놓이게 됩니다. 상자에 포함된 요소들은 다음 줄로 넘어가지 않기 때문에, 요소를 추가하면 창의 너비가 그 만큰 넓어지게 됩니다. 마찬가지로, 세로상자에 추가된 요소는 이전 요소의 아래에 놓이게 됩니다. 아래는 간단한 로그인 대화상자 예제입니다.

-

예제 2 : Source View

-
- Image:boxes-ex2.png
-
<vbox>
-  <hbox>
-    <label control="login" value="Login:"/>
-    <textbox id="login"/>
-  </hbox>
-  <hbox>
-    <label control="pass" value="Password:"/>
-    <textbox id="pass"/>
-  </hbox>
-  <button id="ok" label="OK"/>
-  <button id="cancel" label="Cancel"/>
-</vbox>
-
-

위 예제에서는, 2개의 hbox 태그와 2개의 button 요소, 총 4개 요소가 세로 방향으로 배치되어 있습니다. 주의할 것은 상자의 바로 아래 자식 요소만 세로 방향으로 처리된다는 점입니다. 라벨과 글상자는 안쪽 hbox 요소 내부에 있기 때문에, 이들 상자의 방향인 가로 방향에 따라 배치되어 있습니다. 각 라벨과 글상자가 가로 방향으로 배치되어 있는 것을 그림에서 확인하실 수 있습니다.

-
글상자 정렬
-

로그인 대화상자의 그림을 자세히 보면, 2개의 글상자가 정렬되어 있지 않은 것을 볼 수 있습니다. 아마도 정렬되어 있다면 더 보기 좋을 것입니다. 이 작업을 위해서는 몇 가지 상자를 추가해 주어야 합니다.

-

예제 3 : Source View

-
- Image:boxes-ex3.png
-
<vbox>
-  <hbox>
-    <vbox>
-      <label control="login" value="Login:"/>
-      <label control="pass" value="Password:"/>
-    </vbox>
-    <vbox>
-      <textbox id="login"/>
-      <textbox id="pass"/>
-    </vbox>
-  </hbox>
-  <button id="ok" label="OK"/>
-  <button id="cancel" label="Cancel"/>
-</vbox>
-
-

이제 글상자가 어떻게 정렬되었는지 주의깊게 보시기 바랍니다. 이렇게 하기 위해 우리는 주 상자 내에 또 다른 상자를 추가해야 했습니다. 원래는 2개의 라벨과 글상자가 가로 상자 내부에 위치하고 있었습니다. 그런데 이번에는 라벨을 모두 하나의 수직 상자에, 글상자도 모두 하나의 수직 상자에 포함되어 있습니다. 여기서 사용한 수직 상자가 각 요소들을 수직으로 정렬시킵니다. 수평 상자는 라벨을 포함하는 수직 상자와 글상자를 포함하는 수직 상자를 수평적으로 배치하기 위해 사용되었습니다. 만일 이 수평 상자를 없애면 글상자는 모두 라벨의 아래에 위치하게 될 것입니다.

-

이제 남은 문제는 'Password' 라벨이 오른쪽에 있는 글상자에 비해 너무 높이 위치해 있다는 점입니다. 이 문제를 해결하려면 grid 라는 요소를 사용할 수 밖에 없는데, 이에 대해서는 이후 단원에서 배우게 될 것입니다.

-
-

우리의 파일 찾기 대화창 예제

-

파일 찾기 대화창에 몇 가지 상자를 추가해 보겠습니다. 모든 요소를 포함하도록 제일 바깥쪽에 세로 상자를 추가하고, 글상자와 버튼 주변에 가로상자를 추가하겠습니다. 이렇게 하면 버튼이 글상자 아래에 나타나게 될것입니다.

-
<vbox flex="1">
-
-  <description>
-    Enter your search criteria below and select the Find button to begin
-    the search.
-  </description>
-
-  <hbox>
-    <label value="Search for:" control="find-text"/>
-    <textbox id="find-text"/>
-  </hbox>
-
-  <hbox>
-    <spacer flex="1"/>
-
-    <button id="find-button" label="Find"/>
-    <button id="cancel-button" label="Cancel"/>
-  </hbox>
-</vbox>
-
-
- Image:boxes1.png
-


- 세로상자는 메인 텍스트와 글상자를 포함한 상자와 버튼을 포함한 상자를 세로 방향으로 배치되게 해 줍니다. 안쪽의 수평 상자들은 그들이 포함한 요소들을 수평적으로 배치되게 해 줍니다. 그림에서 보듯이, 라벨과 글상자는 나란히 놓여 있습니다. 공백요소와 2개의 버튼 또한 상자에서 가로로 배치되어 있습니다. spacer 요소가 flex 속성을 지정하고 있기 때문에, 버튼들이 오른쪽에 붙어있다는 점에 주목하세요.

-

여태까지의 예제: Source View

-
-

다음 섹션에서는, 요소들의 크기를 지정하고 크기에 제한을 주는 방법에 대해 알아 보겠습니다.

-

-

« 이전다음 »

-

-

diff --git a/files/ko/mozilla/tech/xul/xul_tutorial/the_chrome_url/index.html b/files/ko/mozilla/tech/xul/xul_tutorial/the_chrome_url/index.html deleted file mode 100644 index 51136bcd49..0000000000 --- a/files/ko/mozilla/tech/xul/xul_tutorial/the_chrome_url/index.html +++ /dev/null @@ -1,45 +0,0 @@ ---- -title: The Chrome URL -slug: Mozilla/Tech/XUL/XUL_Tutorial/The_Chrome_URL -tags: - - XUL - - XUL_Tutorial -translation_of: Archive/Mozilla/XUL/Tutorial/The_Chrome_URL ---- -

-

« 이전다음 »

-

-

이번 섹션에서는 XUL 문서와 다른 chrome 파일을 참조하는 방법을 설명합니다.

-

Chrome URL

-

XUL 파일은 HTML 파일처럼 일반적인 HTTP URL(또는 어떤 형태의 URL이든)로 참조될 수 있습니다. 그러나 Mozilla의 chrome 시스템에 설치된 꾸러미는 특별한 chrome URL로 참조될 수 있습니다. Mozilla에 포함된 꾸러미들은 미리 설치되어 있는 것들이지만 여러분은 여러분의 것을 등록할 수 있습니다.

-

설치된 꾸러미는 보안 제한사항에 구애받지 않는다는 장점을 가지는데, 이것은 많은 응용프로그램에 필요한 것입니다. 다른 URL 타입에 대한 또 다른 장점은 이것들이 다중 테마와 로케일을 자동으로 처리한다는 점입니다. 예를 들어 chrome URL은 여러분이 현재 사용중인 테마가 무엇인지 몰라도 테마에 포함된 이미지와 같은 파일을 참조하도록 해 줍니다. 각 테마내 파일 이름이 같다면 여러분은 chrome URL을 이용해서 파일을 참조할 수 있습니다. Mozilla는 파일이 어디에 위치하는지 결정하는데 신경 쓸 것이고 올바른 데이터를 반환할 것입니다. 이는 꾸러미가 이에 접근하기 위해 설치되어 있는 장소에 구애받지 않는다는 것을 의미합니다. Chrome URL은 파일들의 물리적인 위치에 독립적입니다. 이는 파일의 위치와 관련된 많은 부분을 신경 쓰지 않고도 다수의 파일을 가진 응용프로그램을 작성하기 쉽게 만들어 줍니다.

-

Chrome URL의 기본 구문은 다음과 같습니다.

-
chrome://<package name>/<part>/<file.xul>
-
-

<package name>은 messenger나 editor와 같은 꾸러미 이름을 가리킵니다. <part>는 'content', 'skin', 'locale' 중에 하나가 될 수 있으며 여러분이 원하는 것에 따라 달라집니다. 'file.xul'은 그냥 파일 이름입니다.

-

Example: chrome://messenger/content/messenger.xul

-

위의 예제는 메신저 창을 가리킵니다. 여러분은 부분(part)에 해당하는 'content'를 'skin'으로 변경하고 파일명을 바꾸기만 하면 파일을 가리킬 수 있습니다. 비슷하게 'content' 대신 'locale'을 사용하면 로케인 부분의 파일을 가리킬 수 있습니다.

-

여러분이 chrome URL을 열면, Mozilla는 설치된 꾸러미 리스트를 조사하여 꾸러미 이름과 부분(part)이 일치하는 JAR 파일이나 디렉토리를 위치시키려고 합니다. Chrome URL과 JAR 파일들간의 연결은 chrome 디렉토리에 저장되어 있는 선언 파일에 명시되어 있습니다. 여러분이 messenger.jar 파일을 다른 곳으로 옮기더라도 선언 파일을 이에 맞게 수정한다면, Thunderbird는 특정 설치 위치에 의존하지 않기 때문에 정상적으로 동작합니다. Chrome URL을 사용함으로써 이와 같은 세부 사항은 Mozilla가 처리하도록 할 수 있습니다. 이와 유사하게, 사용자가 테마를 바꾸더라도 chrome URL의 'skin' 부분이 다른 파일들로 번역되고 따라서 XUL과 스크립트는 수정할 필요가 없게 됩니다.

-

아래 몇가지 예제가 있습니다. 어떠한 URL도 어떤 테마나 로케일을 사용하는지 명시하지 않았고 특정 디렉토리 또한 명시되지 않았음을 잘 보세요.

-
chrome://messenger/content/messenger.xul
-chrome://messenger/content/attach.js
-chrome://messenger/skin/icons/folder-inbox.gif
-chrome://messenger/locale/messenger.dtd
-
-

하위 디렉토리를 참조하기 위해서는 chrome URL의 끝에 하위 디렉토리를 붙여 주기만 하면 됩니다. 다음 URL들은 북마크 창을 참조하는 것으로 꾸러미 이름이 Mozilla Suite와 Firefox에서 서로 틀리기 때문에 모두 열거하였습니다.

-
chrome://communicator/content/bookma...rksManager.xul (Mozilla)
-chrome://browser/content/bookmarks/b...rksManager.xul (Firefox)
-
-

여러분은 일반적인 URL이 사용되는 어디서나 chrome URL을 사용할 수 있습니다. 여러분은 Mozilla 브라우저 창의 URL 바에도 직접 입력할 수 있습니다. 만일 브라우저의 주소 영역에 위에서 언급한 URL 중의 하나를 입력하면, 웹 페이지가 출력되는 것과 같이 창이 출력되는 것을 보게 될 것이고, 별도의 창인 것처럼 대부분의 기능들이 동작합니다. 그러나 어떤 대화상자들은 올바로 작동하지 않을 수도 있는데 이는 그들이 열릴 때 윈도우에서 특정 인자(argument)를 제공해야 할 필요가 있기 때문일 수도 있습니다.

-

여러분은 다음과 같이 파일명을 명시하지 않은 chrome URL을 볼 수도 있습니다.

-
chrome://browser/content/
-
-

이 경우에는 꾸러미 이름과 부분(part)만이 명시되어 있습니다. 이런 종류의 참조는 자동으로 올바른 디렉토리에서 적절한 파일이 선택됩니다. Content일 경우에는 꾸러미 이름과 동일한 이름인 xul 확장자를 가진 파일이 선택됩니다. 위의 예제에서는 browser.xul 파일이 선택됩니다. messenger일 경우에는 messenger.xul 파일이 선택될 것입니다. 여러분의 응용 프로그램을 만들 때는 짧은 형태를 사용하여 참조할 수 있도록 메인 윈도우에 해당하는 파일을 꾸러미 이름과 동일하게 만들고자 할 것입니다. 이렇게 하면 사용자는 꾸러미 이름만 알면 되므로 응용프로그램을 여는데 수월해 집니다. 물론, 확장 기능과 같이 브라우저의 인터페이스를 수정하는 경우에는 UI를 통해 자신을 표현하기 때문에 사용자가 URL을 꼭 알 필요가 없습니다.

-

스킨인 경우에는 <package name>.css 파일이 선택되고, 로케일에서는 <package name>.dtd가 선택됩니다.

-

Chrome URL은 디스크 상의 위치와 관련 없다는 것을 기억하세요. Chrome URL의 앞 두 부분은 꾸러미 이름과 부분(part)(content, skin, locale 중 하나)입니다. 컨텐츠 파일은 보통 'content'라는 디렉토리에 넣지만 이건 관습적인 것일 뿐이고, 이러한 파일들이 완전히 다른 구조에 위치해도 상관없습니다.

-

다음 섹션에서는 .manifest 파일과 꾸러미를 어떻게 만드는지 알아볼 것입니다.

-

-

« 이전다음 »

-

-

Interwiki Language Links

-

diff --git a/files/ko/mozilla/tech/xul/xul_tutorial/toolbars/index.html b/files/ko/mozilla/tech/xul/xul_tutorial/toolbars/index.html deleted file mode 100644 index 157184118b..0000000000 --- a/files/ko/mozilla/tech/xul/xul_tutorial/toolbars/index.html +++ /dev/null @@ -1,107 +0,0 @@ ---- -title: Toolbars -slug: Mozilla/Tech/XUL/XUL_Tutorial/Toolbars -tags: - - XUL - - XUL_Tutorial -translation_of: Archive/Mozilla/XUL/Tutorial/Toolbars ---- -

-

« 이전다음 »

-

- -

툴바(toolbar)는 보통 창의 상단에 위치하면서 일반적인 기능을 수행하는 여러 버튼을 포함합니다. XUL은 툴바를 만드는 방법을 제공합니다.

- -

툴바 추가하기

- -

다른 요소들처럼 XUL 툴바도 상자 유형 중 하나입니다. 보통 툴바에는 버튼들이 놓여지지만, 어떤 요소도 툴바에 놓을 수 있습니다. 예를 들어, Mozilla 브라우저에는 페이지 URL을 표시하는 글상자를 포함한 툴바가 있습니다.

- -

툴바는 창내의 가로 혹은 세로 어떤 방향으로도 위치될 수 있습니다. 물론 글상자를 세로 툴바에 두지는 않을 것입니다. 사실 툴바는 그냥 상자이기 때문에 원하는 곳 어디든 위치할 수 있으며, 창의 중앙에도 배치할 수 있습니다. 그러나 대개 툴바들은 창의 상단에 나타나는게 보통입니다. 여러개의 툴바가 순서대로 위치하면, 보통 '툴박스(toolbox)'라고 불리는 것으로 묶게 됩니다.

- -

툴바의 좌측면에는 작은 무늬(notch)가 있는데, 이것을 클릭하면 툴바가 접혀지고 무늬만 보이게 됩니다. 무늬는 '그리피(grippy)'라고도 부릅니다. 여러개의 툴바가 하나의 툴박스 내에 있을때, 그리피들을 클릭하면 한 줄로 닫힙니다. 이렇게 해서 툴바가 사용하는 공간을 줄이게 됩니다. 세로 방향의 툴바는 상단 모서리에 그리피가 있습니다. 일반적으로, 사용자들은 메인 윈도우의 공간을 넓히기 위해 툴바를 닫습니다.

- -
toolbox 안에 있는 간단한 toolbar
- -

Source View

- -
Image:toolbar1.jpg
- -
<toolbox>
-  <toolbar id="nav-toolbar">
-    <toolbarbutton label="Back"/>
-    <toolbarbutton label="Forward"/>
-  </toolbar>
-</toolbox>
-
- -

이 예제는 뒤로가기(Back)와 앞으로가기(Forward) 버튼을 가진 툴바를 만듭니다. 하나의 툴바가 툴박스내에 위치하고 있습니다. 툴바와 관련하여 4가지 새로운 태그가 있는데 각 내용은 다음과 같습니다.

- -
-
toolbox
-
툴바를 포함하는 상자.
-
- -
-
toolbar
-
버튼과 같은 툴바 아이템을 포함하는 하나의 툴바. 툴바는 왼쪽 혹은 위쪽에 있는 그리피를 사용하여 접을 수 있습니다..
-
- -
-
toolbarbutton
-
툴바에 있는 버튼으로 일반 버튼과 동일한 기능을 가지고 있지만 조금 다르게 출력됩니다.
-
- -
-
toolbargrippy
-
이 요소는 툴바를 접거나 여는데 사용되는 무늬를 만듭니다. 자동으로 추가되기 때문에 직접 사용할 필요는 없습니다.
-
- -

toolbar는 실제 툴바를 만드는 메인 요소입니다. 일반적으로 툴바에는 버튼들이 포함되는데 다른 요소들도 넣을 수 있습니다. 툴바는 id 속성을 가지는게 좋으며, 그렇지 않으면 접거나 펼칠 수 없게 될 수도 있습니다.

- -

위 예제에서는 단지 한개의 툴바만 작성되었습니다. 첫 번째 툴바 다음에 toolbar요소를 더 추가해서 다중 툴바도 쉽게 만들 수 있습니다.

- -

toolbox는 툴바의 컨테이너입니다. 일부 응용프로그램에서는 창의 상단에 여러개의 툴바가 있을 것입니다. 이들 모두를 toolbox 안에 넣을 수 있습니다.

- -

여러분은 toolbar 요소를 toolbox 안에 넣어야 하는 것은 아닙니다.

- -

툴박스에 있는 그리피

- -
주의: Firefox에는 toolbargrippy 요소가 없습니다.
- -

툴박스에 있는 그리피들은 toolbargrippy라는 요소를 이용해서 작성됩니다. 그리피의 목적이 툴바를 접기 위한 것이기 때문에, 툴바 밖에서 이 요소를 사용하는 것은 아무 의미가 없습니다. 그러나 좀 다른 스타일을 원할 수 도 있습니다. 여러분은 toolbar 요소의 grippyhidden 속성을 true로 설정하면 그리피를 숨길 수 있습니다.

- -
-

동일 툴바들이지만 두 개는 접혀 있습니다.
- Image:toolbar3.jpg

-
- -

3개의 툴바를 가진 툴박스
- Image:toolbar2.jpg

- -
-

우리의 파일 찾기 예제

- -

파일 찾기 대화창에 툴바를 넣어 보겠습니다. 사실 툴바가 꼭 필요한 것은 아니지만 설명을 위해서 추가할 것입니다. 2개의 버튼이 추가될 것인데, 열기(Open)와 저장(Save) 버튼입니다. 아마도 이것들은 사용자가 검색 결과를 저장하고 나중에 다시 열어볼 수 있게 해줄 것 같습니다.

- -
<vbox flex="1">
-  <toolbox>
-    <toolbar id="findfiles-toolbar">
-      <toolbarbutton id="opensearch" label="Open"/>
-      <toolbarbutton id="savesearch" label="Save"/>
-    </toolbar>
-  </toolbox>
-  <tabbox>
-
- -
Image:toolbar5.png
- -

2개의 버튼을 가진 툴바가 추가되었습니다. 그림에서 여러분은 툴바가 상단에 가로방향으로 나타나 있는 것을 볼 수 있습니다. 그리피 또한 툴바의 왼쪽면에 보입니다. 주목할 점은 툴바가 세로 상자 내 탭상자 바로 위의 위치하고 있다는 것입니다. 이것은 툴바가 모든 것보다 앞에 나타나도록 하기 위해 세로방향을 사용했기 때문입니다.

- -

지금까지의 파일 찾기 예제 : Source View

-
- -

다음에는 창에 메뉴바를 넣는 방법에 대해 알아보겠습니다.

- -

-

« 이전다음 »

-

diff --git a/files/ko/mozilla/tech/xul/xul_tutorial/trees/index.html b/files/ko/mozilla/tech/xul/xul_tutorial/trees/index.html deleted file mode 100644 index 23e3afa192..0000000000 --- a/files/ko/mozilla/tech/xul/xul_tutorial/trees/index.html +++ /dev/null @@ -1,166 +0,0 @@ ---- -title: Trees -slug: Mozilla/Tech/XUL/XUL_Tutorial/Trees -tags: - - XUL - - XUL_Tutorial -translation_of: Archive/Mozilla/XUL/Tutorial/Trees ---- -

 

-

-

« 이전다음 »

-

-

XUL은 tree를 사용하여 표형태 또는 계층목록을 만드는 방법을 제공합니다.

-

트리

-

tree에서 가장 복잡한 요소중 하나가 tree입니다. listbox처럼, tree는 항목을 만드는 데 사용할 수 있습니다. tree 요소는 계층적 목록 또는 표를 만들 수도 있습니다. 예를 들어 메일 프로그램에서 메시지 목록, 또는 모질라의 북마크 편집창을 tree를 사용하여 만들 수 있습니다.

-

어떤 측면에서 tree는 listbox와 유사합니다. 둘다 다중 행과 열을 가진 표를 만드는 데 사용할 수 있으며, 둘다 열 머릿말(header)을 담을 수 있습니다. tree는 안쪽(netsted) 행을 지원하지만, listbox는 그렇지 않습니다. 하지만, listbox는 어떤 형태의 내용도 담을 수 있습니다. 반면 tree는 글과 그림 내용만 담을 수 있습니다. listbox는 단순하게 처리할 경우, tree에 대한 대안으로 만들어졌기 때문에, 필요한 경우 대신 사용할 수 있습니다. (프로그레스 바나 체크 박스 같은 경우 트리에 추가할 수 있습니다.)

-

tree는 칼럼 세트와 tree body 두 가지 부분으로 나누어 집니다. A tree consists of two parts, the set of columns, and the tree body.

- -

elements, one for each column. Each column will appear as a header at the top of the tree.

- -

The tree is unique in that the body of the tree consists only of a single widget which draws all of the data in the tree. This contrasts with the listbox, where individual listitem and listcell tags are used to specify the rows in the listbox. In a tree, all of the data to be displayed is supplied by a separate object, called a tree view. When it comes time to display a cell, the tree widget will call out to this tree view to determine what to display, which in turn will be drawn by the tree. The tree is smart enough to only ask for information from the view for those rows that need to be displayed. This allows the view to be optimized such that it only needs to load the data for displayed content. For instance, a tree might have thousands of rows, yet most of them will be scrolled off the border of the tree, hidden from view. This means that the tree is scalable to any number of rows without any performance problems. Of course, this is independant of the performance of the view object itself.

-

A tree view is an object which implements the nsITreeView interface. This interface contains thirty properties and functions which you may implement. These functions will be called by the tree as necessary to retrieve data and state about the tree. For instance, the getCellText() function will be called to get the label for a particular cell in the tree.

-

An advantage of using a tree view is that it allows the view to store the data in a manner which is more suitable for the data, or to load the data on demand as rows are displayed. This allows more flexibility when using trees.

-

Naturally, having to implement a tree view with thirty or so properties and methods for every tree can be very cumbersome, especially for simple trees. Fortunately, XUL provides a couple of built-in view implementations which do most of the hard work for you. For most trees, especially when you first start to use trees, you will use one of these built-in types. However, you can create a view entirely from scratch if necessary. If you do, you might store the data in an array or JavaScript data structure, or load the data from an XML file.

-

Since the entire body of the tree is a single widget, you can't change the style of individual rows or cells in the normal way. This is because there are no elements that display the individual cells, like there is with the listbox. Instead, all drawing is done by the tree body using data supplied by the view. This is an important point and many XUL developers have trouble understanding this aspect. To modify the appearance of a tree cell, the view must instead associate a set of keywords for a row and cell. A special CSS syntax is used which styles components of the tree body with those keywords. In a sense, it is somewhat like using CSS classes. Tree styling will be discussed in detail in a later section.

-

Tree 요소

-

Trees can be created with the tree element, which is described in the following sections. There are also two elements used to define the columns to be displayed in the tree.

-
-
- tree
-
- This is the outer element of a tree.
-
-
-
- treecols
-
- This element is a placeholder for a set of treecol elements.
-
-
-
- treecol
-
- This is used to declare a column of the tree. By using this element, you can specify additional information about how the data in the columns are sorted and if the user can resize the columns. You should always place an id attribute on a column, as Mozilla uses the ids to identify the columns when rearranging and hiding them. This is no longer required in Mozilla 1.8 and later, but it is still a good idea to use ids on columns.
-
-
-
- treechildren
-
- This contains the main body of the tree where the individual rows of data will be displayed.
-
-
두개 칼럼을 가진 트리
-

Source View

-
<tree flex="1">
-
-  <treecols>
-    <treecol id="nameColumn" label="Name" flex="1"/>
-    <treecol id="addressColumn" label="Address" flex="2"/>
-  </treecols>
-
-  <treechildren/>
-
-</tree>
-
-

First, the entire table is surrounded with a tree element. This declares an element that is used as a table or tree. As with HTML tables, the data in a tree is always organized into rows. The columns are specified using the treecols tag.

-

You may place as many columns as you wish in a tree. As with listboxes, a header row will appear with column labels. A drop-down menu will appear in the upper-right corner of the tree, which the user may use to show and hide individual columns. Each column is created with a treecol element. You can set the header label using the label attribute. You may also want to make the columns flexible if your tree is flexible, so that the columns stretch as the tree does. In this example, the second column will be approximately twice as wide as the first column. All of the columns should be placed directly inside a treecols element.

-

In this case we haven't specified a view to supply the tree's data, so we'll only see column headers and an empty tree body. You may have to resize the window to see anything since there isn't any data to display. Since the tree has been marked as flexible, the body will stretch to fit the available space. Making a tree flexible is quite commonly done, as it is often the case that the data in the tree is the most significant information displayed, so it makes sense to make the tree grow to fit. However, you may specify a specific number of rows to appear in a tree by setting the rows attribute on the tree element. This attribute specifies how many rows are displayed in the user interface, not how many rows of data there are. The total number of rows is supplied by the tree view. If there are more rows of data in the tree, a scrollbar will appear to allow the user to see the rest of them. If you don't specify the rows attribute, the default value is 0, which means that none of the rows will appear. In this case, you would make the tree flexible. If your tree is flexible, it doesn't need a rows attribute since it will grow to fit the available space.

-

The Content Tree View

-

Having said that the data to be displayed in a tree comes from a view and not from XUL tags, there happens to be a built-in tree view which gets its data from XUL tags. This may be a bit confusing, but essentially, one of the built-in tree views uses a set of tags which can be used to specify information about the data in the tree. The following tags are used:

-
-
- treeitem
-
- This contains a single parent row and all its descendants. This element also serves as the item which can be selected by the user. The treeitem tag would go around the entire row so that it is selectable as a whole.
-
-
-
- treerow
-
- A single row in the tree, which should be placed inside a treeitem tag.
-
-
-
- treecell
-
- A single cell in a tree. This element would go inside a treerow element.
-
-

Conveniently, these tags may be placed directly inside the treechildren tag, nested in the order above. The tags define the data to be displayed in the tree body. In this case, the tree uses the built-in tree view, called a content tree view, which uses the labels and values specified on these elements as the data for the tree. When the tree needs to display a row, the tree asks the content tree view for a cell's label by calling the view's getCellText function, which in turn gets the data from the label of the appropriate treecell.

-

However, the three elements listed above are not displayed directly. They are used only as the source for the data for the view. Thus, only a handful of attributes apply to the treeitem and related elements. For instance, you cannot change the appearance of the tree rows using the style attribute or with other CSS properties and the box related features such as flexibility and orientation cannot be used.

-

In fact, apart from some tree specific attributes, the only attributes that will have any effect will be the label attribute to set a text label for a cell and the src attribute to set an image. However, there are special ways of styling the tree and setting other features which we will see in later sections.

-

Also, events do not get sent to treeitem element and their children; instead they get sent to the treechildren element.

-

That the treeitems are unlike other XUL elements is a common source of confusion for XUL developers. Essentially, the tree content view is a view where the data for the cells is supplied from tags placed inside the tree. Naturally, if you are using a different kind of view, the data will be supplied from another source, and there won't be any treeitem elements at all.

-

Let's start by looking at how to create a simple tree with multiple columns using the tree content view. This could be used to create a list of mail messages. There might be multiple columns, such as the sender and the subject.

-

treechildren 예제

-

Source View

-
- Image:trees1.png
-
<tree flex="1">
-
-  <treecols>
-    <treecol id="sender" label="Sender" flex="1"/>
-    <treecol id="subject" label="Subject" flex="2"/>
-  </treecols>
-
-  <treechildren>
-    <treeitem>
-      <treerow>
-        <treecell label="joe@somewhere.com"/>
-        <treecell label="Top secret plans"/>
-      </treerow>
-    </treeitem>
-    <treeitem>
-      <treerow>
-        <treecell label="mel@whereever.com"/>
-        <treecell label="Let's do lunch"/>
-      </treerow>
-    </treeitem>
-  </treechildren>
-
-</tree>
-
-

그림에서 보듯이, 두개의 자료 열을 가진 tree가 만들어졌습니다.

-

이 tree는 두개의 열을 가지고 있고, 이 중 두번째는 첫번째보다 더많은 공간을 차지하게 되어있습니다. 이 경우 해당 열에 flex 속성을 줄 것입니다. CSS의 width 속성으로 넓이값을 줄 수도 있습니다. tree에 있는 열의 숫자만큼 treecol 요소를 포함시켜야 한다. 그렇지않으면 엉뚱한 일이 발생합니다.

-


- 머릿말 행(header row)은 자동으로 만들어집니다. 오른쪽 위에 있는 버튼은 해당 열을 숨기고 감출 수 있습니다. 이 버튼을 숨기고 싶다면 hidecolumnpicker 속성을 tree에 넣거나 true 값을 주면 됩니다. 각 열에 id 속성을 설정했는 지 또는 행의 숨김과 보기가 작동하는 지를 확인하도록 합니다.

-

Make sure that you set an id attribute on each column or the hiding and showing of columns will not work in all versions of Mozilla.

-

The treechildren element surrounds all of the rows. Inside the body are individual rows, which may in turn contain other rows. For a simpler tree, each row is created with the treeitem and treerow elements. The treerow element surrounds all of the cells in a single row, while a treeitem element would surround a row and all of its children. Trees with nested rows are described in the next section.

-

Inside the rows, you will put individual tree cells. These are created using the treecell element. You can set the text for the cell using the label attribute. The first treecell in a row determines the content that will appear in the first column, the second treecell determines the content that will appear in the second column, and so on.

-


- 사용자는 마우스로 항목을 클릭하거나 키보드를 사용해서, treeitem을 선택할 수 있습니다. Shift 또는 Control 키를 누른 상태에서 다른 행을 클릭해서 다중 항목을 선택할 수 있습니다. 다중선택을 사용 못하게 하려면, tree에 seltype 속성을 넣고, 값을 single로 합니다. 이렇게하면, 한번에 한 행만 선택할 수 있습니다.

-
-

찾은 파일에서 tree 추가

-

검색결과가 표시되도록 파일찾기(find files) 창에 tree를 추가해보자. 다음 코드는 iframe에 추가해야 한다. tree는 treeview를 사용합니다. 아래 코드는 iframe에 추가할 수 있습니다.

-
<tree flex="1">
-  <treecols>
-    <treecol id="name" label="Filename" flex="1"/>
-    <treecol id="location" label="Location" flex="2"/>
-    <treecol id="size" label="Size" flex="1"/>
-  </treecols>
-
-  <treechildren>
-   <treeitem>
-     <treerow>
-       <treecell label="mozilla"/>
-       <treecell label="/usr/local"/>
-       <treecell label="2520 bytes"/>
-     </treerow>
-   </treeitem>
-  </treechildren>
-</tree>
-
-<splitter collapse="before" resizeafter="grow"/>
-
-

파일명(filename), 위치(location) 그리고 파일크기(file size)라는 3개의 행을 가진 tree를 추가한 것입니다. 두번째 열은 더 큰 flex(flex="2")값을 가지고 있기 때문에 넓이가 2배가 됩니다. 하나의 행이 추가되었는 데, 하나의 행을 가진 표가 어떤 모습인지 설명하기 위한 것입니다. 실제 마무리 단계에서는, 검색했을 경우 해당 열은 스크립트에 의해 추가될 것입니다.

-

지금까지 예제는 Source View에서 보실 수 있습니다.

-
-


- 다음 장에서는 고급 tree 기능에 대해 알아 보겠습니다.

-

-

« 이전다음 »

-

-

diff --git a/files/ko/mozilla/tech/xul/xul_tutorial/using_spacers/index.html b/files/ko/mozilla/tech/xul/xul_tutorial/using_spacers/index.html deleted file mode 100644 index 34128c0e57..0000000000 --- a/files/ko/mozilla/tech/xul/xul_tutorial/using_spacers/index.html +++ /dev/null @@ -1,112 +0,0 @@ ---- -title: Using Spacers -slug: Mozilla/Tech/XUL/XUL_Tutorial/Using_Spacers -tags: - - XUL - - XUL_Tutorial -translation_of: Archive/Mozilla/XUL/Tutorial/Using_Spacers ---- -

-

« 이전다음 »

-

-

이 단원에는 우리가 만든 요소들 사이에 여백을 넣는 방법을 알아볼 것입니다.

-

여백(spacer) 넣기

-

사용자 인터페이스를 개발하는데 있어서의 문제점 중 하나는 사용자마다 서로 다른 화면 장치를 가진다는 것입니다. 어떤 사용자는 고해상도에 큰 화면을 가지고 있으며, 또 다른 사용자는 저해상도를 가지고 있을 수 있습니다. 더군다나, 다른 플랫폼은 사용자 인터페이스에 특별한 요구조건을 가지고 있을 수 있습니다. 다중 언어를 지원할 경우, 어떤 언어에 사용된 텍스트는 다른 언어보다 더 많은 공간이 필요할지도 모릅니다.

-

다중 플랫폼과 언어를 지원해야 하는 응용프로그램은 이를 위해 많은 여백을 가지는 창 배치를 합니다. 일부 플랫폼과 사용자인터페이스 툴킷은 사용자의 요구에 맞게 크기 조절과 위치 설정을 잘 처리하는 구성요소를 제공합니다. (예를 들어, 자바에서는 레이아웃 관리자를 사용합니다.)

-

XUL은 요소의 위치와 크기 재설정을 자동으로 처리할 수 있는 기능을 제공하고 있습니다. 앞서 본것 처럼, 파일 찾기 창은 내부 요소 크기에 맞게 표시되었습니다. 우리가 새로운 요소를 추가할 때마다 창 크기는 더욱 커졌습니다.

-

XUL은 '상자 모델(Box Model)'이라고 하는 레이아웃 시스템을 사용합니다. 이에 대해서는 다음 단원에서 언급할텐데, 이는 기본적으로 창을 요소를 포함한 일련의 상자로 나눌 수 있게 해줍니다. 상자는 사용자가 정의한 사양에 근거하여 위치와 크기를 조절하게 된다. 현재로써는, window 요소가 상자 형식이라는 것만 알도록 하자.

-

상자에 대한 세부 내용을 다루기 전에, 레이아웃에 유용한 또 다른 XUL 요소인 spacer를 소개할 것입니다. 여백(spacer)는 매우 단순하고 한가지 속성만을 필요로 하는데, 곧 설명하겠습니다. 가장 단순한 여백(spacer)은 다음과 같습니다.

-
<spacer flex="1"/>
-
-

spacer는 창에 공백을 넣는 데 사용됩니다. 공백 요소의 가장 유용한 점은 사용자가 창의 크기를 조절하는 것처럼 공백 자체가 늘어나거나 줄어들 수 있다는 것입니다. 창의 크기와 상관없이 버튼을 창의 오른쪽 또는 하단에 두면서 오른쪽 또는 하단 모서리에 고정시키는 것이라고 보면 됩니다. 앞으로 보겠지만, 수많은 레이아웃 효과를 주기 위해서 여러개의 공백 요소를 사용할 수 있습니다.

-

위의 구문에서, 공백 요소는 flex라는 한 가지 속성을 가지고 있습니다. 이것은 공백의 유연성을 정의하는 데 사용됩니다. 위의 경우에서, 공백은 1이라는 flex를 가집니다. 이것은 공백 요소를 신축성 있게 만들어 줍니다. 사용자가 직접 창 내부에 공백 요소를 위치시키면, 창의 크기가 변경됨에 따라 공백도 같이 늘어나게 됩니다.

-

잠시 후 파일찾기 대화창에 공백 요소를 추가할 것입니다. 그 전에 먼저 현재 대화창의 크기를 조절할 때 어떤일이 일어나는지 보도록 하겠습니다.

-

Image:springs1.jpg

-

파일찾기 창의 크기를 변경하더라도 포함된 요소들은 그것들의 원래 위치에 그대로 있는 것을 볼 수 있습니다. 창이 더 많은 공간을 가지게 되더라도, 이들 중 어느 것도 이동하거나 크기를 변경하지 않습니다. 글상자(text box)와 찾기(Fine) 버튼 사이에 공백 요소를 추가하였을 때는 어떻게 될지 보겠습니다.

-

Image:springs2.jpg

-

공백 요소를 추가하고 창 크기를 조절하면, 공백이 여백을 채우기 위해 확장되는 것을 볼 수 있습니다. 버튼들은 밀려나 위치하게 됩니다.

-
-
우리의 파일 찾기 예제
-

공백 요소를 추가한 코드는 아래와 같습니다. 해당 요소를 Find 버튼 앞에 삽입하세요.

-
<spacer flex="1"/>
-
-<button id="find-button" label="Find"/>
-
-
-

유연성에 대한 더 많은 것들

-

XUL은 요소에 적당한 넓이와 높이를 계산하여 여백을 추가하는 식으로 창에 있는 요소를 배치합니다. 사용자가 요소의 넓이와 높이에 대한 정보를 지정하지 않으면, 요소의 기본 크기는 내용에 의해 결정됩니다. 대화상자의 취소(Cancel) 버튼이 항상 기본 넓이로 설정되어 있어서 글에 맞출 수 있습니다. 매우 긴 라벨을 가진 버튼을 만든다면, 버튼의 기본 크기는 전체 라벨을 담기에 충분하게 커지게 됩니다. 글상자와 같은 다른 요소는 적당한 기본 크기를 선택한 것을 볼 수 있습니다.

-

flex 속성은 어떤 요소가 상자(이 경우, 창)에 맞출 수 있도록 크기 변경 여부를 지정하는 데 사용됩니다. 앞에서, 공백 요소에 적용된 flex 속성을 봤지만, 이 속성은 어떤 요소에도 적용할 수 있습니다. 예를 들어, 여러분은 아마 Find 버튼 크기가 수정되도록 하기를 원하실 수도 있습니다.

-

Image:springs3.jpg

-

그림에서 보는 것처럼, 찾기(Find) 버튼에 flex 속성을 지정하면, 창의 크기가 바뀌었을 때 버튼의 크기도 변경됩니다. 공백 요소는 특별한 것이 아니고 그냥 숨겨진 버튼이라고 생각하시면 됩니다. 이것은 화면에서 출력되지 않을 뿐이지, 버튼과 동일한 방식으로 동작합니다.

-

여러분이 위 그림에서 뭔가를 눈치챘을 지 모르겠습니다. 찾기(Find) 버튼의 크기가 커졌을 뿐만 아니라, 주 라벨과 버튼 사이에 약간의 여백이 나타난 것을 보실 수 있습니다. 당연한 것이지만, 이것은 앞에서 공백 요소를 넣은 것입니다. 공백 요소가 그 자체 크기를 조절한 것입니다. 자세히 보면, 변경되는 크기가 공백 요소와 버튼에 균등하게 나누어져 적용되는 것을 볼 수 있습니다. 여유 공간의 절반은 공백 요소에 나머지 절반은 버튼에 적용되는 것입니다.

-

이런 효과를 보는 이유는 공백 요소와 찾기(Find) 버튼 모두 flex 속성을 가지고 있기 때문입니다. 둘 다 flex을 가지기 때문에, 버튼과 공백 요소 모두 균일하게 크기를 변경한 것입니다.

-

만일 요소를 어떤 요소를 다른 것에 비해 두배 크기로 적용하려면 어떻게 할까? 그렇게 하려면 flex 속성값을 더 높은 숫자로 쓰면 됩니다. 요소의 flex 값은 비율을 나타냅니다. 만일 어떤 요소의 flex값이 1이고 다음 요소의 값은 2라면, 후자는 첫 번째의 두배 비율로 커지게 됩니다. 사실, flex 값이 2라는 것은 flex가 1인 요소 2개 가지고 있다고 말하는 것과 같습니다.

-

flex 속성은 실제 크기를 나타내기 위해 사용되는 것이 아닙니다. 대신 그것은 포함하는 상자의 자식들 중간에 어떻게 빈 공간을 넣을지를 나타내는 것입니다. 우리는 다음 섹션에서 상자에 대해 알아볼 것입니다. 상자의 자식들의 기본 크기가 정해지면 유연성 값(flex)은 상자 내의 빈 공간을 나누는데 사용됩니다. 예를 들어 상자의 너비가 200픽셀이고 두 개의 유연한 버튼(flex값을 가진 버튼)을 포함한 경우, 첫 번째 버튼이 50픽셀이고 다음 버튼은 90픽셀이면, 남은 공간은 60픽셀입니다. 만일 버튼 모두의 flex값이 1이면 각 버튼의 너비가 30픽셀씩 추가되어 나눠집니다. 만일 두번째 버튼의 flex값이 2로 증가하면, 첫번째 버튼은 20픽셀의 남은 공간을 두번째 버튼은 40픽셀의 추가 공간을 할당받게 됩니다.

-

flex 속성은 어떠한 요소에도 포함될 수 있지만 XUL 상자에 바로 포함되어 있는 요소에서만 의미가 있습니다. 이것은 HTML 요소에도 flex를 넣을 수 있지만, 해당 요소가 비상자(non-box) 요소의 내부에 있다면 아무 효과도 일어나지 않는다는 것을 의미합니다.

-
Flex 예제
-
예제 1:
-  <button label="Find" flex="1"/>
-  <button label="Cancel" flex="1"/>
-
-예제 2:
-  <button label="Find" flex="1"/>
-  <button label="Cancel" flex="10"/>
-
-예제 3:
-  <button label="Find" flex="2"/>
-  <button label="Replace"/>
-  <button label="Cancel" flex="4"/>
-
-예제 4:
-  <button label="Find" flex="2"/>
-  <button label="Replace" flex="2"/>
-  <button label="Cancel" flex="3"/>
-
-예제 5:
-  <html:div>
-    <button label="Find" flex="2"/>
-    <button label="Replace" flex="2"/>
-  </html:div>
-
-예제 6:
-  <button label="Find" flex="145"/>
-  <button label="Replace" flex="145"/>
-
-
-
- 예제 1 
-
- 이 경우 유연성(flexibility)은 두 버튼에서 균등하게 나뉘어집니다. 두 버튼은 균등하게 크기를 변경하게 됩니다.
-
- 예제 2 
-
- 이 경우, 두 버튼은 커지긴 하지만, Cancel 버튼의 flex값이 Find 버튼의 flex값보다 10배 크기 때문에, 찾기(Find) 버튼은 항상 취소(Cancel)버튼의 크기 증가값의 1/10 크기만큼만 변하게 됩니다. 가능한 공간은 1만큼의 Find 버튼 영역과 10만큼의 Cancel 버튼 영역으로 나누어지게 됩니다.
-
- 예제 3 
-
- 버튼 중 2개만이 유연하도록 표시되어 있습니다. Replace 버튼은 절대 크기가 변하지 않을 것이고, 나머지는 변할 것입니다. 취소(Cancel) 버튼은 항상 찾기(Find) 버튼의 두 배만큼 커지는데 이는 flex 값이 두배이기 때문입니다.
-
- 예제 4 
-
- 이 경우, 3개 모두 유연함을 가지고 있습니다. 찾기(Find)와 바꾸기(Replace) 버튼은 항상 같은 크기이지만 취소(Cancel)은 약간은 더 크게 됩니다(정확히 말하면 50% 더 커집니다).
-
- 예제 5 
-
- 여기서는 두 개 버튼이 div 요소내에 있습니다. 이처럼 버튼이 상자내에 직접 사용되지 않은 경우에는 flex의 의미가 없어집니다. 이 경우에는 flex가 없는 것과 동일한 효과를 보이게 됩니다.
-
- 예제 6 
-
- 두 버튼의 flex 값이 모두 같기 때문에, 동일하게 변합니다. flex에 145 대신 1값을 적용하더라도 동일하게 동작할 것입니다. 이 경우에는 전혀 차이가 없습니다. 여러분은 가독성을 위해서 가능한 낮은 숫자를 사용할 것을 권장합니다.
-
-

버튼의 라벨과 최소 크기 같은 다른 요인들이 버튼의 실제 크기에 영향을 준다는 점을 반드시 명심하세요. 예를 들어 버튼에 포함된 라벨이 필요로 하는 공간보다 작게는 줄어들지는 않을 것입니다.

-

flex값을 0으로 설정하는 것은 flex 속성을 사용하지 않은 것과 같은 효과를 나타냅니다. 이것은 해당 요소가 전혀 유연하지 않게 된다는 것을 의미합니다. 여러분은 때때로 flex 값을 백분률로 지정한 것을 볼 수도 있을 것입니다. 이것은 특별한 의미는 없고 백분률 기호(%)가 없는 것처럼 처리됩니다.

-

여러분은 파일 찾기 대화상자를 수직으로 크기 조절을 했을 때 버튼의 크기가 자동적으로 창의 높이에 맞게 늘어나는 것을 보실 수 있을 것입니다. 이것은, 모든 버튼들은 내부적으로 수직 flex가 지정되어 있기 때문입니다. 다음 섹션에서는 이것을 어떻게 수정할 수 있는지에 대해 공부하겠습니다.

-
-
여태까지의 파일 찾기 예제
-

Source View

-
-

다음에는 버튼의 부가적인 기능들에 대해 알아보겠습니다.

-

-

« 이전다음 »

-

-

diff --git a/files/ko/mozilla/tech/xul/xul_tutorial/xpcom_examples/index.html b/files/ko/mozilla/tech/xul/xul_tutorial/xpcom_examples/index.html deleted file mode 100644 index 4b3eaea401..0000000000 --- a/files/ko/mozilla/tech/xul/xul_tutorial/xpcom_examples/index.html +++ /dev/null @@ -1,132 +0,0 @@ ---- -title: XPCOM Examples -slug: Mozilla/Tech/XUL/XUL_Tutorial/XPCOM_Examples -tags: - - XUL - - XUL_Tutorial -translation_of: Archive/Mozilla/XUL/Tutorial/XPCOM_Examples ---- -

-

-

« 이전다음 »

-
-

본 단원에서는 몇가지 인터페이스와 함께 XPCOM를 이용하는 예제를 제공합니다. -

-

창 관리

-
-

본 예제에는 이후 단원에서 보게될 RDF 데이터소스에 대한 내용이 들어 있습니다. 따라서 이에 대한 지식이 없다면 넘어가도 괜찮습니다. -

-
-

창 메뉴 만들기

-

The list of currently open Mozilla windows can be used as an RDF datasource. This allows you to create a Window menu with a list of the currently open windows in the application. The datasource for this is rdf:window-mediator. We can use this as in the following example: -

Example 1 : Source -

-
<toolbox>
- <menubar id="windowlist-menubar">
-  <menu label="Window">
-   <menupopup id="window-menu" datasources="rdf:window-mediator" ref="NC:WindowMediatorRoot">
-    <template>
-     <rule>
-      <menuitem uri="rdf:*" label="rdf:http://home.netscape.com/NC-rdf#Name"/>
-     </rule>
-    </template>
-   </menupopup>
-  </menu>
- </menubar>
-</toolbox>
-
-

A Window menu will be created with a list of all the open windows. Try this example by opening a number of browser windows and you'll see that they are all listed on the menu. -

-

Window mediator component

-

This is fine for displaying a list of open windows, but we would like to enhance this so that clicking on the menu item will switch to that window. This is accomplished by using the window mediator component. It implements the interface nsIWindowDataSource. The code below shows how to get a component which implements it: -

-
var wmdata = Components.classes["@mozilla.org/rdf/datasource;1?name=window-mediator"].getService();
-wmdata.QueryInterface(Components.interfaces.nsIWindowDataSource);
-
-

This code retrieves a window mediator data source component. The component used here is the same one that handles the window-mediator RDF datasource. You can also get this component through the RDF service, which is another service that manages RDF datasources. -

The nsIWindowDataSource interface has a function getWindowForResource, which can be used to get the window given a resource. In the earlier example, we generated the list of windows and added it to a menu via a template. The template generates an id attribute on each menuitem element. The value of this attribute can be used as the resource. That means that in order to switch the window focus, we need to do the following: -

-
  1. Determine the element that the user clicked on. -
  2. Get the value of the id attribute from the element. -
  3. Pass this value to getWindowForResource() to get a window object. -
  4. Switch the focus to this window. -
-

The example below shows how we might do this: -

-
<toolbox>
- <menubar id="windowlist-menubar">
-  <menu label="Window" oncommand="switchFocus(event.target);">
-   <menupopup id="window-menu" datasources="rdf:window-mediator" ref="NC:WindowMediatorRoot">
-    <template>
-     <rule>
-      <menuitem uri="rdf:*" label="rdf:http://home.netscape.com/NC-rdf#Name"/>
-     </rule>
-    </template>
-   </menupopup>
-  </menu>
- </menubar>
-</toolbox>
-
-<script>
-function switchFocus(elem)
-{
-  var mediator = Components.classes["@mozilla.org/rdf/datasource;1?name=window-mediator"].getService();
-  mediator.QueryInterface(Components.interfaces.nsIWindowDataSource);
-
-  var resource = elem.getAttribute('id');
-  switchwindow = mediator.getWindowForResource(resource);
-
-  if (switchwindow){
-    switchwindow.focus();
-  }
-}
-</script>
-
-

A command handler was added to the menu element which calls the function switchFocus() with a parameter of the element that was selected from the menu. The function switchFocus(): -

- -

쿠기(cookies)

-

다음으로 브라우저에 저장된 쿠키 목록을 가져와 보겠습니다. 쿠키 서비스는 다양한 목적으로 사용될 수 있습니다. 쿠키 서비스는 nsICookieManager 인터페이스를 구현하고 있으며, 저장된 모든 쿠키를 열거하는데 사용할 수 있습니다. 다음은 MozillaZine에서 설정된 모든 쿠키의 이름을 메뉴 목록에 출력하는 예제입니다. -

-
<script>
-
-function getCookies()
-{
-  var menu = document.getElementById("cookieMenu");
-  menu.removeAllItems();
-
-  var cookieManager = Components.classes["@mozilla.org/cookiemanager;1"]
-                        .getService(Components.interfaces.nsICookieManager);
-
-  var iter = cookieManager.enumerator;
-  while (iter.hasMoreElements()){
-    var cookie = iter.getNext();
-    if (cookie instanceof Components.interfaces.nsICookie){
-      if (cookie.host == "www.mozillazine.org")
-        menu.appendItem(cookie.name,cookie.value);
-    }
-  }
-}
-</script>
-
-<hbox>
-  <menulist id="cookieMenu" onpopupshowing="getCookies();"/>
-</hbox>
-
-


-getCookies() 함수는 메뉴가 열릴때마다 호출되는데, 이는 menulist 요소의 onpopupshowing 속성에 지정되어 있습니다. getCookies() 함수의 처음 두줄은 menulist를 가져와서 현재 메뉴에 있는 모든 항목을 삭제하는 것입니다. 이것은 getCookies() 함수가 메뉴가 열릴때마다 호출되고, 매번 이전 항목이 남아있지 않아야 하기 때문입니다. -

다음은 쿠키 관리자에 대한 참조를 받아옵니다. 쿠키 관리자에는 nsISimpleEnumerator 인터페이스를 구현하는 객체를 반환하는 enumerator 메소드가 있습니다. 이 메소드는 모든 쿠키별로 반복(iteratee)하기 위해 사용됩니다. 해당 인터페이스(nsISimpleEnumerator)에는 hasMoreElements() 메소드가 있으며 마지막 쿠키에 도달하기 전까지는 true를 반환합니다. getNext() 메소드는 쿠키를 가져온 후 열거자(enumerator)의 인덱스를 다음 쿠키로 이동합니다. enumerator는 범용 객체를 반환하기 때문에, 사용하기 전에 QueryInterface() 함수로 nsICookie 인터페이스를 얻어와야 합니다. 예제에서는 instanceof 연산자를 사용하였습니다. -

마지막으로 메뉴에 쿠키를 추가하며, 이를 위해 쿠키의 호스트, 이름, 값이 사용되었습니다. 메뉴에는 appendItem() 함수가 있으며, 이 함수는 주어진 라벨과 값으로 메뉴 항목을 추가하는데 사용됩니다. -

-

또 볼곳

-

아래에서 좀더 많은 예제를 볼 수 있습니다. -

- -

다음에는 트리의 작성방법에 대해 알아보겠습니다. -

-

« 이전다음 »

-
-

diff --git a/files/ko/mozilla/tech/xul/xul_tutorial/xpcom_interfaces/index.html b/files/ko/mozilla/tech/xul/xul_tutorial/xpcom_interfaces/index.html deleted file mode 100644 index 135628bf09..0000000000 --- a/files/ko/mozilla/tech/xul/xul_tutorial/xpcom_interfaces/index.html +++ /dev/null @@ -1,187 +0,0 @@ ---- -title: XPCOM Interfaces -slug: Mozilla/Tech/XUL/XUL_Tutorial/XPCOM_Interfaces -tags: - - XPConnect - - XUL - - XUL_Tutorial -translation_of: Archive/Mozilla/XUL/Tutorial/XPCOM_Interfaces ---- -

 

- -

-

« 이전다음 »

-

- -

이번 단원에서는, Mozilla가 사용하는 객체 시스템인 XPCOM (Cross-platform Component Object Model)에 대해 간단히 알아보겠습니다.

- -

네이티브 객체 호출하기

- -

우리는 XUL을 사용해서 복잡한 사용자 인터페이스를 작성할 수 있습니다. 또한, 인터페이스를 변경하고 어떤 작업을 수행하는 스크립트를 붙일 수도 있습니다. 그러나 아직도 JavaScript를 이용해서 직접적으로 수행할 수 없는 많은 것들이 존재합니다. 예를 들어, 메일 응용프로그램을 작성하고자 한다면, 메일 서버에 접속해서 메일을 보내거나 받을 수 있는 스크립트를 작성해야 할 것입니다. 그러나 JavaScript로는 이러한 것들을 할 수 없습니다.

- -

이러한 기능을 처리할 수 있는 유일한 방법은 메일을 주고 받을 수 있는 네이티브(native) 코드를 작성하는 것입니다. 또한 작성된 네이티브 코드를 스크립트에서 손쉽게 호출할 수 있는 방법도 있어야 할 것입니다. Mozilla는 XPCOM (Cross-platform Component Object Model)을 사용해 이러한 것들을 수행할 수 있는 방법을 제공합니다.

- -
-

Mozilla에서는 많은 수의 XPCOM 컴포넌트와 인터페이스를 제공합니다. 따라서 대부분의 경우 직접 네이티브 코드를 작성할 필요는 없을 것입니다. 이번 단원을 학습한 후에 XULPlanet XPCOM Reference를 보면서 필요한 인터페이스를 찾을 수 있을 것입니다.

-
- -

XPCOM에 관하여

- -

Mozilla는 각각의 고유한 작업을 수행하는 컴포넌트들의 집합으로 구성되어 있습니다. 예를 들어, 메뉴, 버튼, 요소들에 해당하는 컴포넌트가 있습니다. 컴포넌트들은 인터페이스라고 불리는 정의들로부터 구축됩니다.

- -

Mozilla에서의 인터페이스는 컴포넌트들에 의해 구현되어야 하는 기능들의 집합입니다. 컴포넌트는 무엇인가를 수행하는 Mozilla에 있는 코드를 구현한 것입니다. 각각의 컴포넌트는 인터페이스에 서술된데로 기능을 구현합니다. 단일 컴포넌트가 여러 개의 인터페이스를 구현할 수도 있고, 여러 개의 컴포넌트들이 하나의 인터페이스를 구현할 수도 있습니다.

- -

파일 컴포넌트를 예로 들어 보겠습니다. 인터페이스는 파일이 수행할 수 있는 함수와 속성을 서술하여 작성할 필요가 있을 것입니다. 파일에는 이름, 수정일자, 크기와 같은 속성과 파일의 이동, 복사, 삭제를 수행하는 함수가 포함되어야 할 것입니다.

- -

파일 인터페이스는 파일의 특성에 대해서만 서술하고, 이를 구현하지는 않습니다. 파일 인터페이스의 구현은 컴포넌트의 몫입니다. 컴포넌트는 파일의 이름과 날짜, 크기 등을 가져올 수 있는 코드를 가질 것입니다. 또한 파일을 복사하거나 이름을 바꾸는 코드도 있을 것입니다.

- -

컴포넌트가 인터페이스를 올바르게 구현했다면 어떻게 구현되는지에 대해서는 신경쓰지 않아도 됩니다. 물론 플랫폼에 따라 서로 다른 구현이 있을 것입니다. 파일 컴포넌트의 Windows와 Macintosh 버전은 꽤 틀릴 것입니다. 그러나 그들은 모두 동일한 인터페이스를 구현할 것입니다. 따라서 우리는 인터페이스를 통해 알게 된 함수로 접근함으로서 해당 컴포넌트를 사용할 수 있습니다.

- -

Mozilla에서 인터페이스 이름을 쉽게 알아볼 수 있도록, 보통 'nsI', 'mozI'가 이름 앞에 붙습니다. 예를 들어 nsIAddressBook는 주소록과 관련된 인터페이스이며, nsISound는 음악 파일을 플레이 하는데 사용되며, nsILocalFile는 파일을 사용하는 것과 관련된 인터페이스 입니다. Mozilla에 있는 많은 인터페이스에 대해서는 인터페이스를 참조하세요.

- -

XPCOM 컴포넌트는 대부분 네이티브 코드로 구현되어 있으며, 이는 JavaScript가 자체적으로는 하지 못하는 것들을 할 수 있다는 것을 의미합니다. 그러나 잠시 후 보시겠지만, 이를 호출할 수 있는 방법이 있습니다. 우리는 인터페이스에서 기술한데로 이를 구현한 컴포넌트에서 제공되는 어떤 함수도 호출할 수 있습니다. 예를 들어 어떤 컴포넌트를 가지고 있다면, 그것이 nsISound 인터페이스를 구현하는지 검사할 수 있으며, 그렇다면 그것을 통해 음악을 플레이 할 수 있습니다.

- -

스크립트에서 XPCOM을 호출하는 절차를 XPConnect라고 부르며, 이는 스크립트 객체를 네이티브 객체로 변환해주는 계층(layer)입니다.

- -

XPCOM 객체 생성

- -

XPCOM 컴포넌트를 호출하는데는 3가지 단계가 있습니다.

- -
    -
  1. 컴포넌트를 얻는다.
  2. -
  3. 사용하고자 하는 인터페이스를 구현한 컴포넌트의 일부를 얻는다.
  4. -
  5. 필요한 함수를 호출한다.
  6. -
- -

처음 두 단계만 실행하면, 마지막 단계는 필요시마다 반복할 수 있습니다. 우리가 파일 이름을 바꾼다고 합시다. 이를 위해 우리는 nsILocalFile 인터페이스를 사용할 수 있습니다. 첫번째 단계는 파일 컴포넌트를 얻어오는 것입니다. 두번째는 파일 컴포넌트에 질의해서 nsILocalFile 인터페이스를 구현하는 부분은 얻어오는 것입니다. 마지막으로 해당 인터페이스에서 제공하는 함수를 호출합니다. 이 인터페이스는 하나의 파일을 표현하는데 사용됩니다.

- -

우리는 인터페이스 이름이 'nsI'나 'mozI'로 시작하는 것을 자주 봤습니다. 그러나 컴포넌트는 URI와 같은 문자열을 사용해서 참조됩니다. Mozilla는 내부 레지스트리에 사용 가능한 모든 컴포넌트의 목록을 저장하고 있습니다. 사용자는 필요한 경우 새로운 컴포넌트를 설치할 수 있습니다. 이는 플러그인과 아주 비슷하게 동작합니다.

- -

Mozilla에서는 파일 컴포넌트를 제공하며, 이는 nsILocalFile 인터페이스를 구현합니다. 이 컴포넌트는 '@mozilla.org/file/local;1'로 참조될 수 있으며 이 문자열을 계약(contract)ID라고 부릅니다. 계약ID의 구문은 다음과 같습니다.

- -
@<internetdomain>/module[/submodule[...]];<version>[?<name>=<value>[&<name>=<value>[...]]]
-
- -

다른 컴포넌트들도 이와 비슷한 방법으로 참조할 수 있습니다.

- -

컴포넌트의 계약ID는 컴포넌트를 얻기 위해 사용할 수 있으며, JavaScript 코드를 사용해 컴포넌트를 얻는 방법은 다음과 같습니다.

- -
var aFile = Components.classes["@mozilla.org/file/local;1"].createInstance();
-
- -

파일 컴포넌트를 얻어와aFile 변수에 저장하였습니다. 예제의 Components는 컴포넌트와 관련된 함수를 제공하는 범용 객체를 참조합니다. 여기서 우리는 classes 속성으로부터 컴포넌트 클래스를 얻어옵니다. classes 속성은 사용할 수 있는 모든 컴포넌트를 가지고 있는 배열입니다. 다른 컴포넌트를 얻어오려면 대괄호 안에 있는 계약ID를 사용하고자 하는 컴포넌트의 ID로 변경하면 됩니다. 마지막으로 createInstance() 함수를 이용해 인스턴스를 생성하였습니다.

- -

여러분은 createInstance()함수의 반환값이, 컴포넌트가 존재하지 않는다는 것을 의미하는 null이 아닌지 확인하는게 좋습니다.

- -

그러나 이 시점에서 우리는 파일 컴포넌트 자체에 대한 참조만을 얻었을 뿐입니다. 컴포넌트 내의 함수를 호출하기 위해서는 컴포넌트의 인스턴스를 얻어야만 합니다. 이 경우에는 nsILocalFile로 다음의 두번째 줄에서 필요한 코드가 추가되어 있습니다.

- -
var aFile = Components.classes["@mozilla.org/file/local;1"].createInstance();
-if (aFile) aFile.QueryInterface(Components.interfaces.nsILocalFile);
-
- -

QueryInterface() 는 모든 컴포넌트에서 제공되는 함수로, 해당 컴포넌트의 특정 인터페이스를 얻기 위해 사용됩니다. 이 함수는 얻고자 하는 인터페이스를 명시한 한 개의 인자를 받습니다. Components 객체의 interfaces 속성에는 해당 컴포넌트에서 사용 가능한 모든 인터페이스의 목록이 들어 있습니다. 여기서 우리는 nsILocalFile 인터페이스를 사용하고자 하므로, 이를 QueryInterface()의 인자로 넘겼습니다. 결과적으로 aFile 변수는 파일 컴포넌트에서 nsILocalFile 인터페이스를 구현하는 부분을 참조하게 됩니다.

- -

위의 JavaScript 코드는 아무 컴포넌트의 어떤 인터페이스에서도 사용할 수 있습니다. 코드의 컴포넌트 이름을 사용하고자 하는 컴포넌트와 인터페이스 이름으로 바꿔서 사용하면 됩니다. 또 당연히 변수 이름도 바꿀 수 있습니다. 예를 들어 사운드 인터페이스를 얻으려면 다음과 같이 수정하면 됩니다.

- -
var sound = Components.classes["@mozilla.org/sound;1"].createInstance();
-if (sound) sound.QueryInterface(Components.interfaces.nsISound);
-
- -

XPCOM 인터페이스는 다른 인터페이스로부터 상속될 수 있습니다. 다른 인터페이스로부터 상속된 인터페이스는 자신의 함수와 부모 인터페이스가 가진 모든 함수를 가지게 됩니다. 모든 인터페이스는 nsISupports라고 불리는 최상위 인터페이스에서 상속됩니다. 이 인터페이스에는 앞서 보았던 JavaScript를 지원하기 위한 목적인 QueryInterface()라는 한가지 함수만 있습니다. nsISupports 인터페이스가 모든 컴포넌트에 의해 구현되기 때문에, QueryInterface() 함수도 모든 컴포넌트에서 사용할 수 있는 것입니다.

- -

몇몇 컴포넌트들은 동일한 인터페이스를 구현할 수도 있습니다. 그러한 경우 보통은 어떤 클래스의 서브클래스들인 경우이겠지만, 꼭 그래야 하는것은 아닙니다. 아무 컴포넌트나 nsILocalFile의 기능을 구현할 수 있습니다. 또한 하나의 컴포넌트가 여러개의 인터페이스를 구현할 수도 있습니다. 이런 이유들 때문에 위와 같이 두 단계로 진행되는 것입니다.

- -

그러나 위의 코드를 자주 사용하기 때문에 다음과 같이 줄여서도 사용할 수 있습니다.

- -
var aLocalFile = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
-
- -

이 코드는 앞서의 두줄 짜리 코드와 동일한 일을 하는 한줄 짜리 코드입니다. 여기서는 앞서의 두 단계에 있었던 인스턴스를 생성한 후에 인터페이스를 얻기 위해 쿼리하는 부분이 제거되었습니다.

- -

만일 객체에 QueryInterface()를 호출하고 해당 객체에서 지원하지 않는 인터페이스를 요청하면 예외가 발생합니다. 어떤 컴포넌트에서 어떤 인터페이스가 지원되는지 확신이 없을 경우 이를 확인하기 위해 instanceof 연산자를 사용할 수 있습니다.

- -
var aFile = Components.classes["@mozilla.org/file/local;1"].createInstance();
-if (aFile instanceof Components.interfaces.nsILocalFile){
-  // do something
-}
-
- -

위 코드에서 instanceof 연산자는 aFile이 nsILocalFile 인터페이스를 구현하였다면 true를 반환합니다. 이것은 QueryInterface()를 호출하는 것에 대한 부작용이 있으며, 따라서 aFile은 이후에 유효해집니다.

- -

인터페이스의 함수 호출

- -

이제 우리는 nsILocalFile 인터페이스를 구현한 컴포넌트를 참조하는 객체를 가지고 있으므로, 이로부터 nsILocalFile의 함수를 호출할 수 있습니다. 아래의 표는 nsILocalFile 인터페이스에 있는 함수와 메소드의 일부를 보여주고 있습니다.

- -
-
initWithPath 
-
이 메소드는 nsILocalFile에서 사용할 파일명과 경로를 초기화하는데 사용됩니다. 첫번째 인자는 '/usr/local/mozilla'와 같은 파일 경로이어야 합니다.
-
leafName 
-
디렉토리 부분을 뺀 파일명.
-
fileSize 
-
파일 크기.
-
isDirectory() 
-
nsILocalFile이 디렉토리이며 true를 반환합니다.
-
remove(recursive) 
-
파일을 삭제합니다. 만일 recursive 인자가 true이면 디렉토리와 이 안에 있는 모든 파일, 하위 디렉토리 모두 삭제됩니다.
-
copyTo(directory,newname) 
-
파일을 다른 디렉토리로 복사하며, 선택적으로 파일명을 바꿀 수 있습니다. directory 인자는 파일이 복사될 디렉토리에 대한 nsILocalFile 객체이어야 합니다.
-
moveTo(directory,newname) 
-
파일을 다른 디렉토리로 이동하거나 이름을 변경합니다. directory 인자는 파일이 이동할 대상 디렉토리에 대한 nsILocalFile 객체이어야 합니다.
-
- -

파일을 삭제하기 위해서 먼저 해당 파일을 nsILocalFile에 할당해야 합니다. initWithPath() 메소드를 호출함으로서 어떤 파일인지를 알려줍니다. 이 속성에는 그냥 파일의 경로만 할당하세요. 다음으로 remove() 함수를 호출합니다. 이 함수는 재귀적으로 삭제할지를 나타내는 한개 인자만을 받습니다. 아래 코드는 이러한 두 단계를 보여줍니다.

- -
var aFile = Components.classes["@mozilla.org/file/local;1"].createInstance();
-if (aFile instanceof Components.interfaces.nsILocalFile){
-  aFile.initWithPath("/mozilla/testfile.txt");
-  aFile.remove(false);
-}
-
- -

이 코드는 /mozilla/testfile.txt 파일을 삭제할 것입니다. 임의의 이벤트 핸들러에 위 코드를 추가해서 실행해 보세요. 위의 파일명은 삭제하고자 하는 것으로 바꿔주어야 할 것입니다.

- -

위 표에 있는 함수들 중 copyTo()와 moveTo() 함수는 각각 파일을 복사하고 이동하기 위해 사용됩니다. 여기서 주의할 것은 이 함수들의 복사하거나 이동할 대상 디렉토리 인자가 문자열 값이 아닌 nsILocalFile 이어야 한다는 점입니다. 이것은 이 함수를 실행하려면 두 개의 파일 컴포넌트가 필요하다는 것을 의미합니다. 아래 예제는 어떻게 파일을 복사하는지를 보여줍니다.

- -
function copyFile(sourcefile,destdir)
-{
-  // get a component for the file to copy
-  var aFile = Components.classes["@mozilla.org/file/local;1"]
-    .createInstance(Components.interfaces.nsILocalFile);
-  if (!aFile) return false;
-
-  // get a component for the directory to copy to
-  var aDir = Components.classes["@mozilla.org/file/local;1"]
-    .createInstance(Components.interfaces.nsILocalFile);
-  if (!aDir) return false;
-
-  // next, assign URLs to the file components
-  aFile.initWithPath(sourcefile);
-  aDir.initWithPath(destdir);
-
-  // finally, copy the file, without renaming it
-  aFile.copyTo(aDir,null);
-}
-
-copyFile("/mozilla/testfile.txt","/etc");
-
- -

XPCOM 서비스

- -

어떤 XPCOM 컴포넌트들은 서비스라 불리는 특별한 컴포넌트들입니다. 이것들은 꼭 하나만 존재해야 하기 때문에 인스턴스를 만들지 않습니다. 서비스는 전역 데이터를 획득 또는 지정하거나 다른 객체들에 대한 어떤 동작을 수행하기 위한 범용 함수를 제공합니다. 서비스 컴포넌트에 대한 참조를 얻어오기 위해서는 createInstance()<code> 함수 대신 <code>getService() 함수를 호출해야 합니다. 이것 이외에는 다른 컴포넌트들과 특별히 다른점은 없습니다.

- -

Mozilla에서 제공하는 서비스들 중 북마크 서비스가 이에 해당합니다. 이 서비스를 이용하면 현재 사용자의 북마크 목록에 북마크를 추가할 수 있습니다. 다음은 이에 대한 예입니다.

- -
var bmarks = Components.classes["@mozilla.org/browser/bookmarks-service;1"].getService();
-bmarks.QueryInterface(Components.interfaces.nsIBookmarksService);
-bmarks.addBookmarkImmediately("http://www.mozilla.org","Mozilla",0,null);
-
- -

먼저 "@mozilla.org/browser/bookmarks-service;1" 컴포넌트가 반환되고 이의 서비스가 bmarks 변수에 저장되었습니다. 우리는 nsIBookmarksService 인터페이스를 얻기 위해 QueryInterface()를 사용했습니다. 이 인터페이스에서 제공하는 addBookmarkImmediately() 함수는 북마크를 추가하기 위해 사용됩니다. 이 함수의 처음 두개의 인자는 북마크의 URL과 제목입니다. 세번째 인자는 북마크 유형으로 보통 0이며, 마지막 인자는 북마크될 문서의 문자 인코딩으로 null일 수 있습니다.

- -

다음에는 우리가 사용할 수 있는 Mozilla에서 제공하는 몇가지 인터페이스에 대해 알아보겠습니다.

- -

-

« 이전다음 »

-

- -

diff --git a/files/ko/mozilla/tech/xul/xul_tutorial/xul_structure/index.html b/files/ko/mozilla/tech/xul/xul_tutorial/xul_structure/index.html deleted file mode 100644 index 4f1326dc6a..0000000000 --- a/files/ko/mozilla/tech/xul/xul_tutorial/xul_structure/index.html +++ /dev/null @@ -1,166 +0,0 @@ ---- -title: XUL Structure -slug: Mozilla/Tech/XUL/XUL_Tutorial/XUL_Structure -tags: - - XUL - - XUL_Tutorial -translation_of: Archive/Mozilla/XUL/Tutorial/XUL_Structure ---- -

-

« 이전다음 »

-

- -


- 우리는 먼저 Mozilla에서 XUL의 작동 방식에 대해 알아볼 것 입니다.

- -

XUL의 작동 방식

- -

Mozilla에서 XUL은 HTML이나 다른 유형의 컨텐츠가 동작하는 것과 매우 비슷한 방법으로 동작합니다. 사용자가 브라우저의 주소 영역에 HTML 페이지의 URL을 입력하면, 브라우저는 해당 웹 사이트를 찾고 내용을 다운로드합니다. Mozilla의 렌더링 엔진은 HTML 소스 형태인 내용을 가져와서 DOM이라고 하는 문서 트리 구조로 변환합니다. 그 후 트리는 화면에 출력될 수 있는 객체 집합으로 변경됩니다. CSS, 이미지, 기타 다른 기술들이 출력을 제어하는데 사용됩니다. XUL도 동일한 방식으로 동작합니다.

- -

사실 Mozilla에서는 문서 형태가 HTML, XUL 혹은 SVG 인지 상관없이 동일한 내부 코드에 의해 작동됩니다. 이것은 동일한 CSS 속성을 HTML과 XUL 모두의 스타일에 사용할 수 있으며, 많은 기능들을 공유할 수 있다는 것을 의미합니다. 그러나 HTML에서의 폼(form)이나 XUL에서의 overlays같이 고유한 것들도 존재합니다. XUL과 HTML은 동일한 방법으로 동작하므로 둘 다 로컬 파일 시스템, 웹 페이지, 확장 기능 혹은 독립형 XULRunner 응용프로그램을 통해 로드할 수 있습니다.

- -

http://localhost/~username/과 같은 원격지의 컨텐츠는 문서 형태가 HTML이나 XUL 혹은 다른 형태인지에 상관없이 보안상의 이유로 컨텐츠가 수행할 수 있는 동작에 제한을 가지게 됩니다. 이러한 이유 때문에 Mozilla에서는 컨텐츠를 로컬에 설치하고 chrome 시스템의 일부분으로 등록할 수 있는 방법을 제공하고 있습니다. 이는 chrome:// URL이라고 불리는 특별한 URL 형식에 의해 가능합니다. Chrome URL을 사용하여 파일에 접근하게 되면, 해당 파일들은 로컬 파일이나 설정, 북마크 등에 접근할 수 있는 향상된 권한을 가지며, 또 다른 권한이 필요한 동작을 수행할 수 있습니다. 전자 인증서로 서명되거나 그러한 행위를 수행하도록 허가되지 않는다면, 당연히 웹 페이지들은 이러한 권한을 얻을 수 없습니다.

- -

이러한 chrome 꾸러미의 등록이 Firefox 확장 기능이 브라우저에 기능을 추가할 수 있는 방법입니다. 확장 기능은 XUL, 자바스크립트, 스타일시트, 이미지들을 단일 파일로 묶어 놓은 작은 꾸러미입니다. 이 파일은 ZIP 유틸리티를 이용하여 생성할 수 있습니다. 사용자가 꾸러미 파일을 다운로드 받으면, 컴퓨터에 확장 기능이 설치될 것입니다. 꾸러미는 브라우저의 XUL과 확장 기능의 XUL을 조합하는 overlay라는 고유 기능을 사용하여 브라우저에 잡히게 됩니다. 사용자에게는 마치 확장 기능이 브라우저를 수정한것 처럼 보이겠지만 사실 모든 코드는 분리되어 있으며 확장 기능은 쉽게 설치 해제(uninstall)할 수 있습니다. 물론 등록된 꾸러미가 꼭 overlay를 사용해야 할 필요는 없습니다. Overlay를 사용하지 않는 꾸러미들은 메인 브라우저의 인터페이스를 통해서는 접근할 수 없지만, chrome URL을 이용해서 여전히 접근할 수 있습니다.

- -

독립형 XUL 응용프로그램들은 유사한 방법으로 XUL코드를 포함할 수 있지만, 당연히 확장기능처럼 별도로 설치되어야만 하는 것과는 달리 응용프로그램을 위한 XUL이 설치의 일부분에 포함되어야만 합니다. 그러나 이러한 XUL 코드가 응용프로그램이 UI를 출력할 수 있는 것과 같은 chrome 시스템에 등록될 것입니다.

- -

Mozilla 브라우저 자체는 XUL 파일, 자바스크립트, 스타일시트를 포함하는 꾸러미 집합이라는 것을 알 필요가 있습니다. 이러한 파일들은 chrome URL을 통해 접근 가능하고 보다 강화된 권한을 가지며 다른 꾸러미들처럼 동작합니다. 물론 브라우저는 대부분의 확장기능보다 더 크고 복잡합니다. 수 많은 다른 컴포넌트들뿐만 아니라 Firefox와 Thunderbird도 모두 XUL로 작성되어 있고 chrome URL을 통해 접근할 수 있습니다. 여러분은 이러한 꾸러미를 Firefox나 다른 XUL 응용 프로그램이 설치된 chrome 디렉토리에서 확인할 수 있습니다.

- -

Chrome URL은 항상 'chrome://'로 시작합니다. 'http://' URL이 항상 HTTP를 사용해 접근하는 원격 웹 사이트를 참조하고, 'file://' URL이 항상 로컬 파일을 참조하는 것과 마찬가지로 'chrome://' URL은 항상 설치된 꾸러미와 확장기능을 참조합니다. 다음 섹션에서 chrome URL의 구문에 대해 좀 더 자세히 알아 볼 것입니다. Chrome URL을 통해 컨텐츠에 접근할 때는 위에서 언급한 다른 종류의 URL이 갖지 못한 강화된 권환을 획득한다는 것에 유의하십시요. 예를 들어 HTTP URL은 특별한 권한을 가지고 있지 않으므로, 웹 페이지가 로컬 파일을 읽으려고 하면 오류가 발생할 것입니다. 그러나 chrome URL을 이용하여 로드된 파일은 제약 없이 파일을 읽을 수 있습니다.

- -

이러한 차이는 중요합니다. 이것은 사용자의 북마크를 읽는 것과 같이 웹 페이지상의 컨텐츠가 할 수 없는 것이 있다는 것을 의미합니다. 이러한 차이점은 출력되는 컨텐츠의 종류에 따른 것은 아니고 단지 사용된 URL의 종류에 따른 것입니다. 웹 사이트에 위치한 HTML과 XUL은 모두 특별한 퍼미션이 없지만, chrome URL을 통해 로드되면 강화된 퍼미션을 가지게 됩니다.

- -

만일 여러분이 웹사이트에서 XUL을 사용한다면, HTML 파일들을 웹 사이트에 올리것처럼 XUL 파일을 올리고 브라우저 http://localhost/xul.php에서 URL을 로드합니다. 여러분의 웹 서버가 XUL 파일을 application/vnd.mozilla.xul+xml의 컨텐츠 타입(PHP에서는 header('content-type:application/vnd.mozilla.xul+xml');)으로 보낼 수 있도록 설정되어 있는지 확인하세요. 이 컨텐츠 타입은 Mozilla가 HTML과 XUL을 구분하는데 사용됩니다. Mozilla는 파일 시스템을 통해 파일을 읽은 것이 아니면 파일 확장자를 사용하는 것은 아니지만, 모든 XUL 파일들에 대해 .xul 확장자를 사용하는 것이 좋습니다. 여러분은 여러분의 컴퓨터의 브라우저에서 열거나 파일 매니저에서 더블 클릭하여 XUL 파일을 로드할 수 있습니다.

- -
원격 XUL은 기능상의 중대한 제약 조건을 가지는 것을 기억하세요.
- -

문서 유형: HTML XML XUL CSS

- -

Mozilla는 문서 유형들 간의 대부분의 기능들은 공유하지만 HTML과 XUL에 대해 완전히 다른 종류의 문서 객체(DOM)를 사용합니다. Mozilla에는 HTML, XML, XUL의 세 가지 종류의 주요 문서 유형이 존재합니다. 본질적으로 HTML 문서는 HTML 문서에 사용되고 XUL 문서는 XUL 문서에 XML 문서는 다른 종류의 XML 문서에 사용됩니다. XUL 역시 XML이기 때문에 XUL 문서는 좀 더 일반적인 XML 문서의 서브 타입입니다. 기능상의 사소한 차이점이 존재합니다. 예를 들어 HTML 페이지에서의 폼 컨트롤은 document.forms 속성을 통해 접근할 수 있는 반면, XUL은 HTML에서의 폼이 없기 때문에 이러한 속성은 XUL 문서에서는 사용할 수 없습니다. 비슷하게 overlayer나 template과 같은 XUL 고유 기능은 XUL문서에서만 가능합니다.

- -

이러한 문서간의 차이는 중요합니다. 문서 타입에 특정하지 않은 많은 XUL의 기능을 HTML이나 XML 문서에서도 사용할 수 있습니다. 그러나 다른 기능들은 올바른 유형의 문서를 필요로 합니다. 예를 들어 여러분은 XUL layout 타입은 XUL 문서 타입에 의존하지 않기 때문에 다른 문서에서도 사용할 수 있습니다.

- -

위에서 언급한 점을 요약하면 다음과 같습니다.

- - - - - - - - - -

다음 섹션에서는 Mozilla에 설치될 수 있는 chrome 꾸러미의 기본 구조에 대해 설명합니다. 그러나 여러분이 지금 당장 간단한 응용 프로그램을 작성하고 싶다면, Creating a Window로 건너뛰고 다음을 위해 본 섹션은 저장하세요.

- -

Package Organization

- -

Mozilla is organized in such a way that you can have as many components as you want pre-installed. Each extension is also a component with a separate chrome URL. It also has one component for each installed theme and locale. Each of these components, or packages, is made up of a set of files that describe the user interface for it. For example, the messenger component has descriptions of the mail messages list window, the composition window and the address book dialogs.

- -

The packages that are provided with Mozilla are located within the chrome directory, which are in the directory where you installed Mozilla. The chrome directory is where you find all the files that describe the user interface used by the Mozilla browser, mail client, and other applications. Typically, you put all the XUL files for an application in this directory, although extensions are installed in the extensions directory for a particular user. Just copying a XUL file into the chrome directory doesn't give the file any extra permissions, nor can it be accessed via a chrome URL. To gain the extra privileges, you will need to create a manifest file and put that in the chrome directory. This file is easy to create, as it is typically only a couple of lines long. It is used to map a chrome URL to a file or directory path on the disk where the XUL files are located. Details of how to create this file will be discussed in a later section.

- -

The only way to create content that can be accessed through a chrome URL is by creating a package as described in the next few sections. This directory is called 'chrome' likely because it seemed like a convenient name to use for the directory where the chrome packages that are included with Mozilla are kept.

- -

To further the confusion, there are two other places where the word "chrome" might appear. These are the -chrome command line argument and the chrome modifier to the window.open() function. Neither of these features grant extra privileges; instead they are used to open a new top-level window without the browser UI such as the menu and toolbar. You will commonly use this feature in more complex XUL applications since you wouldn't want the browser UI to exist around your dialog boxes.

- -

The files for a package are usually combined into a single JAR file. A JAR file may created and examined using a ZIP utility. For instance, you can open the JAR files in Mozilla's chrome directory to see the basic structure of a package. Although it's normal to combine the files into a JAR file, packages may also be accessed in expanded form into a directory. Although you don't normally distribute a package this way, it is handy during development since you can edit the file directly and then reload the XUL file without having to repackage or reinstall the files.

- -

By default, Mozilla applications parse XUL files and scripts, and store a pre-compiled version in memory for the remainder of the application session. This improves performance. However, because of this, the XUL will be not be reloaded even when the source files are changed. To disable this mechanism, it is necessary to change the preference nglayout.debug.disable_xul_cache. In Firefox, this preference may be added to the user preferences by typing "about:config" in the address field, and setting this value to true. Or, just manually edit your user.js preferences file and add the following line:

- -
pref("nglayout.debug.disable_xul_cache", true);
-
- -

There are usually three different parts to a chrome package, although they are all optional. Each part is stored in a different directory. These three sets are the content, the skin, and the locale, which are all described below. A particular package might provide one or more skins and locales, but a user can replace them with their own. In addition, the package might include several different applications, each accessible via different chrome URLs. The packaging system is flexible enough so that you can include whatever parts you need and allow other parts, such as the text for different languages, to be downloaded separately.

- -

The three types of chrome packages are:

- - - -

Content Packages

- -

The name of the JAR file might describe what it contains, but you can't be sure unless you view its contents. Let's use the browser package included with Firefox as an example. If you extract the files in browser.jar, you will find that it contains a directory structure much like the following:

- -
content
-   browser
-      browser.xul
-      browser.js
-      -- other browser XUL and JS files goes here --
-      bookmarks
-         -- bookmarks files go here --
-      preferences
-         -- preferences files go here --
-.
-.
-.
-
- -

This is easily recognizable as a content package, as the top-level directory is called content. For skins, this directory will usually be called skin and for locales, it will usually be called locale. This naming scheme isn't necessary, but this is a common convention to make the parts of a package clearer. Some packages may include a content section, a skin, and a locale. In this case, you will find a subdirectory for each type. For example, Chatzilla is distributed in this way.

- -

The content/browser directory contains a number of files with .xul and .js extensions. The XUL files are the ones with the .xul extension. The files with .js extensions are JavaScript files containing scripts that handle the functionality of a window. Many XUL files have a script file associated with them, and some may have more than one.

- -

In the listing above, two files have been shown. There are of course others, but for simplicity they aren't shown. The file browser.xul is the XUL file that describes the main browser window. The main window for a content package should have the same name as the package with a .xul extension. In this case, the package name is "browser" so we expect to find browser.xul. Some of the other XUL files describe separate windows. For example, the file pageInfo.xul describes the page info dialog.

- -

Many packages will include a contents.rdf file, which describes the package, its author, and the overlays it uses. However, this file is obsolete and has been replaced with a simpler mechanism. This newer method is the manifest file mentioned earlier, and you will find these as files with the .manifest extension in the chrome directory. For instance, browser.manifest describes the browser package.

- -

Several subdirectories, such as bookmarks and preferences, describe additional sections of the browser component. They are placed in different directories only to keep the files more organized.

- -

Skins or Themes

- -

Although the underlying code for Mozilla calls them skins and the user interface calls them themes, they're both referring to the same thing. The classic.jar file describes the default theme provided with Firefox. The structure is similar to the content packages. For example, examining classic.jar:

- -
skin
-   classic
-      browser
-         browser.css
-         -- other browser skin files go here --
-      global
-         -- global skin files go here --
-.
-.
-.
-
- -

Again, this directory structure isn't necessary and is used for convenience. You can actually put all the files in one directory at the top level and not use subdirectories. However, for larger applications, subdirectories are used to separate the different components. In the example above, a directory exists for theme related files for the browser and another for global theme related files. The global directory contains skin files that are general to all packages. These files will apply to all components and will be included with your own standalone applications. The global part defines the appearance of all of the common XUL widgets, whereas the other directories have files that are specific to those applications. Firefox includes both the global and browser theme files in one archive, but they can be included separately.

- -

A skin is made up of CSS files and a number of images used to define the look of an interface. The file browser.css is used by browser.xul and contains styles that define the appearance of various parts of the browser interface. Again, note how the file browser.css has the same name as the package. By changing the CSS files, you can adjust the appearance of a window without changing its function. This is how you can create a new theme. The XUL part remains the same but the skin part changes independently.

- -

Locales

- -

The file en-US.jar describes the language information for each component, in this case for US English. Like the skins, each language file contains files that specify text used by the package for a specific language. The locale structure is similar to the others, so it won't be listed here.

- -

The localized text is stored in two types of files: DTD files and properties files. The DTD files have a .dtd extension and contain entity declarations, one for each text string that is used in a window. For example, the file browser.dtd contains entity declarations for each menu command. In addition, keyboard shortcuts for each command are also defined, because they may be different for each language. DTD files are used by XUL files so, in general, you will have one per XUL file. The locale part also contains properties files, which are similar, but are used by script files. The file browser.properties contains a few such localized strings.

- -

This structure allows you to translate Mozilla or a component into a different language by just adding a new locale for that language. You don't have to change the XUL code at all. In addition, another person could supply a separate package that applies a skin or locale to your content part, thus providing support for a new theme or language without having to change the original package.

- -

Other Packages

- -

There is a one special package called toolkit (or global). We saw the global directory earlier for skins. The file toolkit.jar contains the corresponding content part for it. It contains some global dialogs and definitions. It also defines the default appearance and functionality of the various common XUL widgets such as textboxes and buttons. The files located in the global part of a skin package contain the default look for all of the XUL interface elements. The toolkit package is used by all XUL applications.

- -

Adding a Package

- -

Mozilla places the packages that are included with the installation in the chrome directory. However, they do not need to be placed there. When installing another package, you can place it anywhere on the disk, as long as a manifest file points to it. It is common to place packages into the chrome directory simply because it is convenient; however, they will work just as well from another directory or somewhere on your local network. You cannot store them on a remote site, unless the remote site is mounted through the local file system.

- -

There are two chrome directories used for XUL applications: one is installed in the same place where the application is installed, while the other is part of user's profile. The former allows packages that are shared by all users while the latter allows packages to be created only for a specific user or users. Extensions, while installed in a separate extensions directory, are also usually user specific. Any manifest files located in either chrome directory will be examined to see which packages are installed.

- -

In the next section, we'll look at how to refer to chrome packages using the chrome URL.

- -

-

« 이전다음 »

-
Interwiki Language Links

- -

diff --git "a/files/ko/mozilla/\352\260\234\353\260\234\354\236\220_\355\224\204\353\241\234\352\267\270\353\236\250/index.html" "b/files/ko/mozilla/\352\260\234\353\260\234\354\236\220_\355\224\204\353\241\234\352\267\270\353\236\250/index.html" deleted file mode 100644 index 0282bfa7e2..0000000000 --- "a/files/ko/mozilla/\352\260\234\353\260\234\354\236\220_\355\224\204\353\241\234\352\267\270\353\236\250/index.html" +++ /dev/null @@ -1,124 +0,0 @@ ---- -title: Mozilla 개발자 프로그램 -slug: Mozilla/개발자_프로그램 -translation_of: Mozilla/Connect ---- -
-
Enable, inspire and collaborate to make the Web the primary platform used to create experiences across all connected devices.
-
- -
-
-
- -
- -
- -
- -
- -
-
- -
-

Connect with Mozilla

- -

Developers are creating the future by building services and apps for people all over the world. The goal of Mozilla Developer Relations is to help developers to use open and standardized web technologies to succeed in achieving their goals. In addition to the documentation here on MDN, we offer help and other resources towards this goal, through various channels. We invite you to connect, learn, and share your own knowledge.

- -

We are offering help through Q&A on Stack Overflow, to solve specific technical issues and challenges you might have. We also have a newsletter keeping you informed on the latest happenings in the web scene around web apps and more. Subscribe to the Apps & Hacks newsletter.

- -

If you share Mozilla's mission and principles, and want to help spread them to more developers, check out the ways you can get involved with technical evangelism, and join our evangelism discussion group.

- -

We have a lot of plans and ideas for iteratively expanding our Developer Relations offerings, and we want you involved as we do so! So, follow the tags on Stack Overflow, subscribe to the Hacks blog, subscribe to the newsletter, and sign up for an account!

- -

Join Mozilla

- -

If you want to go beyond connecting with Mozilla, you can join Mozilla and help realize Mozilla's mission of building a better Internet. As a developer, you have skills to contribute in many areas, as well as the opportunity to enhance your skills. Mozilla is an open source project, so we "default to open." You can "view source" and contribute to our software development projects, like the Firefox browser for desktop and Android, Firefox OS, and Mozilla's own websites. You can become part of an international community and get recognition for your efforts. Here are some of the advantages of contributing to the Mozilla project.

- -

Opportunity to learn something new

- -
-

In writing code for an open source project, you may face problems you have not encountered before, which present learning opportunities for you. You can try out new tools and techniques in an open source project. For example, if you've never done any unit testing, and cannot get permission from your boss to do so in your regular job, writing some code for an open source project would be an excellent place to try it out. Contributing to open source gives you the opportunity to collaborate with and get to know many people around the world who have similar interests. Moreover, an open source organization like Mozilla has many contributors who can help you in solving problems you encounter. If you're just getting started contributing, you can look for "mentored" bugs, where an experienced contributor has offered to help a newcomer fix them.

- -

What can I get by contributing ?

- -

Exploring many things and getting recognition in the community -- these are the intangible benefits of contributing to Mozilla. While we can't guarantee specific tangible benefits, many valued contributors receive free Mozilla gear and invitations to Mozilla-related events, and are first in line to be considered for internships. Moreover, your experience in contributing to an open source project might help you find a job. More and more employers of developers are looking at open source contributions. They like to see that you're blogging and contributing to mailing lists, and they really like to see you listed as a committer on an open source project. It can also help with the work experience section of your resume.

- -

How can I contribute to Mozilla ?

- -

Mozilla에 기여할 수 있는 많은 프로젝트 영역이 있습니다. You can find a current, complete list on the main Mozilla 참여 page. Some areas that may interest you as a developer include:

- - -
-
- -
-
-

Q&A on Stack Overflow See all Q&A...

- -

We have Q&A to discuss challenges and issues when developing, in particular for Firefox OS and the Open Web on mobile. It's available on Stack Overflow under the easy URL http://stackoverflow.com/r/mozilla.

- -
Stack form
- -

Latest Q&A Topics

-
- -
 
-
- -

Developers at a Firefox OS workshop in Madrid.

- -
-
-

Mozilla는 어디에 있나요? View attendees and details on our Events page...

- -

Here is a listing of events where Mozilla representatives will be speaking. 대화를 꼭 나눠보세요!

-
- - -
-
diff --git "a/files/ko/mozilla/\354\225\210\353\223\234\353\241\234\354\235\264\353\223\234\354\232\251_\355\214\214\354\235\264\354\226\264\355\217\255\354\212\244/index.html" "b/files/ko/mozilla/\354\225\210\353\223\234\353\241\234\354\235\264\353\223\234\354\232\251_\355\214\214\354\235\264\354\226\264\355\217\255\354\212\244/index.html" deleted file mode 100644 index 131f5749fa..0000000000 --- "a/files/ko/mozilla/\354\225\210\353\223\234\353\241\234\354\235\264\353\223\234\354\232\251_\355\214\214\354\235\264\354\226\264\355\217\255\354\212\244/index.html" +++ /dev/null @@ -1,47 +0,0 @@ ---- -title: Firefox for Android -slug: Mozilla/안드로이드용_파이어폭스 -translation_of: Mozilla/Firefox_for_Android ---- -

점점 더 많은 사람들에게 있어서 모바일 기기가 웹에 접속하는 주요한, 더 나아가서 유일한 방법이 되고 있습니다. 안드로이드용 Firefox(코드네임 Fennec)는 개방적이고, 수정이 자유롭고, 표준에 기반한 데스크탑 Firefox와 비슷한 브라우저입니다.

-

안드로이드용 Firefox는 XUL 대신 기본 안드로이드 위젯에서 만들어진 UI를 사용합니다. 이를 통해 처음 구동 시간과 같은 성능을 향상시키고 메모리 절감 효과를 얻었습니다.

-

 

-

안드로이드용 Firefox에 기여하기

-

안드로이드용 Firefox에 대한 정보를 얻을 수 있는 가장 좋은 시작점은 프로젝트 위키 페이지입니다.

-

다음과 같은 활동을 통해서 안드로이드용 Firefox를 만들고 개선하는데 도움을 줄 수 있습니다:

- -

모바일 웹 개발

-

모바일 기기를 위한 웹사이트 디자인에 가이드 문서를 올리고 있습니다.

-

안드로이드용 Firefox를 사용하면 기기의 다양한 기능을 사용할 수 있는 API를 사용할 수 있습니다. 이를 통해 웹과 네이티브 어플리케이션 사이의 차이를 줄일 수 있습니다:

- -

안드로이드용 Firfox를 안드로이드 기기에 설치하거나 안드로이드 에뮬레이터를 사용해서 데스크탑에서 실행해 봄으로써 사이트를 테스트해 볼 수 있습니다.

-

모바일 부가기능 제작

-

안드로이드용 Firefox는 다른 게코 기반의 어플리케이션과 동일한 확장 시스템을 통해서 부가 기능을 지원합니다. 새로운 확장 시스템을 만들지 않았습니다. 이 말은 데스크탑용 부가 기능을 만들던 것과 동일한 과정을 통해서 안드로이드용 Firefox의 부가기능을 만들 수 있다는 말입니다. 하지만 데스크탑용 Firefox 부가 기능이 자동으로 작동하지는 않습니다. 사용자 인터페이스가 너무 다르기 때문입니다.

-
- 안드로이드용 Firefox에는 install.rdf에 지정되어야 하는 독자적인 어플리케이션 인식자가 있습니다. 인식자는 {aa3c5121-dab2-40e2-81ca-7ea25febc110}입니다.
-

기존의 재시작 해야만 하는 부가기능과 재시작이 필요없는 부가기능은 동일한 접근방법을 가지고 있습니다. 부가기능을 설치하거나 삭제할 때 재시작을 해야만 하는 방식은 사용자 경험에 많은 영향을 미치기 때문에 가능하다면 재시작이 필요없는 방식이 선호됩니다.

-

기본 개요

- -

안드로이드용 Firefox 도움말

-

안드로이드용 Firefox를 사용하기 위한 문서와 도움말이 Mozilla Support website를 통해서 제공되고 있습니다.

diff --git "a/files/ko/mozilla/\354\247\200\354\227\255\355\231\224/index.html" "b/files/ko/mozilla/\354\247\200\354\227\255\355\231\224/index.html" deleted file mode 100644 index fda2a6a834..0000000000 --- "a/files/ko/mozilla/\354\247\200\354\227\255\355\231\224/index.html" +++ /dev/null @@ -1,26 +0,0 @@ ---- -title: Mozilla 지역화 -slug: Mozilla/지역화 -tags: - - l10n - - 모질라 - - 번역 - - 지역화 -translation_of: Mozilla/Localization ---- -

지역화(L10n) 는 소프트웨어 사용자 인터페이스를 한 언어에서 다른 언어로 번역하고 다른 문화에 적합하도록 맞추는 과정입니다. 이러한 자원들은 지역화에 포함된 기술적 측면에 관심있는 모두를 위한것입니다. 모든 기여자들과 개발자들을 위한 것입니다.

- -

참고

- -
-
Localizing MDN
-
이 자원은 여기 MDN 문서의 지역화를 커버합니다.
-
- -

App localization(응용프로그램 지역화)

- -

     이 문서들은 파이어폭스 OS 앱을 포함한, 앱 지역화에 좀 더 특별히 적용됩니다.

- -

L10n

- -

     파이어폭스 OS를 지역화하기 위한 L10n API에 대한 참고 문서

diff --git "a/files/ko/mozilla/\354\247\200\354\227\255\355\231\224/localizing_with_verbatim/index.html" "b/files/ko/mozilla/\354\247\200\354\227\255\355\231\224/localizing_with_verbatim/index.html" deleted file mode 100644 index 6f01ebb051..0000000000 --- "a/files/ko/mozilla/\354\247\200\354\227\255\355\231\224/localizing_with_verbatim/index.html" +++ /dev/null @@ -1,125 +0,0 @@ ---- -title: Verbatim을 이용해 지역화하기 -slug: Mozilla/지역화/Localizing_with_Verbatim -translation_of: Mozilla/Localization/Localizing_with_Pontoon ---- -

Verbatim은 모질라 웹 컨텐츠들을 지역하기 위한 웹 기반의 툴(정확힌 모질라에서 호스트된 Pootle 인스턴스)입니다 . 여러분은 모든 언어를 지원할수 있는 이 툴을 이용해 여러가지 모질라 프로젝트들을 지역화할수 있습니다. 이 가이드는 여러분을 보통의 모질라 웹 프로젝트를 지역화 하는 방법을 소개할 것입니다.이 튜토리얼은 여러분에게 Verbatim을 이용해 여러분이 지역화 커뮤니티에 공헌하기 위해 모질라 프로젝트를 지역화 하는 데에 단단한 기반을 제공해 줄 것입니다. 우리는 어떤 모질라 웹 프로젝트들이 Verbatim을 이용하고 있는 지, Verbatim을 어떻게 사용하기 시작할지,  그리고 Verbatim을 이용해서 보통 이루어진 일들에 대해서 다룰 것입니다.

-

Verbatim을 사용하기 시작하기

-

Verbatim이 온라인에 기반되어 있으므로, 번역자들은 Verbatim을 이용하기 위해서 무조건 인터넷에 연결되어 있어야 합니다. There are essentially two ways to get started with Verbatim: start a new localization or join an existing localization community's efforts. Either way, you will need to follow these steps to start working on a Verbatim project.

- - - - - - - - - - - - - - - - - - - - - -
Verbatim에서 새로운 지역화를 시작하기Verbatim에서 진행중인 지역화에 참여하기
-
    -
  1. Point your browser to http://localize.mozilla.org. This is where Verbatim is hosted.
  2. -
-
-
    -
  1. Point your browser to http://localize.mozilla.org. This is where Verbatim is hosted.
  2. -
-
-
    -
  1. If you have a Mozilla LDAP account, simply sign in using your LDAP credentials. If not, register for an account and sign in once you've completed registration. The links for both are located in the upper right-hand corner of the page.
  2. -
-
-
    -
  1. If you have a Mozilla LDAP account, simply sign in using your LDAP credentials. If not, register for an account and sign in once you've completed registration. The links for both are located in the upper right-hand corner of the page.
  2. -
-
-
    -
  1. File a bug using this prefilled bugzilla template. Add your locale code and language name to the description field, as well as any other information you'd like to share. See the following example.
  2. -
-
- Example: I would like to request that you add the en-US as a new localization in Verbatim. The langauge is English. Also, I like cookies. Lots and lots of cookies. I can easily be motivated by any and all baked goods.
-
-
    -
  1. Contact the community to find out which projects they need you to concentrate your efforts on. See the following example for what you could include in your email to the community leaders.
  2. -
-
- Example: I would like to join your localization efforts on Verbatim for this locale. Where would be the best place for me to begin? Also, I would like to buy you a drink to encourage you to let me join the team!
-
-

Now that you're registered and logged in, we'll outline the general translation workflow, using the Firefox Home project as our example.

-

Translating

-

First thing's first, you need to find untranslated source strings to translate.

-
    -
  1. Navigate to the MDN project page.
  2. -
  3. Select your language from the Overview tab.
  4. -
  5. Now click on the the Translate tab. This tab will display the directories for the MDN user interface.
  6. -
  7. Select the LC Messages directory. This is where the project's .po files containing translatable strings are located. You will now see an overview of each .po file.
  8. -
  9. In the summary column, the number of words untranslated will be shown as a link. Click on that link to be taken directly to the first string that needs to be translated.
  10. -
-

Now you're ready to contribute translations and you won't believe how easy it is. Check it out, you can contribute translations in two simple steps:

-
    -
  1. Simply type your translation in the box to below the English string
  2. -
  3. Select Suggest. If you have approval permission, select Submit. You will then be taken to the next string that needs translating.
  4. -
  5. Hooray! You're translating! Repeat steps one and two for the remainder of the untranslated strings.
  6. -
-
- Note: If you come across a string that already has a suggested translation, you can still suggest your own translation if you feel it is more accurate.
-

Some extra cool features on Verbatim

-

Here are a few additional items about the Verbatim interface that you should be aware of. Some of these can be seen in the screen shot below.

-

Translate Tab.png

- -

Additional tasks

-

If you are a localizer with approval priviledges, here are a few more tasks that you should be aware of.

-

Review suggested translations

-
    -
  1. Click on the Review tab. It will show how many strings are waiting for review for each .po file.Review Tab1.png
  2. -
  3. Select Review suggestions to start approving suggestions. It will take you to the first string that needs to be reviewed.
  4. -
  5. You can accept the suggestion by clicking the green checkmark or reject the suggestion by clicking the red X (see the screen shot from the previous section).
  6. -
-

It is important to note that only submitted strings will appear in your localized pages. Neither suggestions nor fuzzy strings will appear. Before commiting your final localized product, make sure all strings have been submitted.

-

Using VCS on Verbatim

-

VCS (Version Control System) is the repository system we use to update the project's strings as well as push your translated content onto the web. The difference between the two tasks is simply a matter of which link to click.

-

VCS.pngTo push your strings onto the web and see your changes, simply select the Commit to VCS link underneath each file name. It usually takes about an hour before you can see your changes on the project site.

-

To update your .po files with new untranslated strings, simple select the Update from VCS link underneath each file name.

-

 

-
-
- Note: Some projects are automatically updated nightly while others require you to manually update them to receive new source content. Be sure to pay close attention to this, as it can alter your workflow.
-

Translating Verbatim files with an external application

-

While in the Translate tab, you have the option to export the .po and .xliff files and translate the strings with an external application (i.e., a text editor or translation memory tool).

-
    -
  1. To download the .po file, select the Download link found underneath each file name. To download the .xliff file, select the Download XLIFF link.
  2. -
  3. Proceed to translate the strings using your selected tool.
  4. -
-

Once you've finished your translations, you'll need to upload your file to Verbatim. You can do this from the Translate tab.

-
    -
  1. Navigate to the bottom of the files list to the Upload File section.
  2. -
  3. Click on the Browse button and select the file you wish to upload.
  4. -
  5. Select an upload setting from the options provided.
  6. -
  7. Once your upload setting has been selected, click Upload.
  8. -
-
-

Important: There have been some problems in the past with community members updating their source strings while others are in the process of localizing the previous updated files. This can cause community members to overlook new source strings, producing untranslated strings in a localized project. Be sure to coordinate these manual updates within your community to avoid this problem.

-
-

You're ready to go!

-

Whew! You've arrived at the end! Time to take what you've learned and put it to good use spreading Mozilla to everyone in your region. Have fun and let us know if you run into any difficulties. We'll be happy to help in any way we can.

-

 

-

Back: Quick Start Guide

diff --git "a/files/ko/mozilla/\354\247\200\354\227\255\355\231\224/pontoon_\354\247\200\354\227\255\355\231\224/index.html" "b/files/ko/mozilla/\354\247\200\354\227\255\355\231\224/pontoon_\354\247\200\354\227\255\355\231\224/index.html" deleted file mode 100644 index 8d5664ca83..0000000000 --- "a/files/ko/mozilla/\354\247\200\354\227\255\355\231\224/pontoon_\354\247\200\354\227\255\355\231\224/index.html" +++ /dev/null @@ -1,135 +0,0 @@ ---- -title: Pontoon 지역화 하기 -slug: Mozilla/지역화/Pontoon_지역화 -translation_of: Mozilla/Localization/Localizing_with_Pontoon ---- -

Pontoon 은 보시면 알만한 (WYSIWYG) 웹 기반 지역화 (l10n) 도구 입니다. Mozilla 에서, 우리는 Firefox 부터 Mozilla.org 까지 모든 Mozilla 제품과 웹사이트들을 지역화하는데 Pontoon 을 사용합니다. Pontoon 은 지역화 작업흐름에서 기술적인 능력이 거의 없이도 사용할 수 있는 아주 간단하고 교육적인 도구입니다. 여기서 우리는 로그인 하는 것 부터 여러분의 공헌을 마무리하는 것 까지 Pontoon 을 사용해 프로젝트를 지역화하는 방법에 대해 이야기 할 것입니다. 그 과정 중에, 여러분이 지역화 공헌을 더 쉽게 그리고 더 효과적으로 할 수 있게 해주는 몇 가지 매력적인 특징들을 짚어볼 것입니다.

- -
-

개발자이십니까? implementing Pontoon in your project 를 읽어 보시거나 GitHub 에서 참여하는 방법에 대해 배워보세요.

-
- -

첫 단계

- -

Pontoon 홈페이지는 아주 사용하기 쉽습니다. 프로젝트 지역화를 시작하기 위해, Persona 아이콘을 클릭하여 로그인 하세요. 다음으로, 여러분이 작업하고 싶은 프로젝트와 여러분의 언어를 드롭다운 메뉴에서 선택하세요. Pontoon 은 여러분이 지역화를 시작할 수 있도록 선택한 언어를 자동으로 열어줍니다. 참고하세요, 여기서 우리의 목적은 Firefox Affiliates 웹사이트를 사용해 Pontoon 의 기능과 작업흐름을 데모해 보는겁니다. 이것이 Photoon 에서 그것을 열었을 때 입니다:

- -

Browser app and workspace

- -

메인 툴바

- -

보시다시피 인터페이스의 대부분은 번역되는 웹사이트에 달려있습니다. 단지 다음 항목들(왼쪽에서 오른쪽으로)을 포함하는 상단의 툴바가 Pontoon 에 속해있습니다:

- -

Main toolbar

- -

문자열의 리스트

- -

지역화를 위한 리스트를 가진 사이드바를 엽니다.

- -

프로젝트 셀렉터 (제휴된것)

- -

지역화를 위한 프로젝트를 변경합니다.

- -

리소스 셀렉터 (홈페이지)

- -

부속 페이지나 지역화 파일들같은 지역화를 위한 프로젝트 자원들을 변경합니다. 프로젝트를 위한 가용 자원이 없다면 숨깁니다.

- -

- -
-
- -

언어 셀렉터 (Slovenian)

- -

지역화를 위한 언어를 변경합니다.

- -

Go

- -

프로젝트-자원-언어 선택을 엽니다.

- -

진행상황 표시기

- -

지역화중인 자원에 대한 여러분의 진행상황을 나타냅니다. 팝업에서 세부사항을 볼 수 있습니다.

- -
-
- -

사용자 메뉴

- -

저장소에 커밋하거나 파일을 다운받고 로그아웃하기 같은 여러분만의 작업을 할 수 있도록 해줍니다.

- -

정보 메뉴

- -

키보드 단축기 목록과 기대하는 프로젝트 타임라인같은 중요한 정보를 줍니다.

- -
-
- -

좋습니다, 이제 번역 좀 해볼까요?

- -
-
- -

번역하기

- -

지역화를 위해 Pontoon 을 사용할 때 몇 가지 번역을 위한 옵션이 있습니다. 컨텍스트에서 번역하거나, 컨텍스트 밖에서 하거나, 둘의 조합에서 할 수 있습니다. 컨텍스트 단위 번역을 살펴봅시다.

- -

컨텍스트에서

- -

Pontoon's in-context translation mode is what puts it above others. 웹 페이지(또는 웹 앱)를 열고 페이지의 실시간 편집을 활성화합니다. 여기 여러분이 번역할 첫번째 문자열이 있습니다:

- -

In-context localization

- -
    -
  1. 마우스를 번역할 문자위에 올려놓으세요.
  2. -
  3. 문자위에 수정 버튼이 나타납니다. 클릭하여 번역 모드를 활성화하세요.
  4. -
  5. 원본 문자를 여러분의 언어로 번역한 문자로 바꾸세요.
  6. -
  7. 저장 버튼을 눌러 번역을 저장하세요.
  8. -
- -
-

컨텍스트 밖에서

- -

어떤 문자열은 컨텍스트 안에서 번역하는 것이 불가능합니다. 예를들면, 웹사이트의 <title> 태그 안의 내용과 유동적이거나 다양한 복수형 문자열이 있습니다. 메인 툴바의 햄버거 아이콘을 클릭하는 것으로 사이드바에 모든 번역가능한 문자열의 목록을 열 수 있습니다. 또한 컨텍스트 밖 지역화를 위해 사이드바를 사용할 수도 있습니다:

- -

Out-of-context localization: list Out-of-context localization: translate

- -
    -
  1. 번역할 문자열을 클릭하세요.
  2. -
  3. 원본 문자열과 세부 사항(코멘트들)을 포함하는 번역 패널을 여세요.
  4. -
  5. 아래 번역 공간에서 문자열을 번역하세요.
  6. -
  7. 저장 버튼을 클릭해 번역을 저장하세요.
  8. -
- -

만약 해당 문자열이 컨텍스트 안에서도 번역 가능한 것이라면 컨텍스트 밖에서 문자열을 번역한 것 처럼 웹사이트에 번역한 내용이 나타날 것입니다. 

- -

번역 도우미

-
- -

보시다시피 번역 영역 바깥에 있는 히스토리, 번역 기록, 기계 번역 그리고 다른 로케일로부터 제안을 받으실 수 있습니다. 여러분이 문장을 번역하실 때 각 도우미들은 다음과 같이 도움을 드릴 것입니다:

- -

Translation helpers: History Translation helpers: Machinery Translation helpers: Other locales Translation helpers: Search

- -

History

- -

이전에 다른 사용자들이 사용했던 제안 번역을 표시합니다.

- -

Machinery

- -

여러 서비스에서 사용된 예를 표시합니다: 내부적으로 저장된 번역 기록, Mozilla Transvision, open source translation memory, Microsoft terminology 그리고 machine translation.

- -

Other locales

- -

다른 로케일에서 사용한 번역을 표시합니다.

- - - -

Almost like machinery, but takes provided keyword as input parameter instead of the original string.

- -

추천단어를 클릭하면, 번역 영역으로 내용이 복사됩니다.

- -
-
- -

게시하기

- -

이제 여러분은 repo 에 커밋하는 것으로 지역화 작업을 게시하실 것입니다. Pontoon 으로도 가능합니다! 실제로, Pontoon 은 시간 단위로 저장소와 자동으로 동기화됩니다. 이제 이 작업을 기념하기 위해 스스로 격려하거나, 가벼운 춤을 추거나, 잠을 자거나 또는 다른 것을 해도 좋습니다!

-- cgit v1.2.3-54-g00ecf