-
Notifications
You must be signed in to change notification settings - Fork 5
/
portlets.html
152 lines (132 loc) · 5.34 KB
/
portlets.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Portlets</title>
<script src="../jquery-1.7.1.min.js"></script>
<script src="../jquery-ui-1.8.18.custom.min.js"></script>
<link type="text/css" rel="stylesheet" href="../jquery-ui-1.8.18.custom.css" />
<style>
.column { float:left;width: auto; width:33%;}
.portlet { margin: 0 1em 1em 0;}
.portlet-header { margin: 0.3em; padding-bottom: 4px; padding-left: 0.2em; }
.portlet-header .ui-icon{ float: left; cursor:pointer;}
.portlet-header .portlet-max{float:right;}
.portlet-header .portlet-setting{float:right;}
.portlet-header .portlet-close{float:right;}
.portlet-header .portlet-restore{float:right;}
.portlet-canvas {position:absolute;width:99.5%; height:100%; z-index:1000;left:10px;vertical-align:top; top:15px;}
.portlet-content { padding: 0.4em;}
.ui-sortable-placeholder { border: 1px dashed black; visibility: visible !important; }
.ui-sortable-placeholder * { visibility: hidden; }
</style>
</head>
<body>
<script>
$(function() {
$( ".column" ).sortable({
connectWith: ".column"
});
$( ".portlet" ).addClass( "ui-widget ui-widget-content ui-helper-clearfix ui-corner-all" )
.find( ".portlet-header" )
.addClass( "ui-widget-header ui-corner-all" )
.prepend( "<span class='ui-icon ui-icon-triangle-1-s'>Minimise</span>")
.prepend("<span class='ui-icon ui-icon-arrowthick-2-ne-sw portlet-max'>max</span>")
.prepend("<span class='ui-icon ui-icon-gear portlet-setting'>settings</span>")
.prepend("<span class='ui-icon ui-icon-closethick portlet-close'>close</span>")
.prepend("<span class='ui-icon ui-icon-arrowthick-1-sw portlet-restore'>restore</span>")
.end()
.find( ".portlet-content" );
$(".portlet").find(".portlet-restore").hide();
$(".portlet").find(".portlet-userpref").hide();
$( ".portlet-header .ui-icon-triangle-1-s" ).click(function() {
$( this ).toggleClass( "ui-icon-triangle-1-s" ).toggleClass( "ui-icon-triangle-1-n" );
$( this ).parents( ".portlet:first" ).find( ".portlet-content" ).toggle();
});
$(".portlet-header .portlet-max").click(function(){
addOverlay($("#demo"));
$(".column").sortable( "option", "disabled", true);
$("#news").removeClass("portlet").addClass("portlet-canvas");
$("#news").find(".portlet-max").hide();
$("#news").find(".portlet-setting").hide();
$("#news").find(".portlet-close").hide();
$("#news").find(".portlet-restore").show();
});
$(".portlet-header .portlet-restore").click(function(){
$(".column").sortable( "option", "disabled", false);
$(".dnd-overlay").remove();
$("#news").removeClass("portlet-canvas").addClass("portlet");
$("#news").find(".portlet-restore").hide();
$("#news").find(".portlet-max").show();
$("#news").find(".portlet-setting").show();
$("#news").find(".portlet-close").show();
});
$(".portlet-header .portlet-setting").click(function(){
$("#feed").find(".portlet-userpref").show();
});
$( ".column" ).disableSelection();
});
function addOverlay(jqElm) {
var overlay = $('<div></div>');
var styleMap = {
position: "absolute",
height : jqElm.height(),
width : jqElm.width(),
'z-index': 10,
opacity : 0.7,
background : "#FFFFFF"
};
// style it and give it the marker class
$(overlay).css(styleMap);
$(overlay).addClass("dnd-overlay");
// add it to the dom before the iframe so it covers it
jqElm.prepend(overlay[0]);
}
</script>
<div id="demo">
<div class="column">
<div class="portlet" id="feed">
<div class="portlet-header">Feeds</div>
<div class="portlet-userpref">
<form>
<table>
<tr>
<td>refresh Cycle</td><td><input type="text" /></td>
</tr>
<tr>
<td><input type="button" value="Save"></td><td><input type="button" value="Cancel"></td>
</tr>
</table>
</form>
</div>
<div class="portlet-content">
<div class="test">
Google Web Toolkit contains two powerful tools for creating optimized web applications. The GWT compiler performs comprehensive optimizations across your codebase — in-lining methods, removing dead code, optimizing strings, and more. By setting split-points in the code, it can also segment your download into multiple JavaScript fragments, splitting up large applications for faster startup time.
By setting split-points in the code, it can also segment your download into multiple JavaScript fragments, splitting up large applications for faster startup time.
</div>
</div>
</div>
<div class="portlet" id="news">
<div class="portlet-header">News</div>
<div class="portlet-userpref"></div>
<div class="portlet-content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit</div>
</div>
</div>
<div class="column">
<div class="portlet" id="shopping">
<div class="portlet-header">Shopping</div>
<div class="portlet-userpref"></div>
<div class="portlet-content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit</div>
</div>
</div>
<div class="column">
<div class="portlet">
<div class="portlet-header"><span>Links</span></div>
<div class="portlet-userpref"></div>
<div class="portlet-content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit</div>
</div>
</div>
<div style="clear:both;"></div>
</div><!-- End demo -->
</body>
</html>