Debian Codegraph @

closure-library/closure/goog/ui/editor/messages.js

raw
1 // Copyright 2008 The Closure Library Authors. All Rights Reserved.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS-IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 /**
16 * @fileoverview Messages common to Editor UI components.
17 *
18 * @author [email protected] (Robby Walker)
19 */
20
21 goog.provide('goog.ui.editor.messages');
22
23 goog.require('goog.html.SafeHtmlFormatter');
24
25
26 /** @desc Link button / bubble caption. */
27 goog.ui.editor.messages.MSG_LINK_CAPTION = goog.getMsg('Link');
28
29
30 /** @desc Title for the dialog that edits a link. */
31 goog.ui.editor.messages.MSG_EDIT_LINK = goog.getMsg('Edit Link');
32
33
34 /** @desc Prompt the user for the text of the link they've written. */
35 goog.ui.editor.messages.MSG_TEXT_TO_DISPLAY = goog.getMsg('Text to display:');
36
37
38 /** @desc Prompt the user for the URL of the link they've created. */
39 goog.ui.editor.messages.MSG_LINK_TO = goog.getMsg('Link to:');
40
41
42 /** @desc Prompt the user to type a web address for their link. */
43 goog.ui.editor.messages.MSG_ON_THE_WEB = goog.getMsg('Web address');
44
45
46 /** @desc More details on what linking to a web address involves.. */
47 goog.ui.editor.messages.MSG_ON_THE_WEB_TIP =
48 goog.getMsg('Link to a page or file somewhere else on the web');
49
50
51 /**
52 * @desc Text for a button that allows the user to test the link that
53 * they created.
54 */
55 goog.ui.editor.messages.MSG_TEST_THIS_LINK = goog.getMsg('Test this link');
56
57
58 /**
59 * @return {!goog.html.SafeHtml} SafeHtml version of MSG_TR_LINK_EXPLANATION.
60 */
61 goog.ui.editor.messages.getTrLinkExplanationSafeHtml = function() {
62 var formatter = new goog.html.SafeHtmlFormatter();
63
64 /**
65 * @desc Explanation for how to create a link with the link-editing dialog.
66 */
67 var MSG_TR_LINK_EXPLANATION = goog.getMsg(
68 '{$startBold}Not sure what to put in the box?{$endBold} ' +
69 'First, find the page on the web that you want to ' +
70 'link to. (A {$searchEngineLink}search engine{$endLink} ' +
71 'might be useful.) Then, copy the web address from ' +
72 'the box in your browser\'s address bar, and paste it into ' +
73 'the box above.',
74 {
75 'startBold': formatter.startTag('b'),
76 'endBold': formatter.endTag('b'),
77 'searchEngineLink': formatter.startTag(
78 'a', {'href': 'http://www.google.com/', 'target': '_new'}),
79 'endLink': formatter.endTag('a')
80 });
81
82 return formatter.format(MSG_TR_LINK_EXPLANATION);
83 };
84
85
86 /** @desc Prompt for the URL of a link that the user is creating. */
87 goog.ui.editor.messages.MSG_WHAT_URL =
88 goog.getMsg('To what URL should this link go?');
89
90
91 /**
92 * @desc Prompt for an email address, so that the user can create a link
93 * that sends an email.
94 */
95 goog.ui.editor.messages.MSG_EMAIL_ADDRESS = goog.getMsg('Email address');
96
97
98 /**
99 * @desc Explanation of the prompt for an email address in a link.
100 */
101 goog.ui.editor.messages.MSG_EMAIL_ADDRESS_TIP =
102 goog.getMsg('Link to an email address');
103
104
105 /** @desc Error message when the user enters an invalid email address. */
106 goog.ui.editor.messages.MSG_INVALID_EMAIL =
107 goog.getMsg('Invalid email address');
108
109
110 /**
111 * @desc When the user creates a mailto link, asks them what email
112 * address clicking on this link will send mail to.
113 */
114 goog.ui.editor.messages.MSG_WHAT_EMAIL =
115 goog.getMsg('To what email address should this link?');
116
117
118 /**
119 * @return {!goog.html.SafeHtml} SafeHtml version of MSG_EMAIL_EXPLANATION.
120 */
121 goog.ui.editor.messages.getEmailExplanationSafeHtml = function() {
122 var formatter = new goog.html.SafeHtmlFormatter();
123
124 /**
125 * @desc Warning about the dangers of creating links with email
126 * addresses in them.
127 */
128 var MSG_EMAIL_EXPLANATION = goog.getMsg(
129 '{$preb}Be careful.{$postb} ' +
130 'Remember that any time you include an email address on a web ' +
131 'page, nasty spammers can find it too.',
132 {'preb': formatter.startTag('b'), 'postb': formatter.endTag('b')});
133
134 return formatter.format(MSG_EMAIL_EXPLANATION);
135 };
136
137
138 /**
139 * @desc Label for the checkbox that allows the user to specify what when this
140 * link is clicked, it should be opened in a new window.
141 */
142 goog.ui.editor.messages.MSG_OPEN_IN_NEW_WINDOW =
143 goog.getMsg('Open this link in a new window');
144
145
146 /** @desc Image bubble caption. */
147 goog.ui.editor.messages.MSG_IMAGE_CAPTION = goog.getMsg('Image');