Author: erinnp
Date: Mon Jun 24 21:27:46 2013
New Revision: 1496223
URL: http://svn.apache.org/r1496223
Log:
moved cog icon and dropdown functionality into home view
Modified:
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/tags/region_widget.tag
rave/branches/require/rave-portal-resources/src/main/webapp/static/script/portal/rave_event_bindings.js
rave/branches/require/rave-portal-resources/src/main/webapp/static/script/portal/rave_layout.js
rave/branches/require/rave-portal-resources/src/main/webapp/static/script/portal/rave_ui.js
Modified:
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/tags/region_widget.tag
URL:
http://svn.apache.org/viewvc/rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/tags/region_widget.tag?rev=1496223&r1=1496222&r2=1496223&view=diff
==============================================================================
---
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/tags/region_widget.tag
(original)
+++
rave/branches/require/rave-portal-resources/src/main/webapp/WEB-INF/tags/region_widget.tag
Mon Jun 24 21:27:46 2013
@@ -119,9 +119,4 @@ Template for rendering a RegionWidget in
<div class="widget" id="widget-${regionWidget.id}-body">
<portal:render-widget regionWidget="${regionWidget}"
widget="${widget}" />
</div>
-</div>
-<script>
-// require(["portal/rave_event_bindings", "jquery"],
function(raveEventBindings, $){
-// $(function(){raveEventBindings.bindEvents('region_widget.tag');})
-// })
-</script>
\ No newline at end of file
+</div>
\ No newline at end of file
Modified:
rave/branches/require/rave-portal-resources/src/main/webapp/static/script/portal/rave_event_bindings.js
URL:
http://svn.apache.org/viewvc/rave/branches/require/rave-portal-resources/src/main/webapp/static/script/portal/rave_event_bindings.js?rev=1496223&r1=1496222&r2=1496223&view=diff
==============================================================================
---
rave/branches/require/rave-portal-resources/src/main/webapp/static/script/portal/rave_event_bindings.js
(original)
+++
rave/branches/require/rave-portal-resources/src/main/webapp/static/script/portal/rave_event_bindings.js
Mon Jun 24 21:27:46 2013
@@ -30,9 +30,7 @@ define(["jquery", 'rave', 'portal/rave_s
"store.jsp": storeEventBindings,
"widget.jsp": widgetEventBindings,
"widget.marketplace.jsp": widgetMarketplaceEventBindings,
- "widgetdetail.jsp": widgetDetailEventBindings,
- "region_widget.tag": regionWidgetEventBindings
-
+ "widgetdetail.jsp": widgetDetailEventBindings
};
/********************************
@@ -167,12 +165,6 @@ define(["jquery", 'rave', 'portal/rave_s
})
};
- function regionWidgetEventBindings(){
- $('.addIframeOverlaysLink').click(function(event){
- raveLayout.addIframeOverlays(event)
- })
- };
-
/********************************
Helper Functions
********************************/
Modified:
rave/branches/require/rave-portal-resources/src/main/webapp/static/script/portal/rave_layout.js
URL:
http://svn.apache.org/viewvc/rave/branches/require/rave-portal-resources/src/main/webapp/static/script/portal/rave_layout.js?rev=1496223&r1=1496222&r2=1496223&view=diff
==============================================================================
---
rave/branches/require/rave-portal-resources/src/main/webapp/static/script/portal/rave_layout.js
(original)
+++
rave/branches/require/rave-portal-resources/src/main/webapp/static/script/portal/rave_layout.js
Mon Jun 24 21:27:46 2013
@@ -177,36 +177,7 @@ define(["jquery", "rave", "portal/rave_p
// functions associated with the user search for sharing pages
- function addIframeOverlays(event) {
- //e.preventDefault();
- var i = 0;
- $(".widget").each(function () {
- var W = $(this).outerWidth(),
- H = $(this).outerHeight(),
- X = $(this).position().left,
- Y = $(this).position().top;
-
- $(this).after('<div class="iframe-overlay" />');
- $(this).next('.iframe-overlay').css({
- width: W,
- height: H,
- position: "absolute",
- top: Y,
- left: X
- });
-
- });
-
- $('.iframe-overlay').click(function () {
- widgetMenu.hideWidgetMenu();
- })
-
- // Remove any overlays onclick of all the things!!!
- $("*:not(.dropdown-toggle)").on("click", function () {
- $(".iframe-overlay").remove();
- });
- }
/**
* Submits the RPC call to move the widget to a new page
@@ -389,9 +360,8 @@ define(["jquery", "rave", "portal/rave_p
(hash === "" && subPage.isDefault));
}
- function init() {
+ function init(){
pageMenu.init(rave.getExportEnabled());
- $(".dropdown-toggle").dropdown();
}
rave.registerOnInitHandler(init);
@@ -406,7 +376,6 @@ define(["jquery", "rave", "portal/rave_p
closePageDialog: closePageDialog,
closePageDialogTabbed: closePageDialogTabbed,
moveWidgetToPage: moveWidgetToPage,
- isWidgetOnHiddenTab: isWidgetOnHiddenTab,
- addIframeOverlays: addIframeOverlays
+ isWidgetOnHiddenTab: isWidgetOnHiddenTab
};
})
Modified:
rave/branches/require/rave-portal-resources/src/main/webapp/static/script/portal/rave_ui.js
URL:
http://svn.apache.org/viewvc/rave/branches/require/rave-portal-resources/src/main/webapp/static/script/portal/rave_ui.js?rev=1496223&r1=1496222&r2=1496223&view=diff
==============================================================================
---
rave/branches/require/rave-portal-resources/src/main/webapp/static/script/portal/rave_ui.js
(original)
+++
rave/branches/require/rave-portal-resources/src/main/webapp/static/script/portal/rave_ui.js
Mon Jun 24 21:27:46 2013
@@ -557,6 +557,7 @@ define(["jquery", "underscore", "handleb
this.$chrome = $('#widget-' + regionWidgetId + '-wrapper');
this.$minimizeIcon = $("#widget-" + regionWidgetId + "-min");
this.$toggleCollapseIcon = $("#widget-" + regionWidgetId +
"-collapse");
+ this.$cogIcon = $('#widget-'+regionWidgetId+'-menu-button');
this.$menuItemMove = $("#widget-" + regionWidgetId +
"-menu-move-item");
this.$menuItemDelete = $("#widget-" + regionWidgetId +
"-menu-delete-item");
this.$menuItemMaximize = $("#widget-" + regionWidgetId +
"-menu-maximize-item");
@@ -591,6 +592,38 @@ define(["jquery", "underscore", "handleb
return false;
}
+ function addIframeOverlays(event) {
+ //e.preventDefault();
+
+ var i = 0;
+ $(".widget").each(function () {
+ var W = $(this).outerWidth(),
+ H = $(this).outerHeight(),
+ X = $(this).position().left,
+ Y = $(this).position().top;
+
+ $(this).after('<div class="iframe-overlay" />');
+ $(this).next('.iframe-overlay').css({
+ width: W,
+ height: H,
+ position: "absolute",
+ top: Y,
+ left: X
+ });
+
+ });
+
+ $('.iframe-overlay').click(function () {
+ self.$cogIcon.dropdown('toggle');
+ $(".iframe-overlay").remove();
+ })
+
+ // Remove any overlays onclick of all the things!!!
+ $("*:not(.dropdown-toggle)").on("click", function () {
+ $(".iframe-overlay").remove();
+ });
+ }
+
function minimize() {
self.widget.render('home');
}
@@ -613,7 +646,7 @@ define(["jquery", "underscore", "handleb
function doCollapseExpand() {
var expanded = !widget.collapsed
- $('iframe', self.$widgetSite).toggle(expanded);
+ $(self.$widgetSite).toggle(expanded);
$('i',
self.$toggleCollapseIcon).toggleClass('icon-chevron-down', expanded);
$('i',
self.$toggleCollapseIcon).toggleClass('icon-chevron-up', !expanded);
}
@@ -661,6 +694,8 @@ define(["jquery", "underscore", "handleb
//bind widget menu items
self.$minimizeIcon.click(minimize);
self.$toggleCollapseIcon.click(toggleCollapse);
+ self.$cogIcon.click(addIframeOverlays);
+ self.$cogIcon.dropdown();
if (!self.$menuItemMove.hasClass("menu-item-disabled")) {
self.$menuItemMove.click(showMovePageDialog);
}
@@ -893,7 +928,6 @@ define(["jquery", "underscore", "handleb
}
function init() {
-
initializePageSharing();
registerHomeView();
registerCanvasView();