summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore4
-rw-r--r--Bugzilla/Install/Filesystem.pm77
-rw-r--r--Bugzilla/Template.pm17
-rw-r--r--Bugzilla/Util.pm8
-rw-r--r--extensions/BMO/template/en/default/bug/create/create-automative.html.tmpl1
-rw-r--r--extensions/BMO/template/en/default/bug/create/create-creative.html.tmpl1
-rw-r--r--extensions/BMO/template/en/default/bug/create/create-data-compliance.html.tmpl1
-rw-r--r--extensions/BMO/template/en/default/bug/create/create-dev-engagement-event.html.tmpl1
-rw-r--r--extensions/BMO/template/en/default/bug/create/create-doc.html.tmpl1
-rw-r--r--extensions/BMO/template/en/default/bug/create/create-fsa-budget.html.tmpl1
-rw-r--r--extensions/BMO/template/en/default/bug/create/create-mdn.html.tmpl1
-rw-r--r--extensions/BMO/template/en/default/bug/create/create-mozpr.html.tmpl1
-rw-r--r--extensions/BMO/template/en/default/bug/create/create-swag.html.tmpl1
-rw-r--r--extensions/BMO/template/en/default/bug/create/create-user-engagement.html.tmpl1
-rw-r--r--extensions/BMO/template/en/default/pages/attachment_bounty_form.html.tmpl1
-rw-r--r--extensions/BMO/template/en/default/pages/group_admins.html.tmpl1
-rw-r--r--extensions/BMO/template/en/default/pages/triage_reports.html.tmpl1
-rw-r--r--extensions/BMO/template/en/default/pages/user_activity.html.tmpl1
-rw-r--r--extensions/GuidedBugEntry/template/en/default/guided/guided.html.tmpl4
-rw-r--r--extensions/MyDashboard/template/en/default/pages/mydashboard.html.tmpl6
-rw-r--r--extensions/MyDashboard/web/js/flags.js394
-rw-r--r--extensions/MyDashboard/web/js/query.js462
-rw-r--r--extensions/ProductDashboard/template/en/default/pages/productdashboard.html.tmpl9
-rw-r--r--extensions/ProductDashboard/web/js/components.js136
-rw-r--r--extensions/ProductDashboard/web/js/duplicates.js38
-rw-r--r--extensions/ProductDashboard/web/js/popularity.js38
-rw-r--r--extensions/ProductDashboard/web/js/recents.js44
-rw-r--r--extensions/ProductDashboard/web/js/roadmap.js30
-rw-r--r--extensions/ProductDashboard/web/js/summary.js64
-rw-r--r--extensions/REMO/template/en/default/bug/create/create-remo-budget.html.tmpl1
-rw-r--r--extensions/REMO/template/en/default/bug/create/create-remo-swag.html.tmpl1
-rw-r--r--extensions/REMO/template/en/default/pages/remo-form-payment.html.tmpl1
-rw-r--r--extensions/Splinter/template/en/default/pages/splinter.html.tmpl12
-rw-r--r--js/yui.js.list12
-rw-r--r--js/yui/yahoo-dom-event/yahoo-dom-event-min.js (renamed from js/yui/yahoo-dom-event/yahoo-dom-event.js)0
-rw-r--r--js/yui3.js.list75
-rw-r--r--skins/yui.css.list5
-rw-r--r--skins/yui3.css.list5
-rw-r--r--template/en/default/attachment/create.html.tmpl1
-rw-r--r--template/en/default/attachment/edit.html.tmpl1
-rw-r--r--template/en/default/bug/create/create.html.tmpl1
-rw-r--r--template/en/default/bug/show-header.html.tmpl2
-rw-r--r--template/en/default/bug/summarize-time.html.tmpl1
-rw-r--r--template/en/default/global/header.html.tmpl53
-rw-r--r--template/en/default/global/value-descs.js.tmpl12
-rw-r--r--template/en/default/list/list.html.tmpl1
-rw-r--r--template/en/default/reports/report.html.tmpl1
-rw-r--r--template/en/default/search/search-advanced.html.tmpl1
-rw-r--r--template/en/default/search/search-create-series.html.tmpl1
-rw-r--r--template/en/default/search/search-instant.html.tmpl1
-rw-r--r--template/en/default/search/search-report-graph.html.tmpl1
-rw-r--r--template/en/default/search/search-report-table.html.tmpl1
52 files changed, 815 insertions, 720 deletions
diff --git a/.gitignore b/.gitignore
index 7ef5e263d..18f2d0a17 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,8 @@
/**/.htaccess
+/skins/yui.css
+/skins/yui3.css
+/js/yui.js
+/js/yui3.js
/lib/*
/local/*
/template/en/custom
diff --git a/Bugzilla/Install/Filesystem.pm b/Bugzilla/Install/Filesystem.pm
index 7cfda8304..79eeca98e 100644
--- a/Bugzilla/Install/Filesystem.pm
+++ b/Bugzilla/Install/Filesystem.pm
@@ -30,6 +30,8 @@ use File::Find;
use File::Path;
use File::Basename;
use File::Copy qw(move);
+use File::Spec;
+use Cwd ();
use File::Slurp;
use IO::File;
use POSIX ();
@@ -350,6 +352,36 @@ sub FILESYSTEM {
"$skinsdir/contrib" => DIR_WS_SERVE,
);
+ my $yui_all_css = sub {
+ return join("\n",
+ map {
+ my $css = read_file($_);
+ _css_url_fix($css, $_, "skins/yui.css.list")
+ } read_file("skins/yui.css.list", { chomp => 1 })
+ );
+ };
+
+ my $yui_all_js = sub {
+ return join("\n",
+ map { scalar read_file($_) } read_file("js/yui.js.list", { chomp => 1 })
+ );
+ };
+
+ my $yui3_all_css = sub {
+ return join("\n",
+ map {
+ my $css = read_file($_);
+ _css_url_fix($css, $_, "skins/yui3.css.list")
+ } read_file("skins/yui3.css.list", { chomp => 1 })
+ );
+ };
+
+ my $yui3_all_js = sub {
+ return join("\n",
+ map { scalar read_file($_) } read_file("js/yui3.js.list", { chomp => 1 })
+ );
+ };
+
# The name of each file, pointing at its default permissions and
# default contents.
my %create_files = (
@@ -361,6 +393,18 @@ sub FILESYSTEM {
# or something else is not running as the webserver or root.
"$datadir/mailer.testfile" => { perms => CGI_WRITE,
contents => '' },
+ "js/yui.js" => { perms => CGI_READ,
+ overwrite => 1,
+ contents => $yui_all_js },
+ "skins/yui.css" => { perms => CGI_READ,
+ overwrite => 1,
+ contents => $yui_all_css },
+ "js/yui3.js" => { perms => CGI_READ,
+ overwrite => 1,
+ contents => $yui3_all_js },
+ "skins/yui3.css" => { perms => CGI_READ,
+ overwrite => 1,
+ contents => $yui3_all_css },
);
# Because checksetup controls the creation of index.html separately
@@ -520,6 +564,31 @@ sub update_filesystem {
_remove_dynamic_assets();
}
+sub _css_url_fix {
+ my ($content, $from, $to) = @_;
+ my $from_dir = dirname(File::Spec->rel2abs($from, bz_locations()->{libpath}));
+ my $to_dir = dirname(File::Spec->rel2abs($to, bz_locations()->{libpath}));
+
+ return css_url_rewrite(
+ $content,
+ sub {
+ my ($url) = @_;
+ if ( $url =~ m{^(?:/|data:)} ) {
+ return sprintf 'url(%s)', $url;
+ }
+ else {
+ my $new_url = File::Spec->abs2rel(
+ Cwd::realpath(
+ File::Spec->rel2abs( $url, $from_dir )
+ ),
+ $to_dir
+ );
+ return sprintf "url(%s)", $new_url;
+ }
+ }
+ );
+}
+
sub _remove_empty_css_files {
my $skinsdir = bz_locations()->{'skinsdir'};
foreach my $css_file (glob("$skinsdir/custom/*.css"),
@@ -623,7 +692,13 @@ sub _create_files {
print "Creating $file...\n";
my $fh = IO::File->new( $file, O_WRONLY | O_CREAT, $info->{perms} )
or die "unable to write $file: $!";
- print $fh $info->{contents} if exists $info->{contents};
+ my $contents = $info->{contents};
+ if (defined $contents && ref($contents) eq 'CODE') {
+ print $fh $contents->();
+ }
+ elsif (defined $contents) {
+ print $fh $contents;
+ }
$fh->close;
}
}
diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm
index b08cffbde..29b1d4a13 100644
--- a/Bugzilla/Template.pm
+++ b/Bugzilla/Template.pm
@@ -383,28 +383,23 @@ sub mtime_filter {
# Set up the skin CSS cascade:
#
-# 1. standard/global.css
-# 2. YUI CSS
+# 1. YUI CSS
+# 2. standard/global.css
# 3. Standard Bugzilla stylesheet set
# 4. Third-party "skin" stylesheet set, per user prefs
# 5. Inline css passed to global/header.html.tmpl
# 6. Custom Bugzilla stylesheet set
sub css_files {
- my ($style_urls, $yui, $yui_css) = @_;
+ my ($style_urls, $no_yui) = @_;
# global.css belongs on every page
my @requested_css = ( 'skins/standard/global.css', @$style_urls );
- my @yui_required_css;
- foreach my $yui_name (@$yui) {
- next if !$yui_css->{$yui_name};
- push(@yui_required_css, "js/yui/assets/skins/sam/$yui_name.css");
- }
- unshift(@requested_css, @yui_required_css);
-
+ unshift @requested_css, "skins/yui.css" unless $no_yui;
+
my @css_sets = map { _css_link_set($_) } @requested_css;
-
+
my %by_type = (standard => [], skin => [], custom => []);
foreach my $set (@css_sets) {
foreach my $key (keys %$set) {
diff --git a/Bugzilla/Util.pm b/Bugzilla/Util.pm
index ca8187c5f..5337ce940 100644
--- a/Bugzilla/Util.pm
+++ b/Bugzilla/Util.pm
@@ -18,7 +18,7 @@ use base qw(Exporter);
css_class_quote html_light_quote
i_am_cgi i_am_webservice correct_urlbase remote_ip
validate_ip do_ssl_redirect_if_required use_attachbase
- diff_arrays on_main_db
+ diff_arrays on_main_db css_url_rewrite
trim wrap_hard wrap_comment find_wrap_point
format_time validate_date validate_time datetime_from time_ago
file_mod_time is_7bit_clean
@@ -427,6 +427,12 @@ sub diff_arrays {
return (\@removed, \@added);
}
+sub css_url_rewrite {
+ my ($content, $callback) = @_;
+ $content =~ s{(?<!=)url\((["']?)([^\)]+?)\1\)}{$callback->($2)}eig;
+ return $content;
+}
+
sub trim {
my ($str) = @_;
if ($str) {
diff --git a/extensions/BMO/template/en/default/bug/create/create-automative.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-automative.html.tmpl
index c19bed29b..413532f3f 100644
--- a/extensions/BMO/template/en/default/bug/create/create-automative.html.tmpl
+++ b/extensions/BMO/template/en/default/bug/create/create-automative.html.tmpl
@@ -87,7 +87,6 @@ function validateAndSubmit() {
javascript = inline_javascript
javascript_urls = [ 'extensions/BMO/web/js/form_validate.js',
'js/field.js', 'js/util.js' ]
- yui = [ "calendar", "selector" ]
%]
[% USE Bugzilla %]
diff --git a/extensions/BMO/template/en/default/bug/create/create-creative.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-creative.html.tmpl
index 88e744abe..8825344a3 100644
--- a/extensions/BMO/template/en/default/bug/create/create-creative.html.tmpl
+++ b/extensions/BMO/template/en/default/bug/create/create-creative.html.tmpl
@@ -115,7 +115,6 @@ function toggleTypeOther(element) {
javascript = inline_javascript
javascript_urls = [ 'extensions/BMO/web/js/form_validate.js',
'js/field.js', 'js/util.js' ]
- yui = [ "calendar" ]
%]
[% USE Bugzilla %]
diff --git a/extensions/BMO/template/en/default/bug/create/create-data-compliance.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-data-compliance.html.tmpl
index f24fd340d..bade9a588 100644
--- a/extensions/BMO/template/en/default/bug/create/create-data-compliance.html.tmpl
+++ b/extensions/BMO/template/en/default/bug/create/create-data-compliance.html.tmpl
@@ -69,7 +69,6 @@
javascript_urls = [ 'js/field.js',
'js/util.js',
'extensions/BMO/web/js/form_validate.js' ]
- yui = [ 'calendar', 'selector' ]
%]
<h2>Data Compliance Form</h2>
diff --git a/extensions/BMO/template/en/default/bug/create/create-dev-engagement-event.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-dev-engagement-event.html.tmpl
index d0d34069b..5742a17e9 100644
--- a/extensions/BMO/template/en/default/bug/create/create-dev-engagement-event.html.tmpl
+++ b/extensions/BMO/template/en/default/bug/create/create-dev-engagement-event.html.tmpl
@@ -46,7 +46,6 @@
'js/util.js',
'extensions/BMO/web/js/form_validate.js',
'extensions/BMO/web/js/dev_engagement.js' ]
- yui = [ 'calendar' ]
%]
<h2>Developer Events Request Form</h2>
diff --git a/extensions/BMO/template/en/default/bug/create/create-doc.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-doc.html.tmpl
index c7f883fb4..0ee909005 100644
--- a/extensions/BMO/template/en/default/bug/create/create-doc.html.tmpl
+++ b/extensions/BMO/template/en/default/bug/create/create-doc.html.tmpl
@@ -40,7 +40,6 @@ function validateAndSubmit() {
javascript = inline_javascript
javascript_urls = [ 'extensions/BMO/web/js/form_validate.js',
'js/field.js', 'js/util.js', 'js/bug.js' ]
- yui = [ 'datatable', 'button' ]
%]
[% USE Bugzilla %]
diff --git a/extensions/BMO/template/en/default/bug/create/create-fsa-budget.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-fsa-budget.html.tmpl
index c35d66942..502f92c32 100644
--- a/extensions/BMO/template/en/default/bug/create/create-fsa-budget.html.tmpl
+++ b/extensions/BMO/template/en/default/bug/create/create-fsa-budget.html.tmpl
@@ -75,7 +75,6 @@ function validateAndSubmit() {
javascript_urls = [ 'extensions/BMO/web/js/form_validate.js',
'js/util.js',
'js/field.js' ]
- yui = [ 'calendar' ]
%]
<h1>FSA Budget Request Form</h1>
diff --git a/extensions/BMO/template/en/default/bug/create/create-mdn.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-mdn.html.tmpl
index 89c28f114..b17736ce6 100644
--- a/extensions/BMO/template/en/default/bug/create/create-mdn.html.tmpl
+++ b/extensions/BMO/template/en/default/bug/create/create-mdn.html.tmpl
@@ -170,7 +170,6 @@ strong.required:before {
title = "Mozilla Developer Network Feedback"
style = inline_style
javascript = inline_javascript
- yui = [ 'history' ]
javascript_urls = [ 'extensions/BMO/web/js/form_validate.js' ]
%]
diff --git a/extensions/BMO/template/en/default/bug/create/create-mozpr.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-mozpr.html.tmpl
index c62d8b99f..975006232 100644
--- a/extensions/BMO/template/en/default/bug/create/create-mozpr.html.tmpl
+++ b/extensions/BMO/template/en/default/bug/create/create-mozpr.html.tmpl
@@ -274,7 +274,6 @@ function validate_form() {
javascript = inline_javascript
javascript_urls = [ 'extensions/BMO/web/js/form_validate.js',
'js/field.js', 'js/util.js' ]
- yui = [ "calendar" ]
%]
[% UNLESS user.in_group('pr-private') %]
diff --git a/extensions/BMO/template/en/default/bug/create/create-swag.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-swag.html.tmpl
index 6742c42db..859d77194 100644
--- a/extensions/BMO/template/en/default/bug/create/create-swag.html.tmpl
+++ b/extensions/BMO/template/en/default/bug/create/create-swag.html.tmpl
@@ -508,7 +508,6 @@ function showGear() {
javascript = inline_javascript
javascript_urls = [ 'extensions/BMO/web/js/form_validate.js',
'js/field.js', 'js/util.js' ]
- yui = [ 'calendar' ]
%]
<h1>Mozilla Gear</h1>
diff --git a/extensions/BMO/template/en/default/bug/create/create-user-engagement.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-user-engagement.html.tmpl
index 23ea0bb86..f15e4f47d 100644
--- a/extensions/BMO/template/en/default/bug/create/create-user-engagement.html.tmpl
+++ b/extensions/BMO/template/en/default/bug/create/create-user-engagement.html.tmpl
@@ -81,7 +81,6 @@ function toggleGoalOther() {
javascript = inline_javascript
javascript_urls = [ 'extensions/BMO/web/js/form_validate.js',
'js/field.js', 'js/util.js' ]
- yui = [ "calendar" ]
%]
[% USE Bugzilla %]
diff --git a/extensions/BMO/template/en/default/pages/attachment_bounty_form.html.tmpl b/extensions/BMO/template/en/default/pages/attachment_bounty_form.html.tmpl
index 9b6901330..ffbb1acbc 100644
--- a/extensions/BMO/template/en/default/pages/attachment_bounty_form.html.tmpl
+++ b/extensions/BMO/template/en/default/pages/attachment_bounty_form.html.tmpl
@@ -124,7 +124,6 @@ function validateAndSubmit() {
javascript = inline_javascript
javascript_urls = [ 'extensions/BMO/web/js/form_validate.js',
'js/field.js', 'js/util.js' ]
- yui = [ "calendar", "selector" ]
%]
[% USE Bugzilla %]
diff --git a/extensions/BMO/template/en/default/pages/group_admins.html.tmpl b/extensions/BMO/template/en/default/pages/group_admins.html.tmpl
index c81c95748..cfa3bd3ea 100644
--- a/extensions/BMO/template/en/default/pages/group_admins.html.tmpl
+++ b/extensions/BMO/template/en/default/pages/group_admins.html.tmpl
@@ -21,7 +21,6 @@
[% INCLUDE global/header.html.tmpl
title = "Group Admins Report"
style_urls = [ "extensions/BMO/web/styles/reports.css" ]
- yui = [ "datasource" ]
%]
[% IF groups.size > 0 %]
diff --git a/extensions/BMO/template/en/default/pages/triage_reports.html.tmpl b/extensions/BMO/template/en/default/pages/triage_reports.html.tmpl
index 7958f27d2..05efefca5 100644
--- a/extensions/BMO/template/en/default/pages/triage_reports.html.tmpl
+++ b/extensions/BMO/template/en/default/pages/triage_reports.html.tmpl
@@ -41,7 +41,6 @@ var selected_components = [
[% INCLUDE global/header.html.tmpl
title = "Unconfirmed Reports"
generate_api_token = 1
- yui = [ 'calendar' ]
javascript = js_data
javascript_urls = [ "js/util.js", "js/field.js", "js/productform.js",
"extensions/BMO/web/js/triage_reports.js" ]
diff --git a/extensions/BMO/template/en/default/pages/user_activity.html.tmpl b/extensions/BMO/template/en/default/pages/user_activity.html.tmpl
index ad79b3c4d..d850c91b2 100644
--- a/extensions/BMO/template/en/default/pages/user_activity.html.tmpl
+++ b/extensions/BMO/template/en/default/pages/user_activity.html.tmpl
@@ -15,7 +15,6 @@
[% INCLUDE global/header.html.tmpl
title = "User Activity Report" _ who_title
generate_api_token = 1
- yui = [ 'calendar' ]
javascript_urls = [ "js/util.js", "js/field.js" ]
style_urls = [ "extensions/BMO/web/styles/reports.css" ]
diff --git a/extensions/GuidedBugEntry/template/en/default/guided/guided.html.tmpl b/extensions/GuidedBugEntry/template/en/default/guided/guided.html.tmpl
index ee1ba2931..e4b0b44a8 100644
--- a/extensions/GuidedBugEntry/template/en/default/guided/guided.html.tmpl
+++ b/extensions/GuidedBugEntry/template/en/default/guided/guided.html.tmpl
@@ -18,9 +18,7 @@
title = "Enter A Bug"
generate_api_token = 1
javascript_urls = js_urls
- style_urls = [ 'extensions/GuidedBugEntry/web/style/guided.css',
- 'js/yui/assets/skins/sam/container.css' ]
- yui = [ 'history', 'datatable', 'container' ]
+ style_urls = [ 'extensions/GuidedBugEntry/web/style/guided.css' ]
%]
<iframe id="yui-history-iframe" src="extensions/GuidedBugEntry/web/yui-history-iframe.txt"></iframe>
diff --git a/extensions/MyDashboard/template/en/default/pages/mydashboard.html.tmpl b/extensions/MyDashboard/template/en/default/pages/mydashboard.html.tmpl
index eda53ebe4..028d1b9b0 100644
--- a/extensions/MyDashboard/template/en/default/pages/mydashboard.html.tmpl
+++ b/extensions/MyDashboard/template/en/default/pages/mydashboard.html.tmpl
@@ -11,10 +11,10 @@
[% PROCESS global/header.html.tmpl
title = "My Dashboard"
generate_api_token = 1
- style_urls = [ "extensions/MyDashboard/web/styles/mydashboard.css",
+ style_urls = [ "skins/yui3.css",
+ "extensions/MyDashboard/web/styles/mydashboard.css",
"extensions/ProdCompSearch/web/styles/prod_comp_search.css" ]
- yui = ["json", "connection"],
- javascript_urls = [ "js/yui3/yui/yui-min.js",
+ javascript_urls = [ "js/yui3.js",
"extensions/MyDashboard/web/js/query.js",
"extensions/MyDashboard/web/js/flags.js",
"extensions/ProdCompSearch/web/js/prod_comp_search.js",
diff --git a/extensions/MyDashboard/web/js/flags.js b/extensions/MyDashboard/web/js/flags.js
index e8c175155..95b256708 100644
--- a/extensions/MyDashboard/web/js/flags.js
+++ b/extensions/MyDashboard/web/js/flags.js
@@ -7,224 +7,226 @@
*/
// Flag tables
-YUI({
- base: 'js/yui3/',
- combine: false
-}).use("node", "datatable", "datatable-sort", "json-stringify", "escape",
- "datatable-datasource", "datasource-io", "datasource-jsonschema", function(Y) {
- // Common
- var counter = 0;
- var dataSource = {
- requestee: null,
- requester: null
- };
- var dataTable = {
- requestee: null,
- requester: null
- };
-
- var updateFlagTable = function(type) {
- if (!type) return;
-
- counter = counter + 1;
-
- var callback = {
- success: function(e) {
- if (e.response) {
- Y.one('#' + type + '_count_refresh').removeClass('bz_default_hidden');
- Y.one("#" + type + "_flags_found").setHTML(
- e.response.results.length + ' flags found');
- dataTable[type].set('data', e.response.results);
+$(function () {
+ YUI({
+ base: 'js/yui3/',
+ combine: false
+ }).use("node", "datatable", "datatable-sort", "json-stringify", "escape",
+ "datatable-datasource", "datasource-io", "datasource-jsonschema", function(Y) {
+ // Common
+ var counter = 0;
+ var dataSource = {
+ requestee: null,
+ requester: null
+ };
+ var dataTable = {
+ requestee: null,
+ requester: null
+ };
+
+ var updateFlagTable = function(type) {
+ if (!type) return;
+
+ counter = counter + 1;
+
+ var callback = {
+ success: function(e) {
+ if (e.response) {
+ Y.one('#' + type + '_count_refresh').removeClass('bz_default_hidden');
+ Y.one("#" + type + "_flags_found").setHTML(
+ e.response.results.length + ' flags found');
+ dataTable[type].set('data', e.response.results);
+ }
+ },
+ failure: function(o) {
+ if (o.error) {
+ alert("Failed to load flag list from Bugzilla:\n\n" + o.error.message);
+ } else {
+ alert("Failed to load flag list from Bugzilla.");
+ }
}
- },
- failure: function(o) {
- if (o.error) {
- alert("Failed to load flag list from Bugzilla:\n\n" + o.error.message);
- } else {
- alert("Failed to load flag list from Bugzilla.");
+ };
+
+ var json_object = {
+ version: "1.1",
+ method: "MyDashboard.run_flag_query",
+ id: counter,
+ params: { type : type,
+ Bugzilla_api_token : (BUGZILLA.api_token ? BUGZILLA.api_token : '')
}
+ };
+
+ var stringified = Y.JSON.stringify(json_object);
+
+ Y.one('#' + type + '_count_refresh').addClass('bz_default_hidden');
+
+ dataTable[type].set('data', []);
+ dataTable[type].render("#" + type + "_table");
+ dataTable[type].showMessage('loadingMessage');
+
+ dataSource[type].sendRequest({
+ request: stringified,
+ cfg: {
+ method: "POST",
+ headers: { 'Content-Type': 'application/json' }
+ },
+ callback: callback
+ });
+ };
+
+ var loadBugList = function(type) {
+ if (!type) return;
+ var data = dataTable[type].data;
+ var ids = [];
+ for (var i = 0, l = data.size(); i < l; i++) {
+ ids.push(data.item(i).get('bug_id'));
}
+ var url = 'buglist.cgi?bug_id=' + ids.join('%2C');
+ window.open(url, '_blank');
};
- var json_object = {
- version: "1.1",
- method: "MyDashboard.run_flag_query",
- id: counter,
- params: { type : type,
- Bugzilla_api_token : (BUGZILLA.api_token ? BUGZILLA.api_token : '')
+ var bugLinkFormatter = function(o) {
+ var bug_closed = "";
+ if (o.data.bug_status == 'RESOLVED' || o.data.bug_status == 'VERIFIED') {
+ bug_closed = "bz_closed";
}
+ return '<a href="show_bug.cgi?id=' + encodeURIComponent(o.value) +
+ '" target="_blank" ' + 'title="' + Y.Escape.html(o.data.bug_status) + ' - ' +
+ Y.Escape.html(o.data.bug_summary) + '" class="' + Y.Escape.html(bug_closed) +
+ '">' + o.value + '</a>';
};
- var stringified = Y.JSON.stringify(json_object);
+ var updatedFormatter = function(o) {
+ return '<span title="' + Y.Escape.html(o.value) + '">' +
+ Y.Escape.html(o.data.updated_fancy) + '</span>';
+ };
- Y.one('#' + type + '_count_refresh').addClass('bz_default_hidden');
+ var requesteeFormatter = function(o) {
+ return o.value
+ ? Y.Escape.html(o.value)
+ : '<i>anyone</i>';
+ };
- dataTable[type].set('data', []);
- dataTable[type].render("#" + type + "_table");
- dataTable[type].showMessage('loadingMessage');
+ var flagNameFormatter = function(o) {
+ if (parseInt(o.data.attach_id)
+ && parseInt(o.data.is_patch)
+ && MyDashboard.splinter_base)
+ {
+ return '<a href="' + MyDashboard.splinter_base +
+ (MyDashboard.splinter_base.indexOf('?') == -1 ? '?' : '&') +
+ 'bug=' + encodeURIComponent(o.data.bug_id) +
+ '&attachment=' + encodeURIComponent(o.data.attach_id) +
+ '" target="_blank" title="Review this patch">' +
+ Y.Escape.html(o.value) + '</a>';
+ }
+ else {
+ return Y.Escape.html(o.value);
+ }
+ };
- dataSource[type].sendRequest({
- request: stringified,
- cfg: {
- method: "POST",
- headers: { 'Content-Type': 'application/json' }
- },
- callback: callback
+ // Requestee
+ dataSource.requestee = new Y.DataSource.IO({ source: 'jsonrpc.cgi' });
+ dataSource.requestee.on('error', function(e) {
+ try {
+ var response = Y.JSON.parse(e.data.responseText);
+ if (response.error)
+ e.error.message = response.error.message;
+ } catch(ex) {
+ // ignore
+ }
+ });
+ dataTable.requestee = new Y.DataTable({
+ columns: [
+ { key: "requester", label: "Requester", sortable: true },
+ { key: "type", label: "Flag", sortable: true,
+ formatter: flagNameFormatter, allowHTML: true },
+ { key: "bug_id", label: "Bug", sortable: true,
+ formatter: bugLinkFormatter, allowHTML: true },
+ { key: "updated", label: "Updated", sortable: true,
+ formatter: updatedFormatter, allowHTML: true }
+ ],
+ strings: {
+ emptyMessage: 'No flag data found.',
+ }
});
- };
-
- var loadBugList = function(type) {
- if (!type) return;
- var data = dataTable[type].data;
- var ids = [];
- for (var i = 0, l = data.size(); i < l; i++) {
- ids.push(data.item(i).get('bug_id'));
- }
- var url = 'buglist.cgi?bug_id=' + ids.join('%2C');
- window.open(url, '_blank');
- };
-
- var bugLinkFormatter = function(o) {
- var bug_closed = "";
- if (o.data.bug_status == 'RESOLVED' || o.data.bug_status == 'VERIFIED') {
- bug_closed = "bz_closed";
- }
- return '<a href="show_bug.cgi?id=' + encodeURIComponent(o.value) +
- '" target="_blank" ' + 'title="' + Y.Escape.html(o.data.bug_status) + ' - ' +
- Y.Escape.html(o.data.bug_summary) + '" class="' + Y.Escape.html(bug_closed) +
- '">' + o.value + '</a>';
- };
-
- var updatedFormatter = function(o) {
- return '<span title="' + Y.Escape.html(o.value) + '">' +
- Y.Escape.html(o.data.updated_fancy) + '</span>';
- };
-
- var requesteeFormatter = function(o) {
- return o.value
- ? Y.Escape.html(o.value)
- : '<i>anyone</i>';
- };
-
- var flagNameFormatter = function(o) {
- if (parseInt(o.data.attach_id)
- && parseInt(o.data.is_patch)
- && MyDashboard.splinter_base)
- {
- return '<a href="' + MyDashboard.splinter_base +
- (MyDashboard.splinter_base.indexOf('?') == -1 ? '?' : '&') +
- 'bug=' + encodeURIComponent(o.data.bug_id) +
- '&attachment=' + encodeURIComponent(o.data.attach_id) +
- '" target="_blank" title="Review this patch">' +
- Y.Escape.html(o.value) + '</a>';
- }
- else {
- return Y.Escape.html(o.value);
- }
- };
-
- // Requestee
- dataSource.requestee = new Y.DataSource.IO({ source: 'jsonrpc.cgi' });
- dataSource.requestee.on('error', function(e) {
- try {
- var response = Y.JSON.parse(e.data.responseText);
- if (response.error)
- e.error.message = response.error.message;
- } catch(ex) {
- // ignore
- }
- });
- dataTable.requestee = new Y.DataTable({
- columns: [
- { key: "requester", label: "Requester", sortable: true },
- { key: "type", label: "Flag", sortable: true,
- formatter: flagNameFormatter, allowHTML: true },
- { key: "bug_id", label: "Bug", sortable: true,
- formatter: bugLinkFormatter, allowHTML: true },
- { key: "updated", label: "Updated", sortable: true,
- formatter: updatedFormatter, allowHTML: true }
- ],
- strings: {
- emptyMessage: 'No flag data found.',
- }
- });
- dataTable.requestee.plug(Y.Plugin.DataTableSort);
+ dataTable.requestee.plug(Y.Plugin.DataTableSort);
- dataTable.requestee.plug(Y.Plugin.DataTableDataSource, {
- datasource: dataSource.requestee
- });
+ dataTable.requestee.plug(Y.Plugin.DataTableDataSource, {
+ datasource: dataSource.requestee
+ });
- dataSource.requestee.plug(Y.Plugin.DataSourceJSONSchema, {
- schema: {
- resultListLocator: "result.result.requestee",
- resultFields: ["requester", "type", "attach_id", "is_patch", "bug_id",
- "bug_status", "bug_summary", "updated", "updated_fancy"]
- }
- });
+ dataSource.requestee.plug(Y.Plugin.DataSourceJSONSchema, {
+ schema: {
+ resultListLocator: "result.result.requestee",
+ resultFields: ["requester", "type", "attach_id", "is_patch", "bug_id",
+ "bug_status", "bug_summary", "updated", "updated_fancy"]
+ }
+ });
- dataTable.requestee.render("#requestee_table");
+ dataTable.requestee.render("#requestee_table");
- Y.one('#requestee_refresh').on('click', function(e) {
- updateFlagTable('requestee');
- });
- Y.one('#requestee_buglist').on('click', function(e) {
- loadBugList('requestee');
- });
+ Y.one('#requestee_refresh').on('click', function(e) {
+ updateFlagTable('requestee');
+ });
+ Y.one('#requestee_buglist').on('click', function(e) {
+ loadBugList('requestee');
+ });
- // Requester
- dataSource.requester = new Y.DataSource.IO({ source: 'jsonrpc.cgi' });
- dataSource.requester.on('error', function(e) {
- try {
- var response = Y.JSON.parse(e.data.responseText);
- if (response.error)
- e.error.message = response.error.message;
- } catch(ex) {
- // ignore
- }
- });
- dataTable.requester = new Y.DataTable({
- columns: [
- { key:"requestee", label:"Requestee", sortable:true,
- formatter: requesteeFormatter, allowHTML: true },
- { key:"type", label:"Flag", sortable:true,
- formatter: flagNameFormatter, allowHTML: true },
- { key:"bug_id", label:"Bug", sortable:true,
- formatter: bugLinkFormatter, allowHTML: true },
- { key: "updated", label: "Updated", sortable: true,
- formatter: updatedFormatter, allowHTML: true }
- ],
- strings: {
- emptyMessage: 'No flag data found.',
- }
- });
+ // Requester
+ dataSource.requester = new Y.DataSource.IO({ source: 'jsonrpc.cgi' });
+ dataSource.requester.on('error', function(e) {
+ try {
+ var response = Y.JSON.parse(e.data.responseText);
+ if (response.error)
+ e.error.message = response.error.message;
+ } catch(ex) {
+ // ignore
+ }
+ });
+ dataTable.requester = new Y.DataTable({
+ columns: [
+ { key:"requestee", label:"Requestee", sortable:true,
+ formatter: requesteeFormatter, allowHTML: true },
+ { key:"type", label:"Flag", sortable:true,
+ formatter: flagNameFormatter, allowHTML: true },
+ { key:"bug_id", label:"Bug", sortable:true,
+ formatter: bugLinkFormatter, allowHTML: true },
+ { key: "updated", label: "Updated", sortable: true,
+ formatter: updatedFormatter, allowHTML: true }
+ ],
+ strings: {
+ emptyMessage: 'No flag data found.',
+ }
+ });
- dataTable.requester.plug(Y.Plugin.DataTableSort);
+ dataTable.requester.plug(Y.Plugin.DataTableSort);
- dataTable.requester.plug(Y.Plugin.DataTableDataSource, {
- datasource: dataSource.requester
- });
+ dataTable.requester.plug(Y.Plugin.DataTableDataSource, {
+ datasource: dataSource.requester
+ });
- dataSource.requester.plug(Y.Plugin.DataSourceJSONSchema, {
- schema: {
- resultListLocator: "result.result.requester",
- resultFields: ["requestee", "type", "attach_id", "is_patch", "bug_id",
- "bug_status", "bug_summary", "updated", "updated_fancy"]
- }
- });
+ dataSource.requester.plug(Y.Plugin.DataSourceJSONSchema, {
+ schema: {
+ resultListLocator: "result.result.requester",
+ resultFields: ["requestee", "type", "attach_id", "is_patch", "bug_id",
+ "bug_status", "bug_summary", "updated", "updated_fancy"]
+ }
+ });
- // Initial load
- Y.on("contentready", function (e) {
- updateFlagTable("requestee");
- }, "#requestee_table");
- Y.on("contentready", function (e) {
- updateFlagTable("requester");
- }, "#requester_table");
+ // Initial load
+ Y.on("contentready", function (e) {
+ updateFlagTable("requestee");
+ }, "#requestee_table");
+ Y.on("contentready", function (e) {
+ updateFlagTable("requester");
+ }, "#requester_table");
- Y.one('#requester_refresh').on('click', function(e) {
- updateFlagTable('requester');
- });
- Y.one('#requester_buglist').on('click', function(e) {
- loadBugList('requester');
+ Y.one('#requester_refresh').on('click', function(e) {
+ updateFlagTable('requester');
+ });
+ Y.one('#requester_buglist').on('click', function(e) {
+ loadBugList('requester');
+ });
});
});
diff --git a/extensions/MyDashboard/web/js/query.js b/extensions/MyDashboard/web/js/query.js
index 9cea27f87..a95c0be61 100644
--- a/extensions/MyDashboard/web/js/query.js
+++ b/extensions/MyDashboard/web/js/query.js
@@ -11,274 +11,276 @@ if (typeof(MyDashboard) == 'undefined') {
}
// Main query code
-YUI({
- base: 'js/yui3/',
- combine: false,
- groups: {
- gallery: {
- combine: false,
- base: 'js/yui3/',
- patterns: { 'gallery-': {} }
- }
- }
-}).use("node", "datatable", "datatable-sort", "datatable-message", "json-stringify",
- "datatable-datasource", "datasource-io", "datasource-jsonschema", "cookie",
- "gallery-datatable-row-expansion-bmo", "handlebars", "escape", function(Y) {
- var counter = 0,
- bugQueryTable = null,
- bugQuery = null,
- lastChangesQuery = null,
- lastChangesCache = {},
- default_query = "assignedbugs";
-
- // Grab last used query name from cookie or use default
- var query_cookie = Y.Cookie.get("my_dashboard_query");
- if (query_cookie) {
- var cookie_value_found = 0;
- Y.one("#query").get("options").each( function() {
- if (this.get("value") == query_cookie) {
- this.set('selected', true);
- default_query = query_cookie;
- cookie_value_found = 1;
+$(function() {
+ YUI({
+ base: 'js/yui3/',
+ combine: false,
+ groups: {
+ gallery: {
+ combine: false,
+ base: 'js/yui3/',
+ patterns: { 'gallery-': {} }
}
- });
- if (!cookie_value_found) {
- Y.Cookie.set("my_dashboard_query", "");
}
- }
-
- var bugQuery = new Y.DataSource.IO({ source: 'jsonrpc.cgi' });
-
- bugQuery.plug(Y.Plugin.DataSourceJSONSchema, {
- schema: {
- resultListLocator: "result.result.bugs",
- resultFields: ["bug_id", "changeddate", "changeddate_fancy",
- "bug_status", "short_desc", "changeddate_api" ],
- metaFields: {
- description: "result.result.description",
- heading: "result.result.heading",
- buffer: "result.result.buffer",
- mark_read: "result.result.mark_read"
+ }).use("node", "datatable", "datatable-sort", "datatable-message", "json-stringify",
+ "datatable-datasource", "datasource-io", "datasource-jsonschema", "cookie",
+ "gallery-datatable-row-expansion-bmo", "handlebars", "escape", function(Y) {
+ var counter = 0,
+ bugQueryTable = null,
+ bugQuery = null,
+ lastChangesQuery = null,
+ lastChangesCache = {},
+ default_query = "assignedbugs";
+
+ // Grab last used query name from cookie or use default
+ var query_cookie = Y.Cookie.get("my_dashboard_query");
+ if (query_cookie) {
+ var cookie_value_found = 0;
+ Y.one("#query").get("options").each( function() {
+ if (this.get("value") == query_cookie) {
+ this.set('selected', true);
+ default_query = query_cookie;
+ cookie_value_found = 1;
+ }
+ });
+ if (!cookie_value_found) {
+ Y.Cookie.set("my_dashboard_query", "");
}
}
- });
- bugQuery.on('error', function(e) {
- try {
- var response = Y.JSON.parse(e.data.responseText);
- if (response.error)
- e.error.message = response.error.message;
- } catch(ex) {
- // ignore
- }
- });
-
- var bugQueryCallback = {
- success: function(e) {
- if (e.response) {
- Y.one('#query_count_refresh').removeClass('bz_default_hidden');
- Y.one("#query_container .query_description").setHTML(e.response.meta.description);
- Y.one("#query_container .query_heading").setHTML(e.response.meta.heading);
- Y.one("#query_bugs_found").setHTML(
- '<a href="buglist.cgi?' + e.response.meta.buffer +
- '" target="_blank">' + e.response.results.length + ' bugs found</a>');
- bugQueryTable.set('data', e.response.results);
-
- var mark_read = e.response.meta.mark_read;
- if (mark_read) {
- Y.one('#query_markread').setHTML( mark_read );
- Y.one('#bar_markread').removeClass('bz_default_hidden');
- Y.one('#query_markread_text').setHTML( mark_read );
- Y.one('#query_markread').removeClass('bz_default_hidden');
- }
- else {
- Y.one('#bar_markread').addClass('bz_default_hidden');
- Y.one('#query_markread').addClass('bz_default_hidden');
+ var bugQuery = new Y.DataSource.IO({ source: 'jsonrpc.cgi' });
+
+ bugQuery.plug(Y.Plugin.DataSourceJSONSchema, {
+ schema: {
+ resultListLocator: "result.result.bugs",
+ resultFields: ["bug_id", "changeddate", "changeddate_fancy",
+ "bug_status", "short_desc", "changeddate_api" ],
+ metaFields: {
+ description: "result.result.description",
+ heading: "result.result.heading",
+ buffer: "result.result.buffer",
+ mark_read: "result.result.mark_read"
}
- Y.one('#query_markread_text').addClass('bz_default_hidden');
}
- },
- failure: function(o) {
- if (o.error) {
- alert("Failed to load bug list from Bugzilla:\n\n" + o.error.message);
- } else {
- alert("Failed to load bug list from Bugzilla.");
+ });
+
+ bugQuery.on('error', function(e) {
+ try {
+ var response = Y.JSON.parse(e.data.responseText);
+ if (response.error)
+ e.error.message = response.error.message;
+ } catch(ex) {
+ // ignore
}
- }
- };
+ });
- var updateQueryTable = function(query_name) {
- if (!query_name) return;
+ var bugQueryCallback = {
+ success: function(e) {
+ if (e.response) {
+ Y.one('#query_count_refresh').removeClass('bz_default_hidden');
+ Y.one("#query_container .query_description").setHTML(e.response.meta.description);
+ Y.one("#query_container .query_heading").setHTML(e.response.meta.heading);
+ Y.one("#query_bugs_found").setHTML(
+ '<a href="buglist.cgi?' + e.response.meta.buffer +
+ '" target="_blank">' + e.response.results.length + ' bugs found</a>');
+ bugQueryTable.set('data', e.response.results);
+
+ var mark_read = e.response.meta.mark_read;
+ if (mark_read) {
+ Y.one('#query_markread').setHTML( mark_read );
+ Y.one('#bar_markread').removeClass('bz_default_hidden');
+ Y.one('#query_markread_text').setHTML( mark_read );
+ Y.one('#query_markread').removeClass('bz_default_hidden');
+ }
+ else {
+ Y.one('#bar_markread').addClass('bz_default_hidden');
+ Y.one('#query_markread').addClass('bz_default_hidden');
+ }
+ Y.one('#query_markread_text').addClass('bz_default_hidden');
+ }
+ },
+ failure: function(o) {
+ if (o.error) {
+ alert("Failed to load bug list from Bugzilla:\n\n" + o.error.message);
+ } else {
+ alert("Failed to load bug list from Bugzilla.");
+ }
+ }
+ };
- counter = counter + 1;
- lastChangesCache = {};
+ var updateQueryTable = function(query_name) {
+ if (!query_name) return;
- Y.one('#query_count_refresh').addClass('bz_default_hidden');
- bugQueryTable.set('data', []);
- bugQueryTable.render("#query_table");
- bugQueryTable.showMessage('loadingMessage');
+ counter = counter + 1;
+ lastChangesCache = {};
- var bugQueryParams = {
- version: "1.1",
- method: "MyDashboard.run_bug_query",
- id: counter,
- params: { query : query_name,
- Bugzilla_api_token : (BUGZILLA.api_token ? BUGZILLA.api_token : '')
- }
- };
+ Y.one('#query_count_refresh').addClass('bz_default_hidden');
+ bugQueryTable.set('data', []);
+ bugQueryTable.render("#query_table");
+ bugQueryTable.showMessage('loadingMessage');
- bugQuery.sendRequest({
- request: Y.JSON.stringify(bugQueryParams),
- cfg: {
- method: "POST",
- headers: { 'Content-Type': 'application/json' }
- },
- callback: bugQueryCallback
- });
- };
+ var bugQueryParams = {
+ version: "1.1",
+ method: "MyDashboard.run_bug_query",
+ id: counter,
+ params: { query : query_name,
+ Bugzilla_api_token : (BUGZILLA.api_token ? BUGZILLA.api_token : '')
+ }
+ };
- var updatedFormatter = function(o) {
- return '<span title="' + Y.Escape.html(o.value) + '">' +
- Y.Escape.html(o.data.changeddate_fancy) + '</span>';
- };
+ bugQuery.sendRequest({
+ request: Y.JSON.stringify(bugQueryParams),
+ cfg: {
+ method: "POST",
+ headers: { 'Content-Type': 'application/json' }
+ },
+ callback: bugQueryCallback
+ });
+ };
+ var updatedFormatter = function(o) {
+ return '<span title="' + Y.Escape.html(o.value) + '">' +
+ Y.Escape.html(o.data.changeddate_fancy) + '</span>';
+ };
- lastChangesQuery = new Y.DataSource.IO({ source: 'jsonrpc.cgi' });
- lastChangesQuery.plug(Y.Plugin.DataSourceJSONSchema, {
- schema: {
- resultListLocator: "result.results",
- resultFields: ["last_changes"],
- }
- });
+ lastChangesQuery = new Y.DataSource.IO({ source: 'jsonrpc.cgi' });
- lastChangesQuery.on('error', function(e) {
- try {
- var response = Y.JSON.parse(e.data.responseText);
- if (response.error)
- e.error.message = response.error.message;
- } catch(ex) {
- // ignore
- }
- });
+ lastChangesQuery.plug(Y.Plugin.DataSourceJSONSchema, {
+ schema: {
+ resultListLocator: "result.results",
+ resultFields: ["last_changes"],
+ }
+ });
- bugQueryTable = new Y.DataTable({
- columns: [
- { key: Y.Plugin.DataTableRowExpansion.column_key, label: ' ', sortable: false },
- { key: "bug_id", label: "Bug", allowHTML: true, sortable: true,
- formatter: '<a href="show_bug.cgi?id={value}" target="_blank">{value}</a>' },
- { key: "changeddate", label: "Updated", formatter: updatedFormatter,
- allowHTML: true, sortable: true },
- { key: "bug_status", label: "Status", sortable: true },
- { key: "short_desc", label: "Summary", sortable: true },
- ],
- });
+ lastChangesQuery.on('error', function(e) {
+ try {
+ var response = Y.JSON.parse(e.data.responseText);
+ if (response.error)
+ e.error.message = response.error.message;
+ } catch(ex) {
+ // ignore
+ }
+ });
- var last_changes_source = Y.one('#last-changes-template').getHTML(),
- last_changes_template = Y.Handlebars.compile(last_changes_source);
+ bugQueryTable = new Y.DataTable({
+ columns: [
+ { key: Y.Plugin.DataTableRowExpansion.column_key, label: ' ', sortable: false },
+ { key: "bug_id", label: "Bug", allowHTML: true, sortable: true,
+ formatter: '<a href="show_bug.cgi?id={value}" target="_blank">{value}</a>' },
+ { key: "changeddate", label: "Updated", formatter: updatedFormatter,
+ allowHTML: true, sortable: true },
+ { key: "bug_status", label: "Status", sortable: true },
+ { key: "short_desc", label: "Summary", sortable: true },
+ ],
+ });
- var stub_source = Y.one('#last-changes-stub').getHTML(),
- stub_template = Y.Handlebars.compile(stub_source);
+ var last_changes_source = Y.one('#last-changes-template').getHTML(),
+ last_changes_template = Y.Handlebars.compile(last_changes_source);
+ var stub_source = Y.one('#last-changes-stub').getHTML(),
+ stub_template = Y.Handlebars.compile(stub_source);
- bugQueryTable.plug(Y.Plugin.DataTableRowExpansion, {
- uniqueIdKey: 'bug_id',
- template: function(data) {
- var bug_id = data.bug_id;
- var lastChangesCallback = {
- success: function(e) {
- if (e.response) {
- var last_changes = e.response.results[0].last_changes;
- last_changes['bug_id'] = bug_id;
- lastChangesCache[bug_id] = last_changes;
- Y.one('#last_changes_stub_' + bug_id).setHTML(last_changes_template(last_changes));
- }
- },
- failure: function(o) {
- if (o.error) {
- alert("Failed to load last changes from Bugzilla:\n\n" + o.error.message);
- } else {
- alert("Failed to load last changes from Bugzilla.");
- }
- }
- };
+ bugQueryTable.plug(Y.Plugin.DataTableRowExpansion, {
+ uniqueIdKey: 'bug_id',
+ template: function(data) {
+ var bug_id = data.bug_id;
- if (!lastChangesCache[bug_id]) {
- var lastChangesParams = {
- version: "1.1",
- method: "MyDashboard.run_last_changes",
- params: {
- bug_id: data.bug_id,
- changeddate_api: data.changeddate_api,
- Bugzilla_api_token : (BUGZILLA.api_token ? BUGZILLA.api_token : '')
+ var lastChangesCallback = {
+ success: function(e) {
+ if (e.response) {
+ var last_changes = e.response.results[0].last_changes;
+ last_changes['bug_id'] = bug_id;
+ lastChangesCache[bug_id] = last_changes;
+ Y.one('#last_changes_stub_' + bug_id).setHTML(last_changes_template(last_changes));
+ }
+ },
+ failure: function(o) {
+ if (o.error) {
+ alert("Failed to load last changes from Bugzilla:\n\n" + o.error.message);
+ } else {
+ alert("Failed to load last changes from Bugzilla.");
+ }
}
};
- lastChangesQuery.sendRequest({
- request: Y.JSON.stringify(lastChangesParams),
- cfg: {
- method: "POST",
- headers: { 'Content-Type': 'application/json' }
- },
- callback: lastChangesCallback
- });
+ if (!lastChangesCache[bug_id]) {
+ var lastChangesParams = {
+ version: "1.1",
+ method: "MyDashboard.run_last_changes",
+ params: {
+ bug_id: data.bug_id,
+ changeddate_api: data.changeddate_api,
+ Bugzilla_api_token : (BUGZILLA.api_token ? BUGZILLA.api_token : '')
+ }
+ };
+
+ lastChangesQuery.sendRequest({
+ request: Y.JSON.stringify(lastChangesParams),
+ cfg: {
+ method: "POST",
+ headers: { 'Content-Type': 'application/json' }
+ },
+ callback: lastChangesCallback
+ });
+
+ return stub_template({bug_id: bug_id});
+ }
+ else {
+ return last_changes_template(lastChangesCache[bug_id]);
+ }
- return stub_template({bug_id: bug_id});
- }
- else {
- return last_changes_template(lastChangesCache[bug_id]);
}
+ });
- }
- });
-
- bugQueryTable.plug(Y.Plugin.DataTableSort);
+ bugQueryTable.plug(Y.Plugin.DataTableSort);
- bugQueryTable.plug(Y.Plugin.DataTableDataSource, {
- datasource: bugQuery
- });
+ bugQueryTable.plug(Y.Plugin.DataTableDataSource, {
+ datasource: bugQuery
+ });
- // Initial load
- Y.on("contentready", function (e) {
- updateQueryTable(default_query);
- }, "#query_table");
+ // Initial load
+ Y.on("contentready", function (e) {
+ updateQueryTable(default_query);
+ }, "#query_table");
- Y.one('#query').on('change', function(e) {
- var index = e.target.get('selectedIndex');
- var selected_value = e.target.get("options").item(index).getAttribute('value');
- updateQueryTable(selected_value);
- Y.Cookie.set("my_dashboard_query", selected_value, { expires: new Date("January 12, 2025") });
- });
+ Y.one('#query').on('change', function(e) {
+ var index = e.target.get('selectedIndex');
+ var selected_value = e.target.get("options").item(index).getAttribute('value');
+ updateQueryTable(selected_value);
+ Y.Cookie.set("my_dashboard_query", selected_value, { expires: new Date("January 12, 2025") });
+ });
- Y.one('#query_refresh').on('click', function(e) {
- var query_select = Y.one('#query');
- var index = query_select.get('selectedIndex');
- var selected_value = query_select.get("options").item(index).getAttribute('value');
- updateQueryTable(selected_value);
- });
+ Y.one('#query_refresh').on('click', function(e) {
+ var query_select = Y.one('#query');
+ var index = query_select.get('selectedIndex');
+ var selected_value = query_select.get("options").item(index).getAttribute('value');
+ updateQueryTable(selected_value);
+ });
- Y.one('#query_markread').on('click', function(e) {
- var data = bugQueryTable.data;
- var bug_ids = [];
+ Y.one('#query_markread').on('click', function(e) {
+ var data = bugQueryTable.data;
+ var bug_ids = [];
- Y.one('#query_markread').addClass('bz_default_hidden');
- Y.one('#query_markread_text').removeClass('bz_default_hidden');
+ Y.one('#query_markread').addClass('bz_default_hidden');
+ Y.one('#query_markread_text').removeClass('bz_default_hidden');
- for (var i = 0, l = data.size(); i < l; i++) {
- bug_ids.push(data.item(i).get('bug_id'));
- }
- YAHOO.bugzilla.bugUserLastVisit.update(bug_ids);
- YAHOO.bugzilla.bugInterest.unmark(bug_ids);
- });
+ for (var i = 0, l = data.size(); i < l; i++) {
+ bug_ids.push(data.item(i).get('bug_id'));
+ }
+ YAHOO.bugzilla.bugUserLastVisit.update(bug_ids);
+ YAHOO.bugzilla.bugInterest.unmark(bug_ids);
+ });
- Y.one('#query_buglist').on('click', function(e) {
- var data = bugQueryTable.data;
- var ids = [];
- for (var i = 0, l = data.size(); i < l; i++) {
- ids.push(data.item(i).get('bug_id'));
- }
- var url = 'buglist.cgi?bug_id=' + ids.join('%2C');
- window.open(url, '_blank');
+ Y.one('#query_buglist').on('click', function(e) {
+ var data = bugQueryTable.data;
+ var ids = [];
+ for (var i = 0, l = data.size(); i < l; i++) {
+ ids.push(data.item(i).get('bug_id'));
+ }
+ var url = 'buglist.cgi?bug_id=' + ids.join('%2C');
+ window.open(url, '_blank');
+ });
});
});
diff --git a/extensions/ProductDashboard/template/en/default/pages/productdashboard.html.tmpl b/extensions/ProductDashboard/template/en/default/pages/productdashboard.html.tmpl
index 3a01f879f..413239b6c 100644
--- a/extensions/ProductDashboard/template/en/default/pages/productdashboard.html.tmpl
+++ b/extensions/ProductDashboard/template/en/default/pages/productdashboard.html.tmpl
@@ -8,15 +8,14 @@
[% PROCESS global/variables.none.tmpl %]
-[% javascript_urls = [ "js/yui3/yui/yui-min.js",
+[% javascript_urls = [ "js/yui3.js",
"js/util.js",
"js/field.js" ]
%]
[% IF current_tab_name == 'summary' %]
[% javascript_urls.push("extensions/ProductDashboard/web/js/summary.js") %]
- [% ELSIF current_tab_name == 'recents' %]
- [% yui = [ "calendar" ] %]
+[% ELSIF current_tab_name == 'recents' %]
[% javascript_urls.push("js/field.js") %]
[% javascript_urls.push("js/util.js") %]
[% javascript_urls.push("extensions/ProductDashboard/web/js/recents.js") %]
@@ -46,8 +45,8 @@
title = "Product Dashboard: $filtered_product"
generate_api_token = 1
javascript = js
- style_urls = [ "skins/standard/buglist.css",
- "js/yui/assets/skins/sam/paginator.css",
+ style_urls = [ "skins/yui3.css",
+ "skins/standard/buglist.css",
"extensions/ProductDashboard/web/styles/productdashboard.css" ]
%]
diff --git a/extensions/ProductDashboard/web/js/components.js b/extensions/ProductDashboard/web/js/components.js
index 8b0d28587..0c48576a7 100644
--- a/extensions/ProductDashboard/web/js/components.js
+++ b/extensions/ProductDashboard/web/js/components.js
@@ -6,85 +6,87 @@
* defined by the Mozilla Public License, v. 2.0.
*/
-YUI({
- base: 'js/yui3/',
- combine: false
-}).use("datatable", "datatable-sort", "escape", function(Y) {
- if (typeof PD.updated_recently != 'undefined') {
- var columns = [
- { key:"id", label:"ID", sortable:true, allowHTML: true,
- formatter: '<a href="show_bug.cgi?id={value}" target="_blank">{value}</a>' },
- { key:"bug_status", label:"Status", sortable:true },
- { key:"version", label:"Version", sortable:true },
- { key:"component", label:"Component", sortable:true },
- { key:"severity", label:"Severity", sortable:true },
- { key:"summary", label:"Summary", sortable:false },
- ];
+$(function() {
+ YUI({
+ base: 'js/yui3/',
+ combine: false
+ }).use("datatable", "datatable-sort", "escape", function(Y) {
+ if (typeof PD.updated_recently != 'undefined') {
+ var columns = [
+ { key:"id", label:"ID", sortable:true, allowHTML: true,
+ formatter: '<a href="show_bug.cgi?id={value}" target="_blank">{value}</a>' },
+ { key:"bug_status", label:"Status", sortable:true },
+ { key:"version", label:"Version", sortable:true },
+ { key:"component", label:"Component", sortable:true },
+ { key:"severity", label:"Severity", sortable:true },
+ { key:"summary", label:"Summary", sortable:false },
+ ];
- var updatedRecentlyDataTable = new Y.DataTable({
- columns: columns,
- data: PD.updated_recently
- });
- updatedRecentlyDataTable.render("#updated_recently");
-
- if (typeof PD.past_due != 'undefined') {
- var pastDueDataTable = new Y.DataTable({
+ var updatedRecentlyDataTable = new Y.DataTable({
columns: columns,
- data: PD.past_due
+ data: PD.updated_recently
});
- pastDueDataTable.render('#past_due');
- }
- }
+ updatedRecentlyDataTable.render("#updated_recently");
- if (typeof PD.component_counts != 'undefined') {
- var summary_url = '<a href="page.cgi?id=productdashboard.html&amp;product=' +
- encodeURIComponent(PD.product_name) + '&bug_status=' +
- encodeURIComponent(PD.bug_status) + '&tab=components';
-
- var columns = [
- { key:"name", label:"Name", sortable:true, allowHTML: true,
- formatter: function (o) {
- return summary_url + '&component=' +
- encodeURIComponent(o.value) + '">' +
- Y.Escape.html(o.value) + '</a>'
- }
- },
- { key:"count", label:"Count", sortable:true },
- { key:"percentage", label:"Percentage", sortable:false, allowHTML: true,
- formatter: '<div class="percentage"><div class="bar" style="width:{value}%"></div><div class="percent">{value}%</div></div>' },
- { key:"link", label:"Link", sortable:false, allowHTML: true }
- ];
+ if (typeof PD.past_due != 'undefined') {
+ var pastDueDataTable = new Y.DataTable({
+ columns: columns,
+ data: PD.past_due
+ });
+ pastDueDataTable.render('#past_due');
+ }
+ }
- var componentsDataTable = new Y.DataTable({
- columns: columns,
- data: PD.component_counts
- });
- componentsDataTable.render("#component_counts");
+ if (typeof PD.component_counts != 'undefined') {
+ var summary_url = '<a href="page.cgi?id=productdashboard.html&amp;product=' +
+ encodeURIComponent(PD.product_name) + '&bug_status=' +
+ encodeURIComponent(PD.bug_status) + '&tab=components';
- columns[0].formatter = function (o) {
- return summary_url + '&version=' +
- encodeURIComponent(o.value) + '">' +
- Y.Escape.html(o.value) + '</a>';
- };
+ var columns = [
+ { key:"name", label:"Name", sortable:true, allowHTML: true,
+ formatter: function (o) {
+ return summary_url + '&component=' +
+ encodeURIComponent(o.value) + '">' +
+ Y.Escape.html(o.value) + '</a>'
+ }
+ },
+ { key:"count", label:"Count", sortable:true },
+ { key:"percentage", label:"Percentage", sortable:false, allowHTML: true,
+ formatter: '<div class="percentage"><div class="bar" style="width:{value}%"></div><div class="percent">{value}%</div></div>' },
+ { key:"link", label:"Link", sortable:false, allowHTML: true }
+ ];
- var versionsDataTable = new Y.DataTable({
- columns: columns,
- data: PD.version_counts
- });
- versionsDataTable.render('#version_counts');
+ var componentsDataTable = new Y.DataTable({
+ columns: columns,
+ data: PD.component_counts
+ });
+ componentsDataTable.render("#component_counts");
- if (typeof PD.milestone_counts != 'undefined') {
columns[0].formatter = function (o) {
- return summary_url + '&target_milestone=' +
- encodeURIComponent(o.value) + '">' +
- Y.Escape.html(o.value) + '</a>';
+ return summary_url + '&version=' +
+ encodeURIComponent(o.value) + '">' +
+ Y.Escape.html(o.value) + '</a>';
};
- var milestonesDataTable = new Y.DataTable({
+ var versionsDataTable = new Y.DataTable({
columns: columns,
- data: PD.milestone_counts
+ data: PD.version_counts
});
- milestonesDataTable.render('#milestone_counts');
+ versionsDataTable.render('#version_counts');
+
+ if (typeof PD.milestone_counts != 'undefined') {
+ columns[0].formatter = function (o) {
+ return summary_url + '&target_milestone=' +
+ encodeURIComponent(o.value) + '">' +
+ Y.Escape.html(o.value) + '</a>';
+ };
+
+ var milestonesDataTable = new Y.DataTable({
+ columns: columns,
+ data: PD.milestone_counts
+ });
+ milestonesDataTable.render('#milestone_counts');
+ }
}
- }
+ });
});
diff --git a/extensions/ProductDashboard/web/js/duplicates.js b/extensions/ProductDashboard/web/js/duplicates.js
index 5e3193a65..57f890d6e 100644
--- a/extensions/ProductDashboard/web/js/duplicates.js
+++ b/extensions/ProductDashboard/web/js/duplicates.js
@@ -6,23 +6,25 @@
* defined by the Mozilla Public License, v. 2.0.
*/
-YUI({
- base: 'js/yui3/',
- combine: false
-}).use("datatable", "datatable-sort", function (Y) {
- var column_defs = [
- { key:"id", label:"ID", sortable:true, allowHTML: true,
- formatter: '<a href="show_bug.cgi?id={value}" target="_blank">{value}</a>' },
- { key:"count", label:"Count", sortable:true },
- { key:"status", label:"Status", sortable:true },
- { key:"version", label:"Version", sortable:true },
- { key:"component", label:"Component", sortable:true },
- { key:"severity", label:"Severity", sortable:true },
- { key:"summary", label:"Summary", sortable:false },
- ];
+$(function() {
+ YUI({
+ base: 'js/yui3/',
+ combine: false
+ }).use("datatable", "datatable-sort", function (Y) {
+ var column_defs = [
+ { key:"id", label:"ID", sortable:true, allowHTML: true,
+ formatter: '<a href="show_bug.cgi?id={value}" target="_blank">{value}</a>' },
+ { key:"count", label:"Count", sortable:true },
+ { key:"status", label:"Status", sortable:true },
+ { key:"version", label:"Version", sortable:true },
+ { key:"component", label:"Component", sortable:true },
+ { key:"severity", label:"Severity", sortable:true },
+ { key:"summary", label:"Summary", sortable:false },
+ ];
- var duplicatesDataTable = new Y.DataTable({
- columns: column_defs,
- data: PD.duplicates
- }).render('#duplicates');
+ var duplicatesDataTable = new Y.DataTable({
+ columns: column_defs,
+ data: PD.duplicates
+ }).render('#duplicates');
+ });
});
diff --git a/extensions/ProductDashboard/web/js/popularity.js b/extensions/ProductDashboard/web/js/popularity.js
index b78b67867..d496481fa 100644
--- a/extensions/ProductDashboard/web/js/popularity.js
+++ b/extensions/ProductDashboard/web/js/popularity.js
@@ -6,23 +6,25 @@
* defined by the Mozilla Public License, v. 2.0.
*/
-YUI({
- base: 'js/yui3/',
- combine: false
-}).use("datatable", "datatable-sort", function (Y) {
- var column_defs = [
- { key:"id", label:"ID", sortable:true, allowHTML: true,
- formatter: '<a href="show_bug.cgi?id={value}" target="_blank">{value}</a>' },
- { key:"count", label:"Count", sortable:true },
- { key:"status", label:"Status", sortable:true },
- { key:"version", label:"Version", sortable:true },
- { key:"component", label:"Component", sortable:true },
- { key:"severity", label:"Severity", sortable:true },
- { key:"summary", label:"Summary", sortable:false },
- ];
+$(function() {
+ YUI({
+ base: 'js/yui3/',
+ combine: false
+ }).use("datatable", "datatable-sort", function (Y) {
+ var column_defs = [
+ { key:"id", label:"ID", sortable:true, allowHTML: true,
+ formatter: '<a href="show_bug.cgi?id={value}" target="_blank">{value}</a>' },
+ { key:"count", label:"Count", sortable:true },
+ { key:"status", label:"Status", sortable:true },
+ { key:"version", label:"Version", sortable:true },
+ { key:"component", label:"Component", sortable:true },
+ { key:"severity", label:"Severity", sortable:true },
+ { key:"summary", label:"Summary", sortable:false },
+ ];
- var popularityDataTable = new Y.DataTable({
- columns: column_defs,
- data: PD.popularity
- }).render('#popularity');
+ var popularityDataTable = new Y.DataTable({
+ columns: column_defs,
+ data: PD.popularity
+ }).render('#popularity');
+ });
});
diff --git a/extensions/ProductDashboard/web/js/recents.js b/extensions/ProductDashboard/web/js/recents.js
index 84e1758b6..d3a596c64 100644
--- a/extensions/ProductDashboard/web/js/recents.js
+++ b/extensions/ProductDashboard/web/js/recents.js
@@ -6,27 +6,29 @@
* defined by the Mozilla Public License, v. 2.0.
*/
-YUI({
- base: 'js/yui3/',
- combine: false
-}).use("datatable", "datatable-sort", function (Y) {
- var column_defs = [
- { key:"id", label:"ID", sortable:true, allowHTML: true,
- formatter: '<a href="show_bug.cgi?id={value}" target="_blank">{value}</a>' },
- { key:"status", label:"Status", sortable:true },
- { key:"version", label:"Version", sortable:true },
- { key:"component", label:"Component", sortable:true },
- { key:"severity", label:"Severity", sortable:true },
- { key:"summary", label:"Summary", sortable:false },
- ];
+$(function () {
+ YUI({
+ base: 'js/yui3/',
+ combine: false
+ }).use("datatable", "datatable-sort", function (Y) {
+ var column_defs = [
+ { key:"id", label:"ID", sortable:true, allowHTML: true,
+ formatter: '<a href="show_bug.cgi?id={value}" target="_blank">{value}</a>' },
+ { key:"status", label:"Status", sortable:true },
+ { key:"version", label:"Version", sortable:true },
+ { key:"component", label:"Component", sortable:true },
+ { key:"severity", label:"Severity", sortable:true },
+ { key:"summary", label:"Summary", sortable:false },
+ ];
- var recentlyOpenedDataTable = new Y.DataTable({
- columns: column_defs,
- data: PD.recents.opened
- }).render('#recently_opened');
+ var recentlyOpenedDataTable = new Y.DataTable({
+ columns: column_defs,
+ data: PD.recents.opened
+ }).render('#recently_opened');
- var recentlyClosedDataTable = new Y.DataTable({
- columns: column_defs,
- data: PD.recents.closed
- }).render('#recently_closed');
+ var recentlyClosedDataTable = new Y.DataTable({
+ columns: column_defs,
+ data: PD.recents.closed
+ }).render('#recently_closed');
+ });
});
diff --git a/extensions/ProductDashboard/web/js/roadmap.js b/extensions/ProductDashboard/web/js/roadmap.js
index 1bef5b091..466446c13 100644
--- a/extensions/ProductDashboard/web/js/roadmap.js
+++ b/extensions/ProductDashboard/web/js/roadmap.js
@@ -6,19 +6,21 @@
* defined by the Mozilla Public License, v. 2.0.
*/
-YUI({
- base: 'js/yui3/',
- combine: false
-}).use("datatable", "datatable-sort", function (Y) {
- var column_defs = [
- { key: 'name', label: 'Name', sortable: true },
- { key: 'percentage', label: 'Percentage', sortable: false, allowHTML: true,
- formatter: '<div class="percentage"><div class="bar" style="width:{value}%"></div><div class="percent">{value}%</div></div>' },
- { key: 'link', label: 'Links', allowHTML: true, sortable: false }
- ];
+$(function() {
+ YUI({
+ base: 'js/yui3/',
+ combine: false
+ }).use("datatable", "datatable-sort", function (Y) {
+ var column_defs = [
+ { key: 'name', label: 'Name', sortable: true },
+ { key: 'percentage', label: 'Percentage', sortable: false, allowHTML: true,
+ formatter: '<div class="percentage"><div class="bar" style="width:{value}%"></div><div class="percent">{value}%</div></div>' },
+ { key: 'link', label: 'Links', allowHTML: true, sortable: false }
+ ];
- var roadmapDataTable = new Y.DataTable({
- columns: column_defs,
- data: PD.roadmap,
- }).render('#bug_milestones');
+ var roadmapDataTable = new Y.DataTable({
+ columns: column_defs,
+ data: PD.roadmap,
+ }).render('#bug_milestones');
+ });
});
diff --git a/extensions/ProductDashboard/web/js/summary.js b/extensions/ProductDashboard/web/js/summary.js
index 59d000d7b..c4501200a 100644
--- a/extensions/ProductDashboard/web/js/summary.js
+++ b/extensions/ProductDashboard/web/js/summary.js
@@ -6,40 +6,42 @@
* defined by the Mozilla Public License, v. 2.0.
*/
-YUI({
- base: 'js/yui3/',
- combine: false
-}).use("datatable", "datatable-sort", function (Y) {
- var column_defs = [
- { key: 'name', label: 'Name', sortable: true },
- { key: 'count', label: 'Count', sortable: true },
- { key: 'percentage', label: 'Percentage', sortable: true, allowHTML: true,
- formatter: '<div class="percentage"><div class="bar" style="width:{value}%"></div><div class="percent">{value}%</div></div>' },
- { key: 'link', label: 'Link', allowHTML: true }
- ];
+$(function() {
+ YUI({
+ base: 'js/yui3/',
+ combine: false
+ }).use("datatable", "datatable-sort", function (Y) {
+ var column_defs = [
+ { key: 'name', label: 'Name', sortable: true },
+ { key: 'count', label: 'Count', sortable: true },
+ { key: 'percentage', label: 'Percentage', sortable: true, allowHTML: true,
+ formatter: '<div class="percentage"><div class="bar" style="width:{value}%"></div><div class="percent">{value}%</div></div>' },
+ { key: 'link', label: 'Link', allowHTML: true }
+ ];
- var bugsCountDataTable = new Y.DataTable({
- columns: column_defs,
- data: PD.summary.bug_counts
- }).render('#bug_counts');
+ var bugsCountDataTable = new Y.DataTable({
+ columns: column_defs,
+ data: PD.summary.bug_counts
+ }).render('#bug_counts');
- var statusCountsDataTable = new Y.DataTable({
- columns: column_defs,
- data: PD.summary.status_counts
- }).render('#status_counts');
+ var statusCountsDataTable = new Y.DataTable({
+ columns: column_defs,
+ data: PD.summary.status_counts
+ }).render('#status_counts');
- var priorityCountsDataTable = new Y.DataTable({
- columns: column_defs,
- data: PD.summary.priority_counts
- }).render('#priority_counts');
+ var priorityCountsDataTable = new Y.DataTable({
+ columns: column_defs,
+ data: PD.summary.priority_counts
+ }).render('#priority_counts');
- var severityCountsDataTable = new Y.DataTable({
- columns: column_defs,
- data: PD.summary.severity_counts
- }).render('#severity_counts');
+ var severityCountsDataTable = new Y.DataTable({
+ columns: column_defs,
+ data: PD.summary.severity_counts
+ }).render('#severity_counts');
- var assigneeCountsDataTable = new Y.DataTable({
- columns: column_defs,
- data: PD.summary.assignee_counts
- }).render('#assignee_counts');
+ var assigneeCountsDataTable = new Y.DataTable({
+ columns: column_defs,
+ data: PD.summary.assignee_counts
+ }).render('#assignee_counts');
+ });
});
diff --git a/extensions/REMO/template/en/default/bug/create/create-remo-budget.html.tmpl b/extensions/REMO/template/en/default/bug/create/create-remo-budget.html.tmpl
index f1453c356..571fbb0e1 100644
--- a/extensions/REMO/template/en/default/bug/create/create-remo-budget.html.tmpl
+++ b/extensions/REMO/template/en/default/bug/create/create-remo-budget.html.tmpl
@@ -15,7 +15,6 @@
javascript_urls = [ 'extensions/REMO/web/js/form_validate.js',
'js/util.js',
'js/field.js' ]
- yui = [ 'calendar' ]
%]
[% IF user.in_group("mozilla-reps") %]
diff --git a/extensions/REMO/template/en/default/bug/create/create-remo-swag.html.tmpl b/extensions/REMO/template/en/default/bug/create/create-remo-swag.html.tmpl
index 0e2637cf3..85f21cf33 100644
--- a/extensions/REMO/template/en/default/bug/create/create-remo-swag.html.tmpl
+++ b/extensions/REMO/template/en/default/bug/create/create-remo-swag.html.tmpl
@@ -16,7 +16,6 @@
'js/field.js',
'js/util.js' ]
style_urls = [ "extensions/REMO/web/styles/moz_reps.css" ]
- yui = [ 'calendar' ]
%]
[% IF !user.in_group("mozilla-reps") %]
diff --git a/extensions/REMO/template/en/default/pages/remo-form-payment.html.tmpl b/extensions/REMO/template/en/default/pages/remo-form-payment.html.tmpl
index a37df1f89..acf4a98d6 100644
--- a/extensions/REMO/template/en/default/pages/remo-form-payment.html.tmpl
+++ b/extensions/REMO/template/en/default/pages/remo-form-payment.html.tmpl
@@ -28,7 +28,6 @@
'extensions/REMO/web/js/payment.js',
'js/util.js',
'js/field.js' ]
- yui = ['connection', 'json']
%]
<script language="javascript" type="text/javascript"></script>
diff --git a/extensions/Splinter/template/en/default/pages/splinter.html.tmpl b/extensions/Splinter/template/en/default/pages/splinter.html.tmpl
index 9ecaded3f..c2640b422 100644
--- a/extensions/Splinter/template/en/default/pages/splinter.html.tmpl
+++ b/extensions/Splinter/template/en/default/pages/splinter.html.tmpl
@@ -27,17 +27,9 @@
title = "Patch Review"
generate_api_token = 1
header = "Patch Review"
- style_urls = [ "js/yui/assets/skins/sam/container.css",
- "js/yui/assets/skins/sam/button.css",
- "js/yui/assets/skins/sam/datatable.css",
- "extensions/Splinter/web/splinter.css",
+ style_urls = [ "extensions/Splinter/web/splinter.css",
"skins/custom/bug_groups.css" ]
- javascript_urls = [ "js/yui/element/element-min.js",
- "js/yui/container/container-min.js",
- "js/yui/button/button-min.js",
- "js/yui/json/json-min.js",
- "js/yui/datasource/datasource-min.js",
- "js/yui/datatable/datatable-min.js",
+ javascript_urls = [ "js/yui.js",
"extensions/Splinter/web/splinter.js",
"js/field.js" ]
bodyclasses = bodyclasses
diff --git a/js/yui.js.list b/js/yui.js.list
new file mode 100644
index 000000000..c8c90f7f4
--- /dev/null
+++ b/js/yui.js.list
@@ -0,0 +1,12 @@
+js/yui/yahoo-dom-event/yahoo-dom-event-min.js
+js/yui/cookie/cookie-min.js
+js/yui/connection/connection-min.js
+js/yui/json/json-min.js
+js/yui/selector/selector-min.js
+js/yui/element/element-min.js
+js/yui/container/container-min.js
+js/yui/calendar/calendar-min.js
+js/yui/history/history-min.js
+js/yui/button/button-min.js
+js/yui/datasource/datasource-min.js
+js/yui/datatable/datatable-min.js
diff --git a/js/yui/yahoo-dom-event/yahoo-dom-event.js b/js/yui/yahoo-dom-event/yahoo-dom-event-min.js
index 46c58bfed..46c58bfed 100644
--- a/js/yui/yahoo-dom-event/yahoo-dom-event.js
+++ b/js/yui/yahoo-dom-event/yahoo-dom-event-min.js
diff --git a/js/yui3.js.list b/js/yui3.js.list
new file mode 100644
index 000000000..ef48c6f5f
--- /dev/null
+++ b/js/yui3.js.list
@@ -0,0 +1,75 @@
+js/yui3/yui/yui-min.js
+js/yui3/oop/oop-min.js
+js/yui3/event-custom-base/event-custom-base-min.js
+js/yui3/event-base/event-base-min.js
+js/yui3/dom-core/dom-core-min.js
+js/yui3/dom-base/dom-base-min.js
+js/yui3/selector-native/selector-native-min.js
+js/yui3/selector/selector-min.js
+js/yui3/node-core/node-core-min.js
+js/yui3/dom-style/dom-style-min.js
+js/yui3/node-base/node-base-min.js
+js/yui3/event-delegate/event-delegate-min.js
+js/yui3/node-event-delegate/node-event-delegate-min.js
+js/yui3/pluginhost-base/pluginhost-base-min.js
+js/yui3/pluginhost-config/pluginhost-config-min.js
+js/yui3/node-pluginhost/node-pluginhost-min.js
+js/yui3/dom-screen/dom-screen-min.js
+js/yui3/node-screen/node-screen-min.js
+js/yui3/node-style/node-style-min.js
+js/yui3/escape/escape-min.js
+js/yui3/array-extras/array-extras-min.js
+js/yui3/array-invoke/array-invoke-min.js
+js/yui3/arraylist/arraylist-min.js
+js/yui3/attribute-core/attribute-core-min.js
+js/yui3/event-custom-complex/event-custom-complex-min.js
+js/yui3/attribute-observable/attribute-observable-min.js
+js/yui3/attribute-extras/attribute-extras-min.js
+js/yui3/attribute-base/attribute-base-min.js
+js/yui3/base-core/base-core-min.js
+js/yui3/base-observable/base-observable-min.js
+js/yui3/base-base/base-base-min.js
+js/yui3/base-build/base-build-min.js
+js/yui3/json-parse/json-parse-min.js
+js/yui3/model/model-min.js
+js/yui3/model-list/model-list-min.js
+js/yui3/datatable-core/datatable-core-min.js
+js/yui3/view/view-min.js
+js/yui3/classnamemanager/classnamemanager-min.js
+js/yui3/datatable-head/datatable-head-min.js
+js/yui3/datatable-body/datatable-body-min.js
+js/yui3/datatable-table/datatable-table-min.js
+js/yui3/attribute-complex/attribute-complex-min.js
+js/yui3/base-pluginhost/base-pluginhost-min.js
+js/yui3/event-synthetic/event-synthetic-min.js
+js/yui3/event-focus/event-focus-min.js
+js/yui3/widget-base/widget-base-min.js
+js/yui3/widget-htmlparser/widget-htmlparser-min.js
+js/yui3/widget-skin/widget-skin-min.js
+js/yui3/widget-uievents/widget-uievents-min.js
+js/yui3/datatable-base/datatable-base-min.js
+js/yui3/datatable-column-widths/datatable-column-widths-min.js
+js/yui3/intl/intl-min.js
+js/yui3/datatable-message/lang/datatable-message_en.js
+js/yui3/datatable-message/datatable-message-min.js
+js/yui3/datatable-mutable/datatable-mutable-min.js
+js/yui3/datatable-sort/lang/datatable-sort_en.js
+js/yui3/datatable-sort/datatable-sort-min.js
+js/yui3/plugin/plugin-min.js
+js/yui3/datasource-local/datasource-local-min.js
+js/yui3/datatable-datasource/datatable-datasource-min.js
+js/yui3/json-stringify/json-stringify-min.js
+js/yui3/querystring-stringify-simple/querystring-stringify-simple-min.js
+js/yui3/io-base/io-base-min.js
+js/yui3/datasource-io/datasource-io-min.js
+js/yui3/dataschema-base/dataschema-base-min.js
+js/yui3/dataschema-json/dataschema-json-min.js
+js/yui3/datasource-jsonschema/datasource-jsonschema-min.js
+js/yui3/cookie/cookie-min.js
+js/yui3/gallery-datatable-row-expansion-bmo/gallery-datatable-row-expansion-bmo-min.js
+js/yui3/handlebars-base/handlebars-base-min.js
+js/yui3/handlebars-compiler/handlebars-compiler-min.js
+js/yui3/gallery-funcprog/gallery-funcprog-min.js
+js/yui3/gallery-node-optimizations/gallery-node-optimizations-min.js
+js/yui3/gallery-math/gallery-math-min.js
+js/yui3/gallery-object-extras/gallery-object-extras-min.js
diff --git a/skins/yui.css.list b/skins/yui.css.list
new file mode 100644
index 000000000..e6e501061
--- /dev/null
+++ b/skins/yui.css.list
@@ -0,0 +1,5 @@
+js/yui/assets/skins/sam/calendar.css
+js/yui/assets/skins/sam/container.css
+js/yui/assets/skins/sam/datatable.css
+js/yui/assets/skins/sam/button.css
+js/yui/assets/skins/sam/paginator.css
diff --git a/skins/yui3.css.list b/skins/yui3.css.list
new file mode 100644
index 000000000..7df8f651b
--- /dev/null
+++ b/skins/yui3.css.list
@@ -0,0 +1,5 @@
+js/yui3/widget-base/assets/skins/sam/widget-base.css
+js/yui3/datatable-base/assets/skins/sam/datatable-base.css
+js/yui3/datatable-message/assets/skins/sam/datatable-message.css
+js/yui3/datatable-sort/assets/skins/sam/datatable-sort.css
+js/yui3/gallery-datatable-row-expansion-bmo/assets/skins/sam/gallery-datatable-row-expansion-bmo.css
diff --git a/template/en/default/attachment/create.html.tmpl b/template/en/default/attachment/create.html.tmpl
index eae63adf1..710c12334 100644
--- a/template/en/default/attachment/create.html.tmpl
+++ b/template/en/default/attachment/create.html.tmpl
@@ -35,7 +35,6 @@
subheader = subheader
generate_api_token = 1
style_urls = [ 'skins/standard/attachment.css' ]
- yui = [ 'connection', 'json' ]
javascript_urls = [ "js/attachment.js", 'js/field.js', "js/util.js", "js/TUI.js" ]
doc_section = "attachments.html"
%]
diff --git a/template/en/default/attachment/edit.html.tmpl b/template/en/default/attachment/edit.html.tmpl
index cb0b1c71a..4e0195e34 100644
--- a/template/en/default/attachment/edit.html.tmpl
+++ b/template/en/default/attachment/edit.html.tmpl
@@ -39,7 +39,6 @@
subheader = subheader
generate_api_token = 1
doc_section = "attachments.html"
- yui = [ 'connection', 'json' ]
javascript_urls = ['js/attachment.js', 'js/field.js']
style_urls = ['skins/standard/attachment.css']
bodyclasses = "no_javascript"
diff --git a/template/en/default/bug/create/create.html.tmpl b/template/en/default/bug/create/create.html.tmpl
index ba5d08273..ab95c38a7 100644
--- a/template/en/default/bug/create/create.html.tmpl
+++ b/template/en/default/bug/create/create.html.tmpl
@@ -31,7 +31,6 @@
[% PROCESS global/header.html.tmpl
title = title
generate_api_token = 1
- yui = [ 'calendar', 'datatable', 'button' ]
style_urls = [ 'skins/standard/attachment.css',
'skins/standard/enter_bug.css',
'skins/custom/create_bug.css' ]
diff --git a/template/en/default/bug/show-header.html.tmpl b/template/en/default/bug/show-header.html.tmpl
index c8acca614..2aac89ddb 100644
--- a/template/en/default/bug/show-header.html.tmpl
+++ b/template/en/default/bug/show-header.html.tmpl
@@ -41,8 +41,6 @@
[% generate_api_token = 1 %]
[% header = "$terms.Bug&nbsp;$bug.bug_id" %]
[% header_addl_info = "Last modified: $filtered_timestamp" %]
-[% yui = ['calendar', 'connection', 'json'] %]
-[% yui.push('container') IF user.can_tag_comments %]
[% javascript_urls = [ "js/util.js", "js/field.js" ] %]
[% javascript_urls.push("js/bug.js") IF user.id %]
[% javascript_urls.push('js/comment-tagging.js')
diff --git a/template/en/default/bug/summarize-time.html.tmpl b/template/en/default/bug/summarize-time.html.tmpl
index 0166539ea..65ecc3e72 100644
--- a/template/en/default/bug/summarize-time.html.tmpl
+++ b/template/en/default/bug/summarize-time.html.tmpl
@@ -33,7 +33,6 @@
header = header
style_urls = ["skins/standard/summarize-time.css"]
doc_section = "timetracking.html"
- yui = ['calendar']
javascript_urls = [ "js/util.js", "js/field.js" ]
%]
diff --git a/template/en/default/global/header.html.tmpl b/template/en/default/global/header.html.tmpl
index 5cd0fef79..ac753dca9 100644
--- a/template/en/default/global/header.html.tmpl
+++ b/template/en/default/global/header.html.tmpl
@@ -50,38 +50,12 @@
header_addl_info = ""
onload = ""
style_urls = []
- yui = []
- yui_css = {}
- yui_deps = {}
no_yui = 0
jquery = []
jquery_css = []
generate_api_token = 0
%]
-[% IF NOT no_yui %]
- [% SET yui_css = {
- calendar => 1,
- datatable => 1,
- button => 1,
- } %]
-
- [%# Note: This is simple dependency resolution--you can't have dependencies
- # that depend on each other. You have to specify all of a module's deps,
- # if that module is going to be specified in "yui".
- #%]
- [% SET yui_deps = {
- datatable => ['json', 'connection', 'datasource', 'element'],
- } %]
-
- [%# When using certain YUI modules, we need to process certain
- # extra JS templates.
- #%]
- [% SET yui_templates = {
- datatable => ['global/value-descs.js.tmpl'],
- } %]
-[% END %]
-
[%# These are JS URLs that are *always* on the page and come before
# every other JS URL.
#%]
@@ -91,8 +65,7 @@
] %]
[% IF NOT no_yui %]
- [% starting_js_urls.push("js/yui/yahoo-dom-event/yahoo-dom-event.js",
- "js/yui/cookie/cookie-min.js") %]
+ [% starting_js_urls.push("js/yui.js") %]
[% END %]
[% SET jq_css_urls = [
@@ -163,11 +136,7 @@
[% PROCESS 'global/setting-descs.none.tmpl' %]
- [% IF NOT no_yui %]
- [% SET yui = yui_resolve_deps(yui, yui_deps) %]
- [% END %]
-
- [% SET css_sets = css_files(style_urls.unique, yui, yui_css) %]
+ [% SET css_sets = css_files(style_urls.unique, no_yui) %]
[% IF constants.CONCATENATE_ASSETS %]
[% PROCESS format_css_link asset_url = css_sets.unified_standard_skin %]
[% ELSE %]
@@ -195,13 +164,6 @@
[% END %]
[% END %]
- [% IF NOT no_yui %]
- [%# YUI Scripts %]
- [% FOREACH yui_name = yui %]
- [% starting_js_urls.push("js/yui/$yui_name/${yui_name}-min.js") %]
- [% END %]
- [% END %]
-
[%# jQuery Plugins %]
[% FOREACH jq_name = jquery.unique %]
[% starting_js_urls.push("js/jquery/plugins/$jq_name/${jq_name}-min.js") %]
@@ -212,11 +174,6 @@
[% PROCESS format_js_link %]
[% END %]
- [%# Make some Bugzilla information available to all scripts.
- # We don't import every parameter and constant because we
- # don't want to add a lot of uncached JS to every page.
- # %]
-
[% inline_javascript = BLOCK %]
[% IF NOT no_yui %]
YAHOO.namespace('bugzilla');
@@ -224,11 +181,7 @@
YAHOO.util.Event._simpleRemove(window, "unload",
YAHOO.util.Event._unload);
}
- [% FOREACH yui_name = yui %]
- [% FOREACH yui_template = yui_templates.$yui_name %]
- [% INCLUDE $yui_template %]
- [% END %]
- [% END %]
+ [% INCLUDE 'global/value-descs.js.tmpl' %]
[% END %]
[% IF javascript %]
diff --git a/template/en/default/global/value-descs.js.tmpl b/template/en/default/global/value-descs.js.tmpl
index 20d023b42..b0fb1d4d2 100644
--- a/template/en/default/global/value-descs.js.tmpl
+++ b/template/en/default/global/value-descs.js.tmpl
@@ -20,14 +20,4 @@
[% PROCESS "global/value-descs.none.tmpl" %]
-BUGZILLA.value_descs = {
- [% FOREACH vd_field = value_descs.keys %]
- [% vd_field FILTER js %]: {
- [% FOREACH vd_value = value_descs.${vd_field}.keys %]
- '[% vd_value FILTER js %]':
- '[% value_descs.${vd_field}.${vd_value} FILTER js %]'
- [%~ ',' UNLESS loop.last %]
- [% END %]
- }[% ',' UNLESS loop.last %]
- [% END %]
-};
+BUGZILLA.value_descs = JSON.parse('[% json_encode(value_descs) FILTER js %]');
diff --git a/template/en/default/list/list.html.tmpl b/template/en/default/list/list.html.tmpl
index 5e154f5df..1c49fee98 100644
--- a/template/en/default/list/list.html.tmpl
+++ b/template/en/default/list/list.html.tmpl
@@ -50,7 +50,6 @@
generate_api_token = dotweak
style = style
atomlink = "buglist.cgi?$urlquerypart&title=$url_filtered_title&ctype=atom"
- yui = [ 'calendar' ]
javascript_urls = [ "js/util.js", "js/field.js" ]
style_urls = [ "skins/standard/buglist.css" ]
doc_section = "query.html#list"
diff --git a/template/en/default/reports/report.html.tmpl b/template/en/default/reports/report.html.tmpl
index 38b64df0b..deb570202 100644
--- a/template/en/default/reports/report.html.tmpl
+++ b/template/en/default/reports/report.html.tmpl
@@ -77,7 +77,6 @@
.ttotal, .ttotal td { background-color: #cfffdf } /* light green */
"
header_addl_info = time
- yui = ['datatable']
%]
[% IF debug %]
diff --git a/template/en/default/search/search-advanced.html.tmpl b/template/en/default/search/search-advanced.html.tmpl
index 3956a1ff2..60f47a916 100644
--- a/template/en/default/search/search-advanced.html.tmpl
+++ b/template/en/default/search/search-advanced.html.tmpl
@@ -45,7 +45,6 @@ function remove_token() {
generate_api_token = 1
onload = "doOnSelectProduct(0);"
javascript = js_data
- yui = [ 'calendar', 'connection' ]
javascript_urls = [ "js/productform.js", "js/util.js", "js/TUI.js", "js/field.js"]
style_urls = [ "skins/standard/search_form.css" ]
doc_section = "query.html"
diff --git a/template/en/default/search/search-create-series.html.tmpl b/template/en/default/search/search-create-series.html.tmpl
index 6b7678b23..69e7a6307 100644
--- a/template/en/default/search/search-create-series.html.tmpl
+++ b/template/en/default/search/search-create-series.html.tmpl
@@ -34,7 +34,6 @@
title = "Create New Data Set"
generate_api_token = 1
onload = "doOnSelectProduct(0);"
- yui = [ 'calendar' ]
javascript = js_data
javascript_urls = [ "js/util.js", "js/productform.js", "js/TUI.js", "js/field.js" ]
style_urls = [ "skins/standard/search_form.css" ]
diff --git a/template/en/default/search/search-instant.html.tmpl b/template/en/default/search/search-instant.html.tmpl
index 00f6434e9..4a7ff1992 100644
--- a/template/en/default/search/search-instant.html.tmpl
+++ b/template/en/default/search/search-instant.html.tmpl
@@ -13,7 +13,6 @@
generate_api_token = 1
javascript_urls = [ 'extensions/GuidedBugEntry/web/js/products.js',
'js/instant-search.js', ]
- yui = [ 'datatable', 'container' ]
%]
[% UNLESS default.exists('product') && default.product.size %]
diff --git a/template/en/default/search/search-report-graph.html.tmpl b/template/en/default/search/search-report-graph.html.tmpl
index 20e8e184d..b7e7b59c8 100644
--- a/template/en/default/search/search-report-graph.html.tmpl
+++ b/template/en/default/search/search-report-graph.html.tmpl
@@ -33,7 +33,6 @@ var queryform = "reportform"
title = "Generate Graphical Report"
generate_api_token = 1
onload = "doOnSelectProduct(0); chartTypeChanged()"
- yui = [ 'calendar' ]
javascript = js_data
javascript_urls = [ "js/util.js", "js/productform.js", "js/TUI.js", "js/field.js" ]
style_urls = [ "skins/standard/search_form.css" ]
diff --git a/template/en/default/search/search-report-table.html.tmpl b/template/en/default/search/search-report-table.html.tmpl
index 7ff54b8da..7ac4ac5a0 100644
--- a/template/en/default/search/search-report-table.html.tmpl
+++ b/template/en/default/search/search-report-table.html.tmpl
@@ -33,7 +33,6 @@ var queryform = "reportform"
title = "Generate Tabular Report"
generate_api_token = 1
onload = "doOnSelectProduct(0)"
- yui = [ 'calendar' ]
javascript = js_data
javascript_urls = [ "js/util.js", "js/productform.js", "js/TUI.js", "js/field.js" ]
style_urls = [ "skins/standard/search_form.css" ]