Skip to content

Commit

Permalink
MINOR Removed jQuery.layout implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
chillu committed Apr 23, 2011
1 parent d5efacb commit 11a3b86
Show file tree
Hide file tree
Showing 16 changed files with 6 additions and 24,888 deletions.
2 changes: 0 additions & 2 deletions admin/code/LeftAndMain.php
Expand Up @@ -202,8 +202,6 @@ function init() {


Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-ui/jquery-ui.js'); //import all of jquery ui Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-ui/jquery-ui.js'); //import all of jquery ui


Requirements::javascript(SAPPHIRE_ADMIN_DIR . '/thirdparty/jquery-layout/jquery.layout.js');
Requirements::javascript(SAPPHIRE_ADMIN_DIR . '/thirdparty/jquery-layout/jquery.layout.state.js');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/json-js/json2.js'); Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/json-js/json2.js');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-metadata/jquery.metadata.js'); Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-metadata/jquery.metadata.js');
Requirements::javascript(SAPPHIRE_ADMIN_DIR . '/javascript/jquery-fitheighttoparent/jquery.fitheighttoparent.js'); Requirements::javascript(SAPPHIRE_ADMIN_DIR . '/javascript/jquery-fitheighttoparent/jquery.fitheighttoparent.js');
Expand Down
8 changes: 0 additions & 8 deletions admin/css/cms_right.css
Expand Up @@ -555,14 +555,6 @@
margin-left: 0; margin-left: 0;
} }


/**
* jQuery UI Datepicker - necessary because of custom
* z-indexing performed in jQuery.layout
*/
#ui-datepicker-div {
z-index: 1002;
}

/** /**
* Upload Image (Image Toolbar) * Upload Image (Image Toolbar)
*/ */
Expand Down
11 changes: 0 additions & 11 deletions admin/css/layout.css
Expand Up @@ -5,15 +5,6 @@
font-family: Arial, Helvetica, sans-serif; font-family: Arial, Helvetica, sans-serif;
} }


html {
overflow: hidden;
}

body {
background: #ccdef3;
height: 100%;
}

.ss-loading-screen, .ss-loading-screen .loading-logo { .ss-loading-screen, .ss-loading-screen .loading-logo {
width: 100%; width: 100%;
height: 100%; height: 100%;
Expand Down Expand Up @@ -85,8 +76,6 @@ body {
*/ */
.ui-layout-pane { /* all 'panes' */ .ui-layout-pane { /* all 'panes' */
background: #FFF; background: #FFF;
/*border: 1px solid #BBB;*/
overflow: auto;
} }


/* Overflow is handled by tabsets inside the panel */ /* Overflow is handled by tabsets inside the panel */
Expand Down
95 changes: 0 additions & 95 deletions admin/javascript/LeftAndMain.js
Expand Up @@ -2,12 +2,6 @@
* File: LeftAndMain.js * File: LeftAndMain.js
*/ */


/**
* Variable: ss_MainLayout
* jquery.layout Global variable so layout state management can pick it up.
*/
var ss_MainLayout;

(function($) { (function($) {
$.entwine('ss', function($){ $.entwine('ss', function($){
/** /**
Expand Down Expand Up @@ -44,11 +38,6 @@ var ss_MainLayout;
* loadnewpage - ... * loadnewpage - ...
*/ */
$('.LeftAndMain').entwine({ $('.LeftAndMain').entwine({
/**
* Variable: MainLayout
* (Object) Reference to jQuery.layout element
*/
MainLayout: null,


/** /**
* Variable: PingIntervalSeconds * Variable: PingIntervalSeconds
Expand All @@ -67,25 +56,8 @@ var ss_MainLayout;
$('body').removeClass('stillLoading'); $('body').removeClass('stillLoading');
$(window).unbind('resize', positionLoadingSpinner); $(window).unbind('resize', positionLoadingSpinner);


// Layout
ss_MainLayout = this._setupLayout();
this.setMainLayout(ss_MainLayout);
layoutState.options.keys = "west.size,west.isClosed";
$(window).unload(function(){ layoutState.save('ss_MainLayout');});

this._setupPinging(); this._setupPinging();


// HACK Delay resizing to give jquery-ui tabs a change their dimensions
// through dynamically added css classes
$(window).resize(function () {
var timerID = "timerLeftAndMainResize";
if (window[timerID]) clearTimeout(window[timerID]);
window[timerID] = setTimeout(function() {
self._resizeChildren();
}, 200);
});
$(window).resize();

// If tab has no nested tabs, set overflow to auto // If tab has no nested tabs, set overflow to auto
$(this).find('.tab').not(':has(.tab)').css('overflow', 'auto'); $(this).find('.tab').not(':has(.tab)').css('overflow', 'auto');


Expand All @@ -103,73 +75,6 @@ var ss_MainLayout;
this._super(); this._super();
}, },


/**
* Function: _setupLayout
*
* Initialize jQuery layout manager with the following panes:
* - east: Tree, Page Version History, Site Reports
* - center: Form
* - west: "Insert Image", "Insert Link", "Insert Flash" panes
* - north: CMS area menu bar
* - south: "Page view", "profile" and "logout" links
*/
_setupLayout: function() {
var self = this;

var widthEast = this.find('.ui-layout-east').width();
var widthWest = this.find('.ui-layout-west').width();

// layout containing the tree, CMS menu, the main form etc.
var savedLayoutSettings = layoutState.load('ss_MainLayout');

var layoutSettings = jQuery.extend({
defaults: {
// TODO Reactivate once we have localized values
togglerTip_open: '',
togglerTip_closed: '',
resizerTip: '',
sliderTip: '',
onresize: function() {self._resizeChildren();},
onopen: function() {self._resizeChildren();}
},
north: {
slidable: false,
resizable: false,
size: this.find('.ui-layout-north').height(),
togglerLength_open: 0
},
south: {
slidable: false,
resizable: false,
size: this.find('.ui-layout-south').height(),
togglerLength_open: 0
},
west: {
size: (widthWest) ? widthWest : undefined,
fxName: "none"
},
east: {
initClosed: true,
// multiple panels which are triggered through tinymce buttons,
// so a user shouldn't be able to toggle this panel manually
initHidden: true,
spacing_closed: 0,
fxName: "none"
},
center: {}
}, savedLayoutSettings);
var layout = $('body').layout(layoutSettings);

// Adjust tree accordion etc. in left panel to work correctly
// with jQuery.layout (see http://layout.jquery-dev.net/tips.html#Widget_Accordion)
this.find("#treepanes").accordion({
fillSpace: true,
animated: false
});

return layout;
},

/** /**
* Function: _setupPinging * Function: _setupPinging
* *
Expand Down
2 changes: 1 addition & 1 deletion admin/templates/Includes/ModelAdmin_left.ss
@@ -1,4 +1,4 @@
<div id="SearchForm_holder" class="leftbottom ss-tabset ui-layout-content"> <div id="SearchForm_holder" class="leftbottom ss-tabset">
<% if SearchClassSelector = tabs %> <% if SearchClassSelector = tabs %>
<ul> <ul>
<% control ModelForms %> <% control ModelForms %>
Expand Down
10 changes: 5 additions & 5 deletions admin/templates/LeftAndMain.ss
Expand Up @@ -15,27 +15,27 @@
</div> </div>
</div> </div>


<div class="ui-layout-north ss-cms-top-menu"> <div class="main-menu">
$CMSTopMenu $CMSTopMenu
</div> </div>


<div class="ui-layout-west"> <div>
$Left $Left
</div> </div>


<div class="ui-layout-center right" id="right"> <div class="right" id="right">
$Right $Right
</div> </div>


<div class="ui-layout-east" id="contentPanel"> <div id="contentPanel">
<% control EditorToolbar %> <% control EditorToolbar %>
$ImageForm $ImageForm
$LinkForm $LinkForm
$FlashForm $FlashForm
<% end_control %> <% end_control %>
</div> </div>


<div class="ui-layout-south ss-cms-bottom-bar"> <div class="ss-cms-bottom-bar">
<div class="holder"> <div class="holder">
<div id="logInStatus"> <div id="logInStatus">
<a href="$ApplicationLink" title="<% _t('SSWEB','Silverstripe Website') %>">$ApplicationName</a> <a href="$ApplicationLink" title="<% _t('SSWEB','Silverstripe Website') %>">$ApplicationName</a>
Expand Down
1 change: 0 additions & 1 deletion admin/thirdparty/jquery-layout/README.txt

This file was deleted.

60 changes: 0 additions & 60 deletions admin/thirdparty/jquery-layout/changelog.txt

This file was deleted.

23 changes: 0 additions & 23 deletions admin/thirdparty/jquery-layout/example.html

This file was deleted.

0 comments on commit 11a3b86

Please sign in to comment.