aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--demos/dialog/animated.html17
-rw-r--r--demos/dialog/default.html14
-rw-r--r--demos/dialog/modal-confirmation.html13
-rw-r--r--demos/dialog/modal-form.html15
-rw-r--r--demos/dialog/modal-message.html14
5 files changed, 10 insertions, 63 deletions
diff --git a/demos/dialog/animated.html b/demos/dialog/animated.html
index 02c3fd31f..088ca0ea9 100644
--- a/demos/dialog/animated.html
+++ b/demos/dialog/animated.html
@@ -4,21 +4,9 @@
<meta charset="utf-8">
<title>jQuery UI Dialog - Animation</title>
<link rel="stylesheet" href="../../themes/base/all.css">
- <script src="../../external/jquery/jquery.js"></script>
- <script src="../../ui/core.js"></script>
- <script src="../../ui/widget.js"></script>
- <script src="../../ui/mouse.js"></script>
- <script src="../../ui/draggable.js"></script>
- <script src="../../ui/position.js"></script>
- <script src="../../ui/resizable.js"></script>
- <script src="../../ui/button.js"></script>
- <script src="../../ui/dialog.js"></script>
- <script src="../../ui/effect.js"></script>
- <script src="../../ui/effect-blind.js"></script>
- <script src="../../ui/effect-explode.js"></script>
<link rel="stylesheet" href="../demos.css">
- <script>
- $(function() {
+ <script src="../../external/requirejs/require.js"></script>
+ <script src="../bootstrap.js" data-modules="effect effect-blind effect-explode">
$( "#dialog" ).dialog({
autoOpen: false,
show: {
@@ -34,7 +22,6 @@
$( "#opener" ).on( "click", function() {
$( "#dialog" ).dialog( "open" );
});
- });
</script>
</head>
<body>
diff --git a/demos/dialog/default.html b/demos/dialog/default.html
index 41c811668..e86281a47 100644
--- a/demos/dialog/default.html
+++ b/demos/dialog/default.html
@@ -4,20 +4,10 @@
<meta charset="utf-8">
<title>jQuery UI Dialog - Default functionality</title>
<link rel="stylesheet" href="../../themes/base/all.css">
- <script src="../../external/jquery/jquery.js"></script>
- <script src="../../ui/core.js"></script>
- <script src="../../ui/widget.js"></script>
- <script src="../../ui/mouse.js"></script>
- <script src="../../ui/draggable.js"></script>
- <script src="../../ui/position.js"></script>
- <script src="../../ui/resizable.js"></script>
- <script src="../../ui/button.js"></script>
- <script src="../../ui/dialog.js"></script>
<link rel="stylesheet" href="../demos.css">
- <script>
- $(function() {
+ <script src="../../external/requirejs/require.js"></script>
+ <script src="../bootstrap.js">
$( "#dialog" ).dialog();
- });
</script>
</head>
<body>
diff --git a/demos/dialog/modal-confirmation.html b/demos/dialog/modal-confirmation.html
index 741f59d38..9ae4b1e98 100644
--- a/demos/dialog/modal-confirmation.html
+++ b/demos/dialog/modal-confirmation.html
@@ -4,17 +4,9 @@
<meta charset="utf-8">
<title>jQuery UI Dialog - Modal confirmation</title>
<link rel="stylesheet" href="../../themes/base/all.css">
- <script src="../../external/jquery/jquery.js"></script>
- <script src="../../ui/core.js"></script>
- <script src="../../ui/widget.js"></script>
- <script src="../../ui/mouse.js"></script>
- <script src="../../ui/button.js"></script>
- <script src="../../ui/draggable.js"></script>
- <script src="../../ui/position.js"></script>
- <script src="../../ui/dialog.js"></script>
<link rel="stylesheet" href="../demos.css">
- <script>
- $(function() {
+ <script src="../../external/requirejs/require.js"></script>
+ <script src="../bootstrap.js">
$( "#dialog-confirm" ).dialog({
resizable: false,
height: "auto",
@@ -29,7 +21,6 @@
}
}
});
- });
</script>
</head>
<body>
diff --git a/demos/dialog/modal-form.html b/demos/dialog/modal-form.html
index 919bb0733..7933c685a 100644
--- a/demos/dialog/modal-form.html
+++ b/demos/dialog/modal-form.html
@@ -4,16 +4,6 @@
<meta charset="utf-8">
<title>jQuery UI Dialog - Modal form</title>
<link rel="stylesheet" href="../../themes/base/all.css">
- <script src="../../external/jquery/jquery.js"></script>
- <script src="../../ui/core.js"></script>
- <script src="../../ui/widget.js"></script>
- <script src="../../ui/mouse.js"></script>
- <script src="../../ui/button.js"></script>
- <script src="../../ui/draggable.js"></script>
- <script src="../../ui/position.js"></script>
- <script src="../../ui/resizable.js"></script>
- <script src="../../ui/dialog.js"></script>
- <script src="../../ui/effect.js"></script>
<link rel="stylesheet" href="../demos.css">
<style>
label, input { display:block; }
@@ -26,8 +16,8 @@
.ui-dialog .ui-state-error { padding: .3em; }
.validateTips { border: 1px solid transparent; padding: 0.3em; }
</style>
- <script>
- $(function() {
+ <script src="../../external/requirejs/require.js"></script>
+ <script src="../bootstrap.js" data-modules="effect">
var dialog, form,
// From http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#e-mail-state-%28type=email%29
@@ -116,7 +106,6 @@
$( "#create-user" ).button().on( "click", function() {
dialog.dialog( "open" );
});
- });
</script>
</head>
<body>
diff --git a/demos/dialog/modal-message.html b/demos/dialog/modal-message.html
index ce04bd66c..137884627 100644
--- a/demos/dialog/modal-message.html
+++ b/demos/dialog/modal-message.html
@@ -4,18 +4,9 @@
<meta charset="utf-8">
<title>jQuery UI Dialog - Modal message</title>
<link rel="stylesheet" href="../../themes/base/all.css">
- <script src="../../external/jquery/jquery.js"></script>
- <script src="../../ui/core.js"></script>
- <script src="../../ui/widget.js"></script>
- <script src="../../ui/mouse.js"></script>
- <script src="../../ui/button.js"></script>
- <script src="../../ui/draggable.js"></script>
- <script src="../../ui/position.js"></script>
- <script src="../../ui/resizable.js"></script>
- <script src="../../ui/dialog.js"></script>
<link rel="stylesheet" href="../demos.css">
- <script>
- $(function() {
+ <script src="../../external/requirejs/require.js"></script>
+ <script src="../bootstrap.js" data-modules="effect">
$( "#dialog-message" ).dialog({
modal: true,
buttons: {
@@ -24,7 +15,6 @@
}
}
});
- });
</script>
</head>
<body>
/span> FontInfo { public static final String DEFAULT_FONT = "any,normal,400"; public static final int NORMAL = 400; public static final int BOLD = 700; private HashMap usedFonts; private HashMap triplets; // look up a font-triplet to find a font-name private HashMap fonts; // look up a font-name to get a font (that implements FontMetric at least) public FontInfo() { this.triplets = new HashMap(); this.fonts = new HashMap(); this.usedFonts = new HashMap(); } public boolean isSetupValid() { return triplets.containsKey(DEFAULT_FONT); } public void addFontProperties(String name, String family, String style, int weight) { /* * add the given family, style and weight as a lookup for the font * with the given name */ String key = createFontKey(family, style, weight); this.triplets.put(key, name); } public void addMetrics(String name, FontMetric metrics) { // add the given metrics as a font with the given name this.fonts.put(name, metrics); } /** * Lookup a font. * Locate the font name for a given familyi, style and weight. * The font name can then be used as a key as it is unique for * the associated document. * This also adds the font to the list of used fonts. */ public String fontLookup(String family, String style, int weight) { String key; // first try given parameters key = createFontKey(family, style, weight); String f = (String)triplets.get(key); if(f == null) { // then adjust weight, favouring normal or bold f = findAdjustWeight(family, style, weight); // then try any family with orig weight if(f == null) { key = createFontKey("any", style, weight); f = (String)triplets.get(key); } // then try any family with adjusted weight if(f == null) { f = findAdjustWeight(family, style, weight); } // then use default f = (String)triplets.get(DEFAULT_FONT); } usedFonts.put(f, fonts.get(f)); return f; } /** * Find a font with a given family and style by trying * different font weights according to the spec. */ public String findAdjustWeight(String family, String style, int weight) { String key; String f = null; int newWeight = weight; if(newWeight < 400) { while(f == null && newWeight > 0) { newWeight -= 100; key = createFontKey(family, style, newWeight); f = (String)triplets.get(key); } } else if(newWeight == 500) { key = createFontKey(family, style, 400); f = (String)triplets.get(key); } else if(newWeight > 500) { while(f == null && newWeight < 1000) { newWeight += 100; key = createFontKey(family, style, newWeight); f = (String)triplets.get(key); } newWeight = weight; while(f == null && newWeight > 400) { newWeight -= 100; key = createFontKey(family, style, newWeight); f = (String)triplets.get(key); } } if(f == null) { key = createFontKey(family, style, 400); f = (String)triplets.get(key); } return f; } public boolean hasFont(String family, String style, int weight) { String key = createFontKey(family, style, weight); return this.triplets.containsKey(key); } /** * Creates a key from the given strings */ public static String createFontKey(String family, String style, int weight) { return family + "," + style + "," + weight; } public HashMap getFonts() { return this.fonts; } /** * This is used by the renderers to retrieve all the * fonts used in the document. * This is for embedded font or creating a list of used fonts. */ public HashMap getUsedFonts() { return this.usedFonts; } public FontMetric getMetricsFor(String fontName) { usedFonts.put(fontName, fonts.get(fontName)); return (FontMetric)fonts.get(fontName); } }