[opw-web] Don't use a global function called submit()
- From: Owen Taylor <otaylor src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [opw-web] Don't use a global function called submit()
- Date: Thu, 13 Mar 2014 15:30:35 +0000 (UTC)
commit e24d202d194ffc338cc92bcdccf890e096098386
Author: Owen W. Taylor <otaylor fishsoup net>
Date: Thu Mar 13 11:28:52 2014 -0400
Don't use a global function called submit()
On older versions of Chrome and WebKit, having a global function
called submit() works badly for some reason (in the scope of our
event handler, a native function called submit() is visible instead.)
So rename submit() to submitForm().
.../html/tpl_approve_mentors_item.html | 4 ++--
.../html/tpl_manage_projects_item.html | 4 ++--
skins/easterngreen/html/tpl_program_home.html | 4 ++--
skins/easterngreen/html/tpl_user_ban_item.html | 2 +-
.../easterngreen/html/tpl_view_projects_item.html | 4 ++--
skins/easterngreen/js/main.js | 2 +-
skins/neverland/html/tpl_approve_mentors_item.html | 4 ++--
skins/neverland/html/tpl_program_home.html | 4 ++--
skins/neverland/html/tpl_user_ban_item.html | 2 +-
skins/neverland/html/tpl_view_projects_item.html | 4 ++--
skins/neverland/js/main.js | 2 +-
11 files changed, 18 insertions(+), 18 deletions(-)
---
diff --git a/skins/easterngreen/html/tpl_approve_mentors_item.html
b/skins/easterngreen/html/tpl_approve_mentors_item.html
index 215e822..135cb3c 100644
--- a/skins/easterngreen/html/tpl_approve_mentors_item.html
+++ b/skins/easterngreen/html/tpl_approve_mentors_item.html
@@ -8,11 +8,11 @@
</td>
<td class="align-right">
- <a href="#" onclick="submit(event, '[[approve_url]]')" title="{{approve}}">
+ <a href="#" onclick="submitForm(event, '[[approve_url]]')" title="{{approve}}">
<i class="icon-ok"></i>
</a>
- <a href="#" onclick="submit(event, '[[reject_url]]')" title="{{reject}}">
+ <a href="#" onclick="submitForm(event, '[[reject_url]]')" title="{{reject}}">
<i class="icon-remove"></i>
</a>
</td>
diff --git a/skins/easterngreen/html/tpl_manage_projects_item.html
b/skins/easterngreen/html/tpl_manage_projects_item.html
index 48e8347..97dba34 100644
--- a/skins/easterngreen/html/tpl_manage_projects_item.html
+++ b/skins/easterngreen/html/tpl_manage_projects_item.html
@@ -19,11 +19,11 @@
<td>
<div class="align-right [[apprej_visibility]]">
- <a href="#" onclick="submit(event, '[[approve_url]]')" title="{{approve}}">
+ <a href="#" onclick="submitForm(event, '[[approve_url]]')" title="{{approve}}">
<i class="icon-ok"></i>
</a>
- <a href="#" onclick="submit(event, '[[reject_url]]')" title="{{reject}}">
+ <a href="#" onclick="submitForm(event, '[[reject_url]]')" title="{{reject}}">
<i class="icon-remove"></i>
</a>
</div>
diff --git a/skins/easterngreen/html/tpl_program_home.html b/skins/easterngreen/html/tpl_program_home.html
index e5ad767..3ab6545 100644
--- a/skins/easterngreen/html/tpl_program_home.html
+++ b/skins/easterngreen/html/tpl_program_home.html
@@ -60,13 +60,13 @@
<div class="program-actions [[user_visibility]]">
<div class="[[prg_guest_visibility]]">
- <a href="#" onclick="submit(event,
'?q=view_projects&prg=[[program_id]]&a=apply&c=student')"
+ <a href="#" onclick="submitForm(event,
'?q=view_projects&prg=[[program_id]]&a=apply&c=student')"
class="btn btn-large [[dl_student_visibility]]">
<img src="[[skin_path]]/images/submit-project.png" width="26" height="26" alt="" />
{{apply_student}}
</a>
- <a href="#" onclick="submit(event,
'?q=view_projects&prg=[[program_id]]&a=apply&c=mentor')"
+ <a href="#" onclick="submitForm(event,
'?q=view_projects&prg=[[program_id]]&a=apply&c=mentor')"
class="btn btn-large [[dl_mentor_visibility]]">
<img src="[[skin_path]]/images/mentor-project.png" width="26" height="26" alt="" />
{{apply_mentor}}
diff --git a/skins/easterngreen/html/tpl_user_ban_item.html b/skins/easterngreen/html/tpl_user_ban_item.html
index 2734609..5f4dfc3 100644
--- a/skins/easterngreen/html/tpl_user_ban_item.html
+++ b/skins/easterngreen/html/tpl_user_ban_item.html
@@ -4,7 +4,7 @@
</td>
<td>
- <a href="#" onclick="submit(event, '[[unban_url]]')" title="{{unban_user}}">
+ <a href="#" onclick="submitForm(event, '[[unban_url]]')" title="{{unban_user}}">
<i class="icon-remove"></i>
</a>
</td>
diff --git a/skins/easterngreen/html/tpl_view_projects_item.html
b/skins/easterngreen/html/tpl_view_projects_item.html
index f237644..65f1167 100644
--- a/skins/easterngreen/html/tpl_view_projects_item.html
+++ b/skins/easterngreen/html/tpl_view_projects_item.html
@@ -15,11 +15,11 @@
<td>
<div class="align-right [[apprej_visibility]]">
- <a href="#" onclick="submit(event, '[[approve_url]]')" title="{{approve}}">
+ <a href="#" onclick="submitForm(event, '[[approve_url]]')" title="{{approve}}">
<i class="icon-ok"></i>
</a>
- <a href="#" onclick="submit(event, '[[reject_url]]')" title="{{reject}}">
+ <a href="#" onclick="submitForm(event, '[[reject_url]]')" title="{{reject}}">
<i class="icon-remove"></i>
</a>
</div>
diff --git a/skins/easterngreen/js/main.js b/skins/easterngreen/js/main.js
index ec05b33..dc6780f 100644
--- a/skins/easterngreen/js/main.js
+++ b/skins/easterngreen/js/main.js
@@ -1,4 +1,4 @@
-function submit(evt, url) {
+function submitForm(evt, url) {
evt.preventDefault();
var form = document.getElementsByTagName("form")[0];
var oldAction = form.action;
diff --git a/skins/neverland/html/tpl_approve_mentors_item.html
b/skins/neverland/html/tpl_approve_mentors_item.html
index 05942ec..a3df83b 100644
--- a/skins/neverland/html/tpl_approve_mentors_item.html
+++ b/skins/neverland/html/tpl_approve_mentors_item.html
@@ -4,11 +4,11 @@
</td>
<td class="align-right">
- <a href="#" onclick="submit(event, '[[approve_url]]')" title="{{approve}}">
+ <a href="#" onclick="submitForm(event, '[[approve_url]]')" title="{{approve}}">
<i class="icon-ok"></i>
</a>
- <a href="#" onclick="submit(event, '[[reject_url]]')" title="{{reject}}">
+ <a href="#" onclick="submitForm(event, '[[reject_url]]')" title="{{reject}}">
<i class="icon-remove"></i>
</a>
</td>
diff --git a/skins/neverland/html/tpl_program_home.html b/skins/neverland/html/tpl_program_home.html
index a6a1788..15392f5 100644
--- a/skins/neverland/html/tpl_program_home.html
+++ b/skins/neverland/html/tpl_program_home.html
@@ -67,13 +67,13 @@
<div class="program-actions [[user_visibility]]">
<div class="[[prg_guest_visibility]]">
- <a href="#" onclick="submit(event,
'?q=view_projects&prg=[[program_id]]&a=apply&c=student')"
+ <a href="#" onclick="submitForm(event,
'?q=view_projects&prg=[[program_id]]&a=apply&c=student')"
class="btn btn-large [[dl_student_visibility]]">
<img src="[[skin_path]]/images/submit-project.png" width="26" height="26" alt="" />
{{apply_student}}
</a>
- <a href="#" onclick="submit(event,
'?q=view_projects&prg=[[program_id]]&a=apply&c=mentor')"
+ <a href="#" onclick="submitForm(event,
'?q=view_projects&prg=[[program_id]]&a=apply&c=mentor')"
class="btn btn-large [[dl_mentor_visibility]]">
<img src="[[skin_path]]/images/mentor-project.png" width="26" height="26" alt="" />
{{apply_mentor}}
diff --git a/skins/neverland/html/tpl_user_ban_item.html b/skins/neverland/html/tpl_user_ban_item.html
index 2734609..5f4dfc3 100644
--- a/skins/neverland/html/tpl_user_ban_item.html
+++ b/skins/neverland/html/tpl_user_ban_item.html
@@ -4,7 +4,7 @@
</td>
<td>
- <a href="#" onclick="submit(event, '[[unban_url]]')" title="{{unban_user}}">
+ <a href="#" onclick="submitForm(event, '[[unban_url]]')" title="{{unban_user}}">
<i class="icon-remove"></i>
</a>
</td>
diff --git a/skins/neverland/html/tpl_view_projects_item.html
b/skins/neverland/html/tpl_view_projects_item.html
index ef13757..293bbbe 100644
--- a/skins/neverland/html/tpl_view_projects_item.html
+++ b/skins/neverland/html/tpl_view_projects_item.html
@@ -11,11 +11,11 @@
<td>
<div class="align-right [[apprej_visibility]]">
- <a href="#" onclick="submit(event, '[[approve_url]]')" title="{{approve}}">
+ <a href="#" onclick="submitForm(event, '[[approve_url]]')" title="{{approve}}">
<i class="icon-ok"></i>
</a>
- <a href="#" onclick="submit(event, '[[reject_url]]')" title="{{reject}}">
+ <a href="#" onclick="submitForm(event, '[[reject_url]]')" title="{{reject}}">
<i class="icon-remove"></i>
</a>
</div>
diff --git a/skins/neverland/js/main.js b/skins/neverland/js/main.js
index 8ea4893..6c181e8 100644
--- a/skins/neverland/js/main.js
+++ b/skins/neverland/js/main.js
@@ -4,7 +4,7 @@
* @copyright (c) 2012 KDE. All rights reserved.
*/
-function submit(evt, url) {
+function submitForm(evt, url) {
evt.preventDefault();
var form = document.getElementsByTagName("form")[0];
var oldAction = form.action;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]