Skip to content

Commit 8cdd35f

Browse files
line 259
1 parent f0e5c94 commit 8cdd35f

1 file changed

Lines changed: 14 additions & 13 deletions

File tree

3-frames-and-windows/01-popup-windows/article.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -237,22 +237,23 @@ window.onblur = () => window.focus();
237237

238238
برای مثال:
239239

240-
- When we open a popup, it might be a good idea to run `newWindow.focus()` on it. Just in case, for some OS/browser combinations it ensures that the user is in the new window now.
241-
- If we want to track when a visitor actually uses our web-app, we can track `window.onfocus/onblur`. That allows us to suspend/resume in-page activities, animations etc. But please note that the `blur` event means that the visitor switched out from the window, but they still may observe it. The window is in the background, but still may be visible.
240+
- وقتی یک popup باز می‌کنیم، ممکن است ایده‌ی خوبی باشد که `newWindow.focus()` را روی آن اجرا کنیم. در هر صورت، برای برخی ترکیبات سیستم‌عامل/مرورگر، تضمین می‌کند که کاربر اکنون در پنجره‌ی جدید است.
241+
- گر بخواهیم ردیابی کنیم که چه زمانی بازدیدکننده واقعاً از برنامه‌ی وب ما استفاده می کند، می توانیم `window.onfocus/onblur` را ردیابی کنیم. این به ما امکان می‌دهد فعالیت‌های درون صفحه، انیمیشن‌ها و... را تعلیق/ازسرگیری کنیم. اما لطفا توجه داشته باشید که `blur` event به این معنی است که بازدیدکننده از پنجره خارج شده است، اما همچنان ممکن است آن را مشاهده کند. پنجره در پس‌زمینه است، اما همچنان ممکن است قابل مشاهده باشد.
242+
-
242243

243-
## Summary
244+
## خلاصه
244245

245-
Popup windows are used rarely, as there are alternatives: loading and displaying information in-page, or in iframe.
246+
پنجره‌های popup به ندرت استفاده می‌شوند. چون گزینه‌های دیگری وجود دارند: load کردن و نمایش دادن اطلاعات در صفحه یا در iframe.
246247

247-
If we're going to open a popup, a good practice is to inform the user about it. An "opening window" icon near a link or button would allow the visitor to survive the focus shift and keep both windows in mind.
248+
اگر می‌خواهیم یک popup باز کنیم، یک تمرین خوب این است که به کاربر درباره‌ی آن اطلاعات بدهیم. یک نماد "opening window" نزدیک یک لینک یا دکمه به بازدیدکننده اجازه می‌دهد تا از تغییر فوکوس جان سالم به در ببرد و هر دو پنجره را در ذهن نگه دارد.
248249

249-
- A popup can be opened by the `open(url, name, params)` call. It returns the reference to the newly opened window.
250-
- Browsers block `open` calls from the code outside of user actions. Usually a notification appears, so that a user may allow them.
251-
- Browsers open a new tab by default, but if sizes are provided, then it'll be a popup window.
252-
- The popup may access the opener window using the `window.opener` property.
253-
- The main window and the popup can freely read and modify each other if they have the same origin. Otherwise, they can change location of each other and [exchange messages](info:cross-window-communication).
250+
- یک popup می‌تواند با فراخوانی `open(url, name, params)` باز شود. آن ارجاع را به پنجره‌ی تازه بازشده بازمی‌گرداند.
251+
- مرورگرها فراخوانی‌های `open` از خارج کنش‌های کاربر را مسدود می‌کنند. معمولا یک اعلان ظاهر می‌شود که کاربر ممکن است به آن‌ها اجازه بدهد.
252+
- مرورگرها به صورت پیش‌فرض یک tab جدید باز می‌کنند اما اگر اندازه‌ها ارائه شده باشند، آنگاه یک پنجره‌ی popup خواهد بود.
253+
- پنجره‌ی popup ممکن است با استفاده از `window.opener` property به پنجره‌ی بازکننده دسترسی داشته باشد.
254+
- اگر popup و پنجره‌ی اصلی از یک مبدا باشند، می‌توانند به صورت آزادانه یکدیگر را بخوانند یا تغییر دهند. در غیر این صورت، می‌توانند مکان یکدیگر را تغییر دهند و [پیام رد و بدل کنند](info:cross-window-communication).
254255

255-
To close the popup: use `close()` call. Also the user may close them (just like any other windows). The `window.closed` is `true` after that.
256+
برای بستن popup: از فراخوانی `close()` استفاده کنید. همچنین کاربر ممکن است آن‌ها را ببندد (دقیقا شبیه هر پنجره‌ی دیگری). بعد از آن مقدار `window.closed` برابر `true` است.
256257

257-
- Methods `focus()` and `blur()` allow to focus/unfocus a window. But they don't work all the time.
258-
- Events `focus` and `blur` allow to track switching in and out of the window. But please note that a window may still be visible even in the background state, after `blur`.
258+
- متدهای `focus()` و `blur()` اجازه می‌دهند که روی یک پنجره focus/unfocus کنیم. اما آن‌ها همیشه کار نمی‌کنند.
259+
- با `focus` and `blur` events امکان ردیابی جابه‌جایی در داخل و خارج صفحه فراهم می‌شود/ اما لطفا توجه داشته باشید که بعد از `blur` یک پنجره ممکن است همچنان در وضعیت پس‌زمینه قابل مشاهده باشد.

0 commit comments

Comments
 (0)