미리보기 마법사
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
미리보기 마법사는 미리보기를 사이트에 빠르고 쉽고 안정적으로 통합할 수 있도록 설계되었습니다. 도서 뷰어를 삽입하거나 도서 검색에 링크를 걸 수 있으며 사이트에 미리보기 '팝업' 창을 추가할 수도 있습니다. 코드를 생성하고 페이지에 붙여넣기만 하면 됩니다. 간단한 자바스크립트 함수를 사용하여 이 코드를 맞춤설정할 수도 있습니다.
미리보기 마법사는 동적 링크 및 삽입된 뷰어 API를 기반으로 빌드된 간단한 편의 라이브러리입니다. 맞춤 통합을 원하는 고급 개발자라면 기본 API를 직접 사용해 보세요.
미리보기 코드 생성
생성된 미리보기의 예
다음은 미리보기 마법사를 사용하여 생성된 예시입니다.
코드 맞춤설정
위의 마법사를 사용하는 것 외에도 몇 가지 간단한 JavaScript '도우미' 함수를 직접 호출할 수 있습니다. 이렇게 하려면 먼저 미리보기 마법사 라이브러리를 로드해야 합니다. 이를 위한 한 가지 방법은 다음 태그를 페이지의 <head>
섹션에 추가하는 것입니다.
<script type="text/javascript" src="https://books.google.com/books/previewlib.js"></script>
미리보기 라이브러리를 로드한 후에는 문서의 <body>
내 <script>
태그 내에서 다음 함수를 호출할 수 있습니다. 예를 들어 'Google 미리보기' 버튼을 삽입하려면 페이지 내에서 원하는 버튼 위치에 있는 <script>
요소에 삽입하도록 코드를 삽입합니다.
GBS_setLanguage
GBS_setLanguage(languageCode)
이 함수가 호출된 후에 추가된 버튼 또는 텍스트의 언어를 변경합니다. 여기에는 'Google 미리보기' 버튼의 언어, 삽입된 미리보기의 인터페이스 언어 등이 포함됩니다.
매개변수:
string languageCode
- 원하는 RFC 3066 언어 코드 (기본값은 영어의 경우 'en'). 현재 지원되는 언어 코드로는 hy, bg, ca, zh-CN, zh-TW, hr, cs, da, nl, en, fil, fi, fr, de, el, hi, hu, is, id, in, it, ja, ko, lv, lt, no, pl, pt-BR, pt-PT, lt, no, pl, pt-BR, pt-PT, ko
GBS_setViewerOptions
GBS_setViewerOptions(optionObj)
매개변수:
Object optionsObj
- Embedded Viewer API의 DefaultViewer 생성자에 전달된 키-값 쌍 집합입니다. 일반적으로 이 속성은 고급 맞춤설정에 사용됩니다.
GBS_setCobrandName
GBS_setCobrandName(cobrandName)
파트너 프로그램의 출판사가 사용하도록 설계된 이 함수는 도서 검색에 미리보기 링크를 삽입할 때 파트너십 검색 사이트를 사용하도록 설정합니다. 버튼을 삽입하기 전에 이 함수를 호출하면 사용자에게 도서검색 미리보기 위에 파트너 로고가 표시됩니다.
GBS_insertEmbeddedViewer
GBS_insertEmbeddedViewer(identifier, opt_width, opt_height)
이 함수가 호출될 때마다 삽입된 도서 미리보기를 삽입합니다. 미리보기를 사용할 수 없는 경우 뷰어가 표시되지 않습니다.
매개변수:
string identifier
- 미리보기 URL 또는 도서 식별자(예: ISBN, OCLC, LCCN 번호)입니다. 동적 링크 요청 형식을 참고하세요.
Number opt_width
- 뷰어의 원하는 너비(픽셀)입니다.
Number opt_height
- 뷰어의 원하는 높이(픽셀)입니다.
GBS_insertPreviewButtonPopup(identifiers)
매개변수:
string, Array identifier
- 미리보기 URL 또는 도서 식별자(예: ISBN, OCLC, LCCN 번호)입니다. 동적 링크 요청 형식을 참고하세요. 책의 대체 식별자를 여러 개 알고 있는 경우 이러한 식별자의 배열을 전달할 수 있습니다. 그러면 미리보기가 제공되는 경우 버튼이 표시됩니다.
GBS_insertPreviewButtonLink(identifiers, opt_options)
도서 미리보기가 제공되는 경우 이 함수는 책의 미리보기 페이지로 연결되는 'Google 미리보기' 버튼을 작성합니다. 기본적으로 이 링크는 Google 도서의 미리보기로 연결되지만 다음 작업도 할 수 있습니다.
- 포함된 뷰어를 포함해야 합니다. 선택사항인
alternativeUrl
옵션을 전달하면 됩니다.
- 이 함수 전에 GBS_setCobrandName을 호출하면 도서 미리보기 페이지의 파트너 도서검색 버전으로 연결되는 링크를 제공할 수 있습니다.
사용자에게 미리보기가 제공되지 않으면 페이지에 버튼이 표시되지 않습니다.
매개변수:
string, Array identifier
- 미리보기 URL 또는 도서 식별자(예: ISBN, OCLC, LCCN 번호)입니다. 동적 링크 요청 형식을 참고하세요. 책의 대체 식별자를 여러 개 알고 있는 경우 이러한 식별자의 배열을 전달할 수 있습니다. 그러면 미리보기가 제공되는 경우 버튼이 표시됩니다.
Object opt_options
- 선택사항 - 버튼의 동작을 구성하는 데 사용되는 이름-값 맵입니다. 현재 한 가지 옵션(alternativeUrl
)이 지원됩니다. 예를 들어 Google 미리보기 버튼을 사이트의 맞춤 미리보기 페이지로 연결하려면 다음을 두 번째 인수로 GBS_insertPreviewButtonLink
에 전달하기만 하면 됩니다.
{ 'alternativeUrl' : 'http://yoursite.com/your-preview-page' }
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2024-06-28(UTC)
[null,null,["최종 업데이트: 2024-06-28(UTC)"],[],[],null,["# Preview Wizard\n\nThe Preview Wizard is designed to let you quickly, easily, and reliably integrate previews with your site. You can embed a book viewer, link to Book Search, or even add a preview \"popup\" window to your site---all you need to do is [generate the code](#generateCode) and paste it onto your page. You can also [customize this code](#customizeYourCode) using some simple JavaScript functions.\n\nThe Preview Wizard is a simple convenience library we built on top of our [Dynamic Links](/books/docs/dynamic-links) and [Embedded Viewer](/books/docs/viewer/developers_guide) APIs. If you're an advanced developer looking for customized integration, consider\nusing the underlying APIs directly.\n\nGenerate your preview code\n--------------------------\n\n#### Enter book identifiers\n\nTell us all the ISBNs or other identifiers you know of for this book. If we can find a preview associated with any of these numbers, we can make it available to your site's users:\n\n|--------------------------------------|---|\n| ISBN OCLC number LCCN Book Search ID | |\n| ISBN OCLC number LCCN Book Search ID | |\n| ISBN OCLC number LCCN Book Search ID | |\n\n[Enter more identifiers...](about:invalid#zGoSafez)\n\n#### Choose how to show the book preview\n\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| If a preview is available for this book, what should the user see on your page? |---|------------------------------------------------------------------------| | | An embedded book viewer. Viewer size: pixels wide, pixels high | | | A button that opens a floating book viewer. | | | A button that links to the book's preview page on Book Search. | | | A button that goes to a custom preview page on your site. Preview URL: | If no preview can be found for the specified book(s), the preview or button will be automatically disabled and nothing will appear. | |\n\n#### Select your language\n\nChinese (Simplified) Chinese (Traditional) Dutch English French German Italian Japanese Portuguese (Brazilian) Russian Spanish\n\n#### Generate code for your web page\n\nExamples of generated previews\n------------------------------\n\nThe following examples were generated using the Preview Wizard.\n\n- [previewwizard-embed](/books/examples/previewwizard-embed): Embeds a book viewer on the page.\n- [previewwizard-popup](/books/examples/previewwizard-popup): Adds a button that can be clicked to open a floating preview over the page.\n- [previewwizard-linktogbs](/books/examples/previewwizard-linktogbs): Inserts a button that links to the preview on the Book Search site.\n- [previewwizard-customurl](/books/examples/previewwizard-customurl): Shows a button that goes to a specific URL.\n\nCustomize your code\n-------------------\n\nIn addition to using the wizard above, you can call some simple JavaScript \"helper\" functions directly. To do this, you should first load the Preview Wizard library. One way to do this is by adding the following tag to the `\u003chead\u003e` section of your page: \n\n```\n\u003cscript type=\"text/javascript\" src=\"https://books.google.com/books/previewlib.js\"\u003e\u003c/script\u003e\n```\n\nHaving loaded the preview library, you can then call any of the following functions from within `\u003cscript\u003e` tags inside your document's `\u003cbody\u003e`. For example, if you'd like to insert the \"Google Preview\" button, you'd put the code to do so in a `<script\u003e` element at the button's desired position within the page.\n\n### GBS_setLanguage\n\n```\nGBS_setLanguage(languageCode)\n```\n\nChanges the language of any buttons or text added after this function is called. This includes the language of the \"Google Preview\" button, the interface language of the embedded preview, and so on.\n\n\u003c!-- --\u003e\n\n**Parameters:** *string*` languageCode ` - The desired RFC 3066 language code (default is 'en' for English). Currently supported language codes include hy, bg, ca, zh-CN, zh-TW, hr, cs, da, nl, en, fil, fi, fr, de, el, hi, hu, is, id, in, it, ja, ko, lv, lt, no, pl, pt-BR, pt-PT, ro, ru, sr, sk, sl, es, sv, th, tr, uk, and vi.\n\n### GBS_setViewerOptions\n\n```\nGBS_setViewerOptions(optionObj)\n```\n\n**Parameters:** *Object*` optionsObj ` - A set of key-value pairs passed to the Embedded Viewer API's [DefaultViewer constructor](/books/docs/viewer/reference#google.books.DefaultViewer). Typically, this is used for advanced customizations.\n\n### GBS_setCobrandName\n\n```\nGBS_setCobrandName(cobrandName)\n```\n\nIntended for use by publishers in the [Partner Program](https://books.google.com/partner), this function sets the [Co-Branded Search](https://books.google.com/support/partner/bin/answer.py?hl=en&answer=65113) site to be used when inserting any preview links to Book Search. Calling this function before inserting a button ensures that users see the partner's logo above the Book Search previews.\n\n\u003c!-- --\u003e\n\n**Parameters:** *string*` cobrandName ` - The cobrand name to be added to any Book Search URLs. This is typically what comes after `/p/` in existing Co-Branded Search preview URLs.\n- For example, setting the value to `sup` will send the user to links like \n `https://books.google.com/books/p/sup?id=Q8ysL64pM54C&printsec=frontcover` \n rather than the default \n `https://books.google.com/books?id=Q8ysL64pM54C&printsec=frontcover`\n\n### GBS_insertEmbeddedViewer\n\n```\nGBS_insertEmbeddedViewer(identifier, opt_width, opt_height)\n```\n\nInserts an embedded book preview wherever this function is called. If the preview is unavailable, no viewer is shown.\n\n\u003c!-- --\u003e\n\n**Parameters:** *string*` identifier ` - A preview URL or book identifier such as an ISBN, OCLC, or LCCN number. See [Dynamic Links request format](/books/docs/dynamic-links#requestFormat).\n\u003c!-- --\u003e\n\n*Number*` opt_width ` - The desired width of the viewer, in pixels.\n\u003c!-- --\u003e\n\n*Number*` opt_height ` - The desired height of the viewer, in pixels.\n\n### GBS_insertPreviewButtonPopup\n\n```\nGBS_insertPreviewButtonPopup(identifiers)\n```\n\nIf the book preview is available, this function writes out a \"Google Preview\" button. Clicking this button opens a \"floating preview window\" right on top of your page. If no preview is available, the button is not drawn.\n- More sophisticated developers may be interested in the [Embedded Viewer API](/books/docs/viewer/developers_guide), which this function uses internally.\n\n\u003c!-- --\u003e\n\n**Parameters:** *string, Array*` identifier ` - A preview URL or book identifier such as an ISBN, OCLC, or LCCN number. See [Dynamic Links request format](/books/docs/dynamic-links#requestFormat). If you know of several alternative identifiers for the book, you can pass an array of these identifiers, and the button will appear if a preview is available for any one of them.\n\n### GBS_insertPreviewButtonLink\n\n```\nGBS_insertPreviewButtonLink(identifiers, opt_options)\n```\n\nIf the book preview is available, this function writes out a \"Google Preview\" button that simply links off to a preview page for the book. By default, this links to the preview on Google Books, but you can also:\n- link to a URL on your site (which should, in turn contain an embedded viewer). You can do this by passing an optional `alternativeUrl` option.\n- link to a Co-Branded version of the book preview page, if [GBS_setCobrandName](#GBS_setCobrandName) is called before this function.\nIf no preview is available to the user, no button is drawn onto the page.\n\n\u003c!-- --\u003e\n\n**Parameters:** *string, Array*` identifier ` - A preview URL or book identifier such as an ISBN, OCLC, or LCCN number. See [Dynamic Links request format](/books/docs/dynamic-links#requestFormat). If you know of several alternative identifiers for the book, you can pass an array of these identifiers, and the button will appear if a preview is available for any one of them.\n\u003c!-- --\u003e\n\n*Object*` opt_options ` - *optional* - A name-value map used to configure the behavior of the button. Currently one option is supported: `alternativeUrl`. For example, to have the Google Preview button link to a custom preview page on your site, simply pass the following as a second argument to `GBS_insertPreviewButtonLink`: \n` { 'alternativeUrl' : 'http://yoursite.com/your-preview-page' } `"]]