প্রিভিউ উইজার্ড
সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
প্রিভিউ উইজার্ডটি আপনাকে দ্রুত, সহজে এবং নির্ভরযোগ্যভাবে আপনার সাইটের সাথে প্রিভিউ একত্রিত করার জন্য ডিজাইন করা হয়েছে। আপনি একটি বই দর্শক এম্বেড করতে পারেন, বই অনুসন্ধানের সাথে লিঙ্ক করতে পারেন, অথবা এমনকি আপনার সাইটে একটি পূর্বরূপ "পপআপ" উইন্ডো যুক্ত করতে পারেন—আপনাকে যা করতে হবে তা হল কোড তৈরি করা এবং এটি আপনার পৃষ্ঠায় পেস্ট করা৷ আপনি কিছু সাধারণ জাভাস্ক্রিপ্ট ফাংশন ব্যবহার করে এই কোডটি কাস্টমাইজ করতে পারেন।
প্রিভিউ উইজার্ড হল একটি সহজ সুবিধার লাইব্রেরি যা আমরা আমাদের ডায়নামিক লিঙ্ক এবং এমবেডেড ভিউয়ার API-এর উপরে তৈরি করি। আপনি যদি একজন উন্নত বিকাশকারী হন যা কাস্টমাইজড ইন্টিগ্রেশন খুঁজছেন, তাহলে অন্তর্নিহিত APIগুলি সরাসরি ব্যবহার করার কথা বিবেচনা করুন৷
আপনার পূর্বরূপ কোড তৈরি করুন
উত্পন্ন পূর্বরূপ উদাহরণ
নিম্নলিখিত উদাহরণগুলি প্রিভিউ উইজার্ড ব্যবহার করে তৈরি করা হয়েছে।
আপনার কোড কাস্টমাইজ করুন
উপরের উইজার্ড ব্যবহার করার পাশাপাশি, আপনি কিছু সাধারণ JavaScript "সহায়ক" ফাংশনকে সরাসরি কল করতে পারেন। এটি করার জন্য, আপনাকে প্রথমে প্রিভিউ উইজার্ড লাইব্রেরি লোড করতে হবে। এটি করার একটি উপায় হল আপনার পৃষ্ঠার <head>
বিভাগে নিম্নলিখিত ট্যাগ যোগ করা:
<script type="text/javascript" src="https://books.google.com/books/previewlib.js"></script>
প্রিভিউ লাইব্রেরি লোড করার পরে, আপনি আপনার নথির <body>
ভিতরে <script>
ট্যাগের মধ্যে থেকে নিম্নলিখিত ফাংশনগুলির মধ্যে যেকোনো একটি কল করতে পারেন। উদাহরণস্বরূপ, আপনি যদি "গুগল প্রিভিউ" বোতামটি সন্নিবেশ করতে চান, তাহলে আপনি পৃষ্ঠার মধ্যে বোতামের পছন্দসই অবস্থানে একটি <script>
উপাদানে এটি করার জন্য কোডটি রাখবেন।
GBS_set Language
GBS_setLanguage(languageCode)
এই ফাংশনটি কল করার পরে যোগ করা যেকোনো বোতাম বা পাঠ্যের ভাষা পরিবর্তন করে। এর মধ্যে "গুগল প্রিভিউ" বোতামের ভাষা, এম্বেড করা প্রিভিউ-এর ইন্টারফেসের ভাষা এবং আরও অনেক কিছু অন্তর্ভুক্ত রয়েছে।
পরামিতি: 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, ro, ru, sr, sk, sl, es, sv, th, tr, uk, এবং vi।
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)
যেখানেই এই ফাংশনটি বলা হয় সেখানে একটি এমবেডেড বইয়ের পূর্বরূপ সন্নিবেশ করায়৷ পূর্বরূপ অনুপলব্ধ হলে, কোন দর্শক দেখানো হয় না.
পরামিতি: Number opt_width
- দর্শকের পছন্দসই প্রস্থ, পিক্সেলে।
Number opt_height
- দর্শকের পছন্দসই উচ্চতা, পিক্সেলে।
GBS_insertPreviewButtonPopup(identifiers)
বইয়ের পূর্বরূপ উপলব্ধ থাকলে, এই ফাংশনটি একটি "গুগল প্রিভিউ" বোতাম লিখে। এই বোতামটি ক্লিক করলে আপনার পৃষ্ঠার ঠিক উপরে একটি "ফ্লোটিং প্রিভিউ উইন্ডো" খোলে। কোন পূর্বরূপ উপলব্ধ না হলে, বোতাম টানা হয় না. আরও পরিশীলিত বিকাশকারীরা এমবেডেড ভিউয়ার এপিআইতে আগ্রহী হতে পারে, যা এই ফাংশনটি অভ্যন্তরীণভাবে ব্যবহার করে৷
পরামিতি: string, Array identifier
- একটি পূর্বরূপ URL বা বই শনাক্তকারী যেমন একটি ISBN, OCLC, বা LCCN নম্বর। ডাইনামিক লিংক রিকোয়েস্ট ফরম্যাট দেখুন। আপনি যদি বইয়ের জন্য বেশ কয়েকটি বিকল্প শনাক্তকারীর বিষয়ে জানেন, আপনি এই শনাক্তকারীদের একটি অ্যারে পাস করতে পারেন, এবং যদি তাদের যেকোনো একটির জন্য একটি পূর্বরূপ উপলব্ধ থাকে তবে বোতামটি উপস্থিত হবে।
GBS_insertPreviewButtonLink(identifiers, opt_options)
বইয়ের পূর্বরূপ উপলব্ধ থাকলে, এই ফাংশনটি একটি "গুগল প্রিভিউ" বোতাম লেখে যা বইয়ের একটি পূর্বরূপ পৃষ্ঠার সাথে লিঙ্ক করে। ডিফল্টরূপে, এটি Google Books-এর পূর্বরূপের সাথে লিঙ্ক করে, কিন্তু আপনি এটিও করতে পারেন:- আপনার সাইটের একটি URL-এর সাথে লিঙ্ক করুন (যাতে একটি এমবেডেড ভিউয়ার থাকা উচিত)। আপনি একটি ঐচ্ছিক
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 License-এর অধীনে এবং কোডের নমুনাগুলি Apache 2.0 License-এর অধীনে লাইসেন্স প্রাপ্ত। আরও জানতে, Google Developers সাইট নীতি দেখুন। Java হল 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' } `"]]