~csaba-kertesz/ubufox/lp509536

« back to all changes in this revision

Viewing changes to content/overlay.js

  • Committer: Alexander Sack
  • Date: 2009-10-09 12:16:09 UTC
  • Revision ID: asac@ubuntu.com-20091009121609-dzm3mu0g210ek6o6
* fix LP: #427697 - Ubufox links to Firefox 3.0 bugs and answers
  on Karmic; the fix involves replacing all hard coded firefox
  version strings in overlay.js with getAppVersion(); this fixes
  "get help", "translate ..." and "report a problem" menu items.
  - update content/overlay.js

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
 * 
35
35
 * ***** END LICENSE BLOCK ***** */
36
36
 
 
37
function getAppVersion ()
 
38
{
 
39
  var versionString = null;
 
40
  try {
 
41
    versionString = Components.classes["@mozilla.org/fuel/application;1"].getService(Components.interfaces.extIApplication).version;
 
42
  } catch (e) {
 
43
  }
 
44
 
 
45
  if (versionString == null)
 
46
    return NULL;
 
47
 
 
48
  if (String_startsWith (versionString, "3.0"))
 
49
    versionString = "3.0";
 
50
  else if (String_startsWith (versionString, "3.5"))
 
51
    versionString = "3.5";
 
52
  else if (String_startsWith (versionString, "3.6"))
 
53
    versionString = "3.6";
 
54
  else if (String_startsWith (versionString, "3.7"))
 
55
    versionString = "3.7";
 
56
 
 
57
  return versionString;
 
58
}
 
59
 
37
60
var ubufox = {
38
61
  onAddonsLoad: function () {
39
62
    this.isffox3 = false;
133
156
 
134
157
  procUtil.init(executable);
135
158
 
136
 
  var args = new Array("-p", "firefox" );
 
159
  var args = null;
 
160
  if (getAppVersion())
 
161
    args = new Array("-p", "firefox-" + getAppVersion());
 
162
  else
 
163
    args = new Array("-p", "firefox" );
 
164
 
137
165
  var res = procUtil.run(false, args, args.length);
138
166
}
139
167
 
140
168
 
141
169
function ubufoxGetHelpOnline(event)
142
170
{
143
 
  openUILink("https://launchpad.net/distros/ubuntu/karmic/+sources/firefox-3.5/+gethelp", event, false, true);
 
171
  var getHelpUrl = "https://launchpad.net/distros/ubuntu/karmic/+sources/firefox-" + getAppVersion () + "/+gethelp";
 
172
  openUILink(getHelpUrl, event, false, true);
144
173
}
145
174
 
146
175
function ubufoxHelpTranslateLaunchpad(event)
147
176
{
148
 
  openUILink("https://launchpad.net/distros/ubuntu/karmic/+sources/firefox-3.5/+translate", event, false, true);
 
177
  var translateUrl = "https://launchpad.net/distros/ubuntu/karmic/+sources/firefox-" + getAppVersion () + "/+translate";
 
178
  openUILink(translateUrl, event, false, true);
149
179
}
150
180
 
151
181
function ubufoxCheckExecutable(filename)