Removed media files in admin_tools/media
|
@ -1,32 +0,0 @@
|
|||
/* todo: ie6 doesn't want the dashboard to take full width... */
|
||||
|
||||
html, body {
|
||||
_overflow: auto;
|
||||
_width: 100%;
|
||||
}
|
||||
|
||||
#content {
|
||||
*width: 98% !important;
|
||||
_width: 96% !important;
|
||||
margin: 1%;
|
||||
}
|
||||
|
||||
#container {
|
||||
_margin: 0;
|
||||
}
|
||||
|
||||
.dashboard-module h2 a.toggle-icon,
|
||||
.dashboard-module h2 a.close-icon {
|
||||
margin-top: -16px;
|
||||
}
|
||||
|
||||
.dashboard-module ul li ul {
|
||||
margin-top: -25px;
|
||||
}
|
||||
|
||||
.dashboard-module h3 {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.dashboard-column {
|
||||
}
|
|
@ -1,294 +0,0 @@
|
|||
/* Utilities {{{ */
|
||||
|
||||
.float-right {
|
||||
float: right;
|
||||
}
|
||||
|
||||
/* }}} */
|
||||
/* Dashboard general styles {{{ */
|
||||
|
||||
.warning {
|
||||
color: red;
|
||||
background: transparent url(../images/admin-tools.png) 0 -412px no-repeat;
|
||||
padding-left: 25px;
|
||||
}
|
||||
|
||||
.dashboard #content {
|
||||
display: block;
|
||||
width: auto; !important;
|
||||
}
|
||||
|
||||
.dashboard-container {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
h1.dashboard-title {
|
||||
float: left;
|
||||
}
|
||||
|
||||
#dashboard-panel {
|
||||
margin: 0 10px 0 0;
|
||||
float: right;
|
||||
}
|
||||
|
||||
#dashboard-panel h3 a {
|
||||
padding: 5px;
|
||||
min-width: 100px;
|
||||
display: block;
|
||||
text-align: center;
|
||||
border: 1px solid #e5e5e5;
|
||||
-moz-border-radius: 6px;
|
||||
-webkit-border-radius: 6px;
|
||||
}
|
||||
|
||||
#dashboard-panel ul {
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: auto;
|
||||
right: 25px;
|
||||
margin-top: -1px;
|
||||
}
|
||||
|
||||
#dashboard-panel ul li {
|
||||
padding: 5px;
|
||||
border: 1px solid #e5e5e5;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
#dashboard-panel ul li a {
|
||||
display: block;
|
||||
}
|
||||
|
||||
#dashboard-panel:hover ul {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.dashboard ul {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.dashboard ul li {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.dashboard-column {
|
||||
width: 49.9%;
|
||||
float: left;
|
||||
min-height: 200px;
|
||||
}
|
||||
|
||||
.dashboard-module {
|
||||
margin: 10px 10px 5px 10px;
|
||||
padding: 1px;
|
||||
border: 1px solid #e5e5e5;
|
||||
-moz-border-radius: 6px;
|
||||
-webkit-border-radius: 6px;
|
||||
}
|
||||
|
||||
.dashboard-placeholder {
|
||||
border: 2px dashed #cbe0ff;
|
||||
background-color: #fafafa;
|
||||
margin: 10px 10px 5px 10px;
|
||||
}
|
||||
|
||||
.dashboard-module h2 {
|
||||
margin: 0;
|
||||
padding: 7px 5px 8px 8px;
|
||||
text-align: left;
|
||||
font-weight: normal;
|
||||
background: url(../images/admin-tools.png) repeat-x 0 -245px;
|
||||
height: 20px;
|
||||
color: #555;
|
||||
}
|
||||
|
||||
.dashboard-module.draggable h2 {
|
||||
cursor: move;
|
||||
}
|
||||
|
||||
.dashboard-module h2 a.toggle-icon,
|
||||
.dashboard-module h2 a.close-icon {
|
||||
text-indent: -9999px;
|
||||
display: block;
|
||||
float: right;
|
||||
height: 20px;
|
||||
width: 17px;
|
||||
margin: 0 0 0 5px;
|
||||
cursor: pointer;
|
||||
background-image: url(../images/admin-tools.png);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.dashboard-module h2 a.toggle-icon {
|
||||
background-position: 0 -45px;
|
||||
}
|
||||
|
||||
.dashboard-module h2 a.toggle-icon:hover {
|
||||
background-position: 0 -65px;
|
||||
}
|
||||
|
||||
.dashboard-module h2 a.toggle-icon.collapsed {
|
||||
background-position: 0 -85px;
|
||||
}
|
||||
|
||||
.dashboard-module h2 a.toggle-icon.collapsed:hover {
|
||||
background-position: 0 -105px;
|
||||
}
|
||||
|
||||
.dashboard-module h2 a.close-icon {
|
||||
background-position: 0 -125px;
|
||||
}
|
||||
|
||||
.dashboard-module h2 a.close-icon:hover {
|
||||
background-position: 0 -145px;
|
||||
}
|
||||
|
||||
.fixed h2 span.toggle-icon,
|
||||
.fixed h2 span.close-icon {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.dashboard-module h3 {
|
||||
padding: 5px 10px;
|
||||
margin: 0;
|
||||
background: transparent url(../images/admin-tools.png) repeat-x 0 -325px;
|
||||
text-indent: 12px;
|
||||
height: 22px;
|
||||
}
|
||||
|
||||
.dashboard-module h3 a {
|
||||
color: #808080;
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.dashboard-module-content {
|
||||
border-top: 1px solid #ececec;
|
||||
}
|
||||
|
||||
.dashboard-module-content a {
|
||||
color: #5B80B2;
|
||||
}
|
||||
|
||||
.dashboard-module-content p {
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
.dashboard-module ul li {
|
||||
vertical-align: top;
|
||||
padding: 5px 8px;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
.dashboard-module ul li.odd {
|
||||
background: #f5f5f5;
|
||||
}
|
||||
|
||||
.dashboard-module ul li.even {
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.dashboard-module ul li a.external-link {
|
||||
background-image: url(../images/admin-tools.png);
|
||||
background-repeat: no-repeat;
|
||||
background-position: -5px -168px;
|
||||
padding-left: 15px;
|
||||
}
|
||||
|
||||
.dashboard-module ul li ul {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.dashboard-module ul li ul li {
|
||||
display: block;
|
||||
float: left;
|
||||
border: 0;
|
||||
padding: 0 5px;
|
||||
vertical-align: top;
|
||||
height: auto;
|
||||
line-height: auto;
|
||||
}
|
||||
|
||||
.dashboard-module ul li:hover {
|
||||
background: #fffff4;
|
||||
}
|
||||
|
||||
/* }}} */
|
||||
/* link list specific styles {{{ */
|
||||
|
||||
|
||||
.dashboard-module ul.inline {
|
||||
display: block;
|
||||
height: auto;
|
||||
padding: 15px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.dashboard-module ul.inline li {
|
||||
display: inline;
|
||||
margin: 10px auto;
|
||||
}
|
||||
|
||||
.dashboard-module ul.inline li.odd,
|
||||
.dashboard-module ul.inline li.even {
|
||||
background: none;
|
||||
}
|
||||
|
||||
/* }}} */
|
||||
/* Dashboard groups {{{ */
|
||||
|
||||
.group {
|
||||
border: 0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.group ul {
|
||||
background: none;
|
||||
background-color: #fafafa;
|
||||
border-width: 0 0 1px 0;
|
||||
border-color: #d3d3d3;
|
||||
-moz-border-radius: 0;
|
||||
-webkit-border-radius: 0;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.group ul li.group-tabs-link {
|
||||
margin-top: 7px;
|
||||
}
|
||||
|
||||
.group ul li.group-tabs-link a:focus,
|
||||
.group ul li.group-tabs-link a:active {
|
||||
border: none;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.group .dashboard-module {
|
||||
padding: 5px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.group-accordion .group-accordion-header {
|
||||
display: block;
|
||||
clear: both;
|
||||
border: none;
|
||||
-moz-border-radius: 0;
|
||||
-webkit-border-radius: 0;
|
||||
border-radius: 0;
|
||||
border-bottom: 1px solid #d3d3d3;
|
||||
margin: 0;
|
||||
background: none;
|
||||
background-color: #f6f6f6;
|
||||
}
|
||||
|
||||
.group-accordion .group-accordion-header.ui-state-default {
|
||||
background-color: #f0f0f0;
|
||||
}
|
||||
|
||||
.group-accordion .dashboard-module {
|
||||
border: 0;
|
||||
}
|
||||
|
||||
|
||||
/* }}} */
|
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 212 B |
Before Width: | Height: | Size: 208 B |
Before Width: | Height: | Size: 335 B |
Before Width: | Height: | Size: 207 B |
Before Width: | Height: | Size: 262 B |
Before Width: | Height: | Size: 262 B |
Before Width: | Height: | Size: 332 B |
Before Width: | Height: | Size: 280 B |
Before Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 4.4 KiB |
|
@ -1,20 +0,0 @@
|
|||
#header #navigation-menu li {
|
||||
height: 35px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#header #navigation-menu li a {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
#header #navigation-menu li span {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#header #navigation-menu li ul li {
|
||||
_width: 220px;
|
||||
}
|
||||
|
||||
#header #navigation-menu li ul li a {
|
||||
height: 20px;
|
||||
}
|
|
@ -1,158 +0,0 @@
|
|||
/* menu styles */
|
||||
|
||||
#header {
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
#header #branding h1 {
|
||||
margin: 0;
|
||||
padding: 5px 10px;
|
||||
height: 31px;
|
||||
}
|
||||
|
||||
#header ul {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
z-index: 9999;
|
||||
}
|
||||
|
||||
#header ul li {
|
||||
position: relative;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
#header ul li a {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
#header #navigation-menu {
|
||||
height: 35px;
|
||||
z-index: 9999;
|
||||
background: transparent url(../images/admin-tools.png) repeat-x 0 -205px;
|
||||
}
|
||||
|
||||
#header #bookmark-button {
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
top: auto;
|
||||
right: 15px;
|
||||
height: 25px;
|
||||
width: 24px;
|
||||
margin-top: 4px;
|
||||
border: none;
|
||||
text-indent: -5000px;
|
||||
overflow: hidden;
|
||||
background: transparent url(../images/admin-tools.png) no-repeat 0 -425px;
|
||||
}
|
||||
|
||||
#header #bookmark-button.bookmarked {
|
||||
background-position: 0 -445px;
|
||||
}
|
||||
|
||||
#header ul#navigation-menu li {
|
||||
float: left;
|
||||
}
|
||||
|
||||
#header ul#navigation-menu li a {
|
||||
display: block;
|
||||
text-transform: uppercase;
|
||||
text-decoration: none;
|
||||
padding: 9px 15px;
|
||||
border-right: 1px solid #ededed;
|
||||
color: #555;
|
||||
}
|
||||
|
||||
#header ul#navigation-menu li.disabled a {
|
||||
color: #bbb;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
#header ul#navigation-menu li.first a {
|
||||
margin: 5px 0 0 12px;
|
||||
padding-top: 4px;
|
||||
text-indent: 14px;
|
||||
background: transparent url(../images/admin-tools.png) no-repeat 0 -385px;
|
||||
}
|
||||
|
||||
#header ul#navigation-menu li span {
|
||||
float: right;
|
||||
height: 10px;
|
||||
width: 20px;
|
||||
background: transparent url(../images/admin-tools.png) no-repeat 0 -360px;
|
||||
}
|
||||
|
||||
#header ul#navigation-menu li:hover,
|
||||
#header ul#navigation-menu li.over,
|
||||
#header ul#navigation-menu li.selected {
|
||||
background: url(../images/admin-tools.png) repeat-x 0 -245px;
|
||||
}
|
||||
|
||||
#header ul#navigation-menu li ul {
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: auto;
|
||||
left: auto;
|
||||
margin-left: -1px;
|
||||
margin-top: -1px;
|
||||
}
|
||||
|
||||
#header ul#navigation-menu li ul li {
|
||||
padding: 0;
|
||||
float: none;
|
||||
background: none;
|
||||
z-index: 9999;
|
||||
}
|
||||
|
||||
#header ul#navigation-menu li ul li a {
|
||||
display: block;
|
||||
border: 1px solid #ededed;
|
||||
border-width: 0 1px 1px 1px;
|
||||
text-transform: none;
|
||||
min-width: 180px;
|
||||
}
|
||||
|
||||
#header ul#navigation-menu li ul li span {
|
||||
background-position: 0 -370px;
|
||||
}
|
||||
|
||||
#header ul#navigation-menu li ul li ul {
|
||||
left: 100%;
|
||||
top: 0;
|
||||
border-top: 1px solid #ededed;
|
||||
}
|
||||
|
||||
#header ul#navigation-menu li ul li ul li a {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
#header ul#navigation-menu li:hover ul li ul,
|
||||
#header ul#navigation-menu li.over ul li ul {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#header ul#navigation-menu li:hover>ul,
|
||||
#header ul#navigation-menu li.over>ul,
|
||||
#header ul#navigation-menu li ul li:hover>ul,
|
||||
#header ul#navigation-menu li ul li.over>ul {
|
||||
display: block;
|
||||
}
|
||||
|
||||
#header ul#navigation-menu li:hover>ul li,
|
||||
#header ul#navigation-menu li.over>ul li,
|
||||
#header ul#navigation-menu li ul li:hover>ul li,
|
||||
#header ul#navigation-menu li ul li.over>ul li {
|
||||
background: transparent url(../images/admin-tools.png) repeat-x 0 -285px;
|
||||
}
|
||||
|
||||
#header ul#navigation-menu li ul li:hover,
|
||||
#header ul#navigation-menu li ul li.over,
|
||||
#header ul#navigation-menu li ul li ul li:hover,
|
||||
#header ul#navigation-menu li ul li ul li.over {
|
||||
background: transparent url(../images/admin-tools.png) repeat-x 0 -245px;
|
||||
}
|
||||
|
||||
#header ul#navigation-menu li.disabled a:hover,
|
||||
#header ul#navigation-menu li.disabled a.over {
|
||||
background: none;
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
/**
|
||||
* theming styles
|
||||
*
|
||||
*/
|
||||
|
||||
#header {
|
||||
background: url(../images/admin-tools.png) 0 0 repeat-x;
|
||||
}
|
||||
|
||||
#header #branding h1 {
|
||||
margin: 0;
|
||||
padding: 5px 10px;
|
||||
text-indent: -9999px;
|
||||
background: transparent url(../images/django.png) 10px 5px no-repeat;
|
||||
height: 31px;
|
||||
width: 93px;
|
||||
}
|
||||
|
||||
div.breadcrumbs {
|
||||
display: block;
|
||||
padding: 10px 15px;
|
||||
border: 0;
|
||||
background-position: 0 -8px;
|
||||
border-bottom: 1px solid #ededed;
|
||||
}
|
||||
|
||||
div.breadcrumbs a {
|
||||
display: inline;
|
||||
}
|
Before Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 2.9 KiB |
|
@ -1,13 +0,0 @@
|
|||
var init_dashboard = function(id, columns, preferences, url) {
|
||||
jQuery('#'+id).dashboard({
|
||||
'columns': columns,
|
||||
'load_preferences_function': function(options) {
|
||||
return preferences;
|
||||
},
|
||||
'save_preferences_function': function(options, preferences) {
|
||||
jQuery.post(url, { data: JSON.stringify(preferences) });
|
||||
}
|
||||
});
|
||||
jQuery(".group-tabs").tabs();
|
||||
jQuery(".group-accordion").accordion({header: '.group-accordion-header'});
|
||||
};
|
|
@ -1,7 +0,0 @@
|
|||
// Copyright (c) 2006 Klaus Hartl (stilbuero.de)
|
||||
|
||||
jQuery.cookie=function(name,value,options){if(typeof value!='undefined'){options=options||{};if(value===null){value='';options.expires=-1;}
|
||||
var expires='';if(options.expires&&(typeof options.expires=='number'||options.expires.toUTCString)){var date;if(typeof options.expires=='number'){date=new Date();date.setTime(date.getTime()+(options.expires*24*60*60*1000));}else{date=options.expires;}
|
||||
expires='; expires='+date.toUTCString();}
|
||||
var path=options.path?'; path='+(options.path):'';var domain=options.domain?'; domain='+(options.domain):'';var secure=options.secure?'; secure':'';document.cookie=[name,'=',encodeURIComponent(value),expires,path,domain,secure].join('');}else{var cookieValue=null;if(document.cookie&&document.cookie!=''){var cookies=document.cookie.split(';');for(var i=0;i<cookies.length;i++){var cookie=jQuery.trim(cookies[i]);if(cookie.substring(0,name.length+1)==(name+'=')){cookieValue=decodeURIComponent(cookie.substring(name.length+1));break;}}}
|
||||
return cookieValue;}};
|
|
@ -1,340 +0,0 @@
|
|||
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
|
||||
|
||||
/**
|
||||
* Dashboard plugin.
|
||||
* This plugin is not yet released, but should be when it will be finished.
|
||||
*
|
||||
* copyright (c) 2010 David Jean Louis <izimobil@gmail.com>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
|
||||
$.fn.extend({
|
||||
//pass the options variable to the function
|
||||
dashboard: function(options) {
|
||||
//Set the default values, use comma to separate the settings, example:
|
||||
var defaults = {
|
||||
panel_id: 'dashboard-panel',
|
||||
dashboard_id: this.attr('id'),
|
||||
dashboard_module_class: 'dashboard-module',
|
||||
columns: 2,
|
||||
load_preferences_function: false,
|
||||
save_preferences_function: false
|
||||
}
|
||||
var options = $.extend(defaults, options);
|
||||
|
||||
return this.each(function() {
|
||||
// set ids for dashboard modules
|
||||
_initialize($(this), options);
|
||||
// restore positions, must be done *before* columnize
|
||||
_restore_positions($(this), options);
|
||||
// columnize the dashboard modules
|
||||
_columnize($(this), options);
|
||||
// add draggable behaviour
|
||||
_set_draggable($(this), options);
|
||||
// add collapsible behaviour
|
||||
_set_collapsible($(this), options);
|
||||
// add deletable behaviour
|
||||
_set_deletable($(this), options);
|
||||
// add addable behaviour to dashboard panel items
|
||||
_set_addable($(this), options);
|
||||
// restore user preferences
|
||||
_restore_preferences($(this), options);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
var preferences = false;
|
||||
|
||||
var _initialize = function(elt, options) {
|
||||
// load preferences
|
||||
if (preferences === false) {
|
||||
if (options.load_preferences_function) {
|
||||
preferences = options.load_preferences_function(options);
|
||||
} else {
|
||||
var json_str = $.cookie('admin-tools.' + options.dashboard_id);
|
||||
preferences = json_str ? JSON.parse(json_str) : {};
|
||||
}
|
||||
}
|
||||
// set ids if not set
|
||||
elt.children('div[id!=' + options.panel_id +']').each(function(index) {
|
||||
if (!$(this).attr('id')) {
|
||||
$(this).attr('id', 'module_' + index);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var _restore_positions = function(elt, options) {
|
||||
// restore positions
|
||||
try {
|
||||
var saved_positions = _get_preference(options, 'positions');
|
||||
} catch (e) {
|
||||
return;
|
||||
}
|
||||
var current_positions = _get_positions(elt, options);
|
||||
var new_positions = [];
|
||||
|
||||
for(var v = 0; v < current_positions.length; v++) {
|
||||
new_positions[current_positions[v]] = current_positions[v];
|
||||
}
|
||||
|
||||
for(var i = 0; i < saved_positions.length; i++) {
|
||||
// item id from saved order
|
||||
var id = saved_positions[i];
|
||||
if (id in new_positions) {
|
||||
var item = new_positions[id];
|
||||
var child = elt.children('#'+item);
|
||||
// select the item according to the saved order
|
||||
var saved = elt.children('#'+item);
|
||||
child.remove();
|
||||
elt.append(saved);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var _columnize = function(elt, options) {
|
||||
var elts = elt.children('div[id!=' + options.panel_id +']');
|
||||
var size = Math.ceil(elts.length / options.columns);
|
||||
var sizes = _get_preference(options, 'columns');
|
||||
var percent = Math.floor(100 / options.columns);
|
||||
var start = 0;
|
||||
var stop = 0;
|
||||
var last_stop = 0;
|
||||
// don't break layout if columns count or elts count changed
|
||||
var elts_count = 0;
|
||||
for (var i in sizes) {
|
||||
elts_count += sizes[i];
|
||||
}
|
||||
if (options.columns != sizes.length || elts_count != elts.length) {
|
||||
// reset sizes so we don't break
|
||||
sizes = [];
|
||||
}
|
||||
for (var i = 0; i < options.columns; i++) {
|
||||
if (typeof(sizes[i]) == 'undefined') {
|
||||
start = i * size;
|
||||
stop = start + size;
|
||||
last_stop = stop;
|
||||
} else if (sizes[i] == 0) {
|
||||
var empty_col = '<div class="dashboard-column" style="float:left;width:'+percent+'%;"/>';
|
||||
if ($('.dashboard-column').last().length) {
|
||||
$('.dashboard-column').last().after(empty_col);
|
||||
} else {
|
||||
elt.prepend(empty_col);
|
||||
}
|
||||
continue;
|
||||
} else {
|
||||
start = (i == 0) ? 0 : start + last_stop;
|
||||
stop = start + sizes[i];
|
||||
last_stop = sizes[i];
|
||||
}
|
||||
elts.slice(start, stop).wrapAll(
|
||||
'<div class="dashboard-column" style="float:left;width:'+percent+'%;"/>'
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
var _restore_preferences = function(elt, options) {
|
||||
elt.children().children('.disabled').each(function() {
|
||||
_delete_element($(this), options);
|
||||
});
|
||||
if (_get_preference(options, 'disabled')) {
|
||||
$.each(_get_preference(options, 'disabled'), function(k, v) {
|
||||
v ? _delete_element($('#'+k), options) : _add_element($('#'+k), options);
|
||||
});
|
||||
}
|
||||
if (_get_preference(options, 'collapsed')) {
|
||||
$.each(_get_preference(options, 'collapsed'), function(k, v) {
|
||||
if (v) {
|
||||
_toggle_element($('#'+k), options);
|
||||
}
|
||||
});
|
||||
}
|
||||
// if there's no element in the panel, hide it
|
||||
if (!$('#' + options.panel_id).find('li').length) {
|
||||
$('#' + options.panel_id).hide();
|
||||
}
|
||||
};
|
||||
|
||||
var _set_draggable = function(elt, options) {
|
||||
// the dashboard column
|
||||
elt.children('.dashboard-column').sortable({
|
||||
handle: 'h2',
|
||||
items: '.draggable',
|
||||
connectWith: '.dashboard-column',
|
||||
placeholder: 'dashboard-placeholder',
|
||||
forcePlaceholderSize: true,
|
||||
cursor: 'crosshair',
|
||||
opacity: 0.7,
|
||||
update: function() {
|
||||
_set_preference(options, 'positions', false, _get_positions(elt, options));
|
||||
var columns = [];
|
||||
elt.children('.dashboard-column').each(function() {
|
||||
columns.push($(this).children().length);
|
||||
});
|
||||
_set_preference(options, 'columns', false, columns, true);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var _set_collapsible = function(elt, options) {
|
||||
elt.find('> .dashboard-column > .collapsible > h2').each(function() {
|
||||
$(this).append('<a href="#" class="toggle-icon">Toggle</a>').find('a.toggle-icon').click(function() {
|
||||
var prnt = $(this).parent().parent();
|
||||
_toggle_element(prnt, options, true);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
var _toggle_element = function(elt, options, save_preference) {
|
||||
elt.find('h2 a.toggle-icon').toggleClass('collapsed');
|
||||
elt.children('div').slideToggle();
|
||||
if (save_preference) {
|
||||
_set_preference(options, 'collapsed', elt.attr('id'), elt.find('h2 a.toggle-icon').hasClass('collapsed'), true);
|
||||
}
|
||||
};
|
||||
|
||||
var _set_deletable = function(elt, options) {
|
||||
elt.find('> .dashboard-column > .deletable > h2').each(function() {
|
||||
$(this).append('<a href="#" class="close-icon">Close</a>').find('a.close-icon').click(function() {
|
||||
var prnt = $(this).parent().parent();
|
||||
_delete_element(prnt, options, true);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
var _delete_element = function(elt, options, save_preference) {
|
||||
var existing = $('#'+options.panel_id).find('li a[rel='+elt.attr('id')+']');
|
||||
if (!existing.length) {
|
||||
var panel_ul = $('#' + options.panel_id).find('ul');
|
||||
if (!panel_ul.length) {
|
||||
$('#' + options.panel_id).append('<ul/>');
|
||||
panel_ul = $('#' + options.panel_id).find('ul');
|
||||
}
|
||||
panel_ul.append(
|
||||
'<li><a href="#" rel="'
|
||||
+ elt.attr('id')
|
||||
+ '" class="addlink dashboard-module-add">'
|
||||
+ elt.find('h2').contents().first().text()
|
||||
+ '</a></li>'
|
||||
);
|
||||
_set_addable(elt, options, $('#'+options.panel_id).find('li a[rel='+elt.attr('id')+']'));
|
||||
} else {
|
||||
existing.parent().show();
|
||||
}
|
||||
elt.fadeOut('fast');
|
||||
$('#' + options.panel_id).show();
|
||||
if (save_preference) {
|
||||
_set_preference(options, 'disabled', elt.attr('id'), true, true);
|
||||
}
|
||||
};
|
||||
|
||||
var _set_addable = function(elt, options, elts) {
|
||||
if (!elts) {
|
||||
elts = $('#'+options.panel_id).find('li a');
|
||||
}
|
||||
elts.click(function() {
|
||||
_add_element($('#'+$(this).attr('rel')), options, true);
|
||||
});
|
||||
};
|
||||
|
||||
var _add_element = function(elt, options, save_preference) {
|
||||
var panel_elt = $('#'+options.panel_id).find('li a[rel='+elt.attr('id')+']');
|
||||
panel_elt.parent().remove();
|
||||
elt.removeClass('disabled');
|
||||
elt.fadeIn('fast');
|
||||
if (save_preference) {
|
||||
_set_preference(options, 'disabled', elt.attr('id'), false, true);
|
||||
}
|
||||
// if there's no element in the panel, hide it
|
||||
if (!$('#' + options.panel_id).find('li').length) {
|
||||
$('#' + options.panel_id).hide();
|
||||
}
|
||||
};
|
||||
|
||||
var load_preferences = function(options) {
|
||||
if (options.load_preferences_function) {
|
||||
return options.load_preferences_function(options);
|
||||
}
|
||||
if (preferences === false) {
|
||||
var json_str = $.cookie('admin-tools.' + options.dashboard_id);
|
||||
preferences = json_str ? JSON.parse(json_str) : {};
|
||||
}
|
||||
return preferences;
|
||||
}
|
||||
|
||||
var _get_preference = function(options, cat, id, defaultval) {
|
||||
try {
|
||||
if (preferences[cat] == undefined) {
|
||||
preferences[cat] = {};
|
||||
}
|
||||
if (id) {
|
||||
return preferences[cat][id];
|
||||
}
|
||||
return preferences[cat];
|
||||
} catch (e) {
|
||||
return defaultval ? defaultval : null;
|
||||
}
|
||||
};
|
||||
|
||||
// quick hack to ensure that we do not save preferences if they are
|
||||
// not modified...
|
||||
var last_saved_preferences = null;
|
||||
|
||||
var _set_preference = function(options, cat, id, val, save) {
|
||||
try {
|
||||
if (preferences[cat] == undefined) {
|
||||
preferences[cat] = {};
|
||||
}
|
||||
if (id) {
|
||||
preferences[cat][id] = val;
|
||||
} else {
|
||||
preferences[cat] = val;
|
||||
}
|
||||
} catch (e) {
|
||||
}
|
||||
// save preferences
|
||||
if (save && JSON.stringify(preferences) != last_saved_preferences) {
|
||||
if (options.save_preferences_function) {
|
||||
options.save_preferences_function(options, preferences);
|
||||
} else {
|
||||
$.cookie(cookie_name, JSON.stringify(preferences), {expires: 1825});
|
||||
}
|
||||
last_saved_preferences = JSON.stringify(preferences);
|
||||
}
|
||||
};
|
||||
|
||||
var _get_positions = function(elt, options) {
|
||||
var modules = [];
|
||||
if (!elt.children('.dashboard-column').length) {
|
||||
elt.children('div[id!=' + options.panel_id +']').each(function() {
|
||||
modules.push($(this).attr('id'));
|
||||
});
|
||||
} else {
|
||||
elt.children('.dashboard-column').each(function() {
|
||||
$.each($(this).sortable('toArray'), function(index, item) {
|
||||
modules.push(item);
|
||||
});
|
||||
});
|
||||
}
|
||||
return modules;
|
||||
}
|
||||
|
||||
})(jQuery);
|
|
@ -1,29 +0,0 @@
|
|||
|
||||
if(!this.JSON){this.JSON={};}
|
||||
(function(){function f(n){return n<10?'0'+n:n;}
|
||||
if(typeof Date.prototype.toJSON!=='function'){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+'-'+
|
||||
f(this.getUTCMonth()+1)+'-'+
|
||||
f(this.getUTCDate())+'T'+
|
||||
f(this.getUTCHours())+':'+
|
||||
f(this.getUTCMinutes())+':'+
|
||||
f(this.getUTCSeconds())+'Z':null;};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf();};}
|
||||
var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==='string'?c:'\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4);})+'"':'"'+string+'"';}
|
||||
function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==='object'&&typeof value.toJSON==='function'){value=value.toJSON(key);}
|
||||
if(typeof rep==='function'){value=rep.call(holder,key,value);}
|
||||
switch(typeof value){case'string':return quote(value);case'number':return isFinite(value)?String(value):'null';case'boolean':case'null':return String(value);case'object':if(!value){return'null';}
|
||||
gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==='[object Array]'){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||'null';}
|
||||
v=partial.length===0?'[]':gap?'[\n'+gap+
|
||||
partial.join(',\n'+gap)+'\n'+
|
||||
mind+']':'['+partial.join(',')+']';gap=mind;return v;}
|
||||
if(rep&&typeof rep==='object'){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==='string'){v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}}
|
||||
v=partial.length===0?'{}':gap?'{\n'+gap+partial.join(',\n'+gap)+'\n'+
|
||||
mind+'}':'{'+partial.join(',')+'}';gap=mind;return v;}}
|
||||
if(typeof JSON.stringify!=='function'){JSON.stringify=function(value,replacer,space){var i;gap='';indent='';if(typeof space==='number'){for(i=0;i<space;i+=1){indent+=' ';}}else if(typeof space==='string'){indent=space;}
|
||||
rep=replacer;if(replacer&&typeof replacer!=='function'&&(typeof replacer!=='object'||typeof replacer.length!=='number')){throw new Error('JSON.stringify');}
|
||||
return str('',{'':value});};}
|
||||
if(typeof JSON.parse!=='function'){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==='object'){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v;}else{delete value[k];}}}}
|
||||
return reviver.call(holder,key,value);}
|
||||
cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return'\\u'+
|
||||
('0000'+a.charCodeAt(0).toString(16)).slice(-4);});}
|
||||
if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,''))){j=eval('('+text+')');return typeof reviver==='function'?walk({'':j},''):j;}
|
||||
throw new SyntaxError('JSON.parse');};}}());
|
|
@ -1,48 +0,0 @@
|
|||
/**
|
||||
* Save/remove bookmarks to/from the bookmark menu item and the database
|
||||
*
|
||||
* @param string url The current page url path (request.get_full_path)
|
||||
* @param string title The current page title
|
||||
* @param string prompt_msg The message to ask for prompting
|
||||
* @return void
|
||||
*/
|
||||
var process_bookmarks = function(url, title, prompt_msg) {
|
||||
var $ = jQuery;
|
||||
var new_title;
|
||||
$('#bookmark-button').click(function(e) {
|
||||
var submit_url = $("#bookmark-form").attr('action');
|
||||
e.preventDefault();
|
||||
if ($(this).hasClass('bookmarked')) {
|
||||
$(this).removeClass('bookmarked');
|
||||
$('#navigation-menu li.bookmark ul li a[href="' + url + '"]').parent().remove();
|
||||
if (!$('#navigation-menu li.bookmark ul li').length) {
|
||||
$('#navigation-menu li.bookmark ul').remove();
|
||||
$('#navigation-menu li.bookmark a span').remove();
|
||||
$('#navigation-menu li.bookmark').addClass('disabled');
|
||||
}
|
||||
//Drop bookmark and switch form
|
||||
$.post(submit_url, $("#bookmark-form").serialize(), function(data) {
|
||||
$("#bookmark-form").replaceWith(data.replace('**title**', title));
|
||||
}, 'html');
|
||||
} else {
|
||||
new_title = prompt(prompt_msg, title);
|
||||
if (!new_title) {
|
||||
return;
|
||||
}
|
||||
$(this).addClass('bookmarked');
|
||||
if (!$('#navigation-menu li.bookmark ul').length) {
|
||||
$('#navigation-menu li.bookmark a').prepend('<span class="icon"/>');
|
||||
$('#navigation-menu li.bookmark').append('<ul/>');
|
||||
$('#navigation-menu li.bookmark').removeClass('disabled');
|
||||
}
|
||||
$('#navigation-menu li.bookmark ul').append(
|
||||
'<li><a href="' + url + '">' + new_title + '</a></li>'
|
||||
);
|
||||
$('#bookmark-form input[name=title]').attr('value', new_title);
|
||||
// Save bookmark and switch form
|
||||
$.post(submit_url, $("#bookmark-form").serialize(), function(data) {
|
||||
$("#bookmark-form").replaceWith(data);
|
||||
}, 'html');
|
||||
}
|
||||
});
|
||||
};
|
|
@ -1,42 +0,0 @@
|
|||
var loadScripts = function(js_files, onComplete){
|
||||
var len = js_files.length;
|
||||
var head = document.getElementsByTagName('head')[0];
|
||||
|
||||
function loadScript(index){
|
||||
var testOk;
|
||||
|
||||
if (index >= len){
|
||||
onComplete();
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
testOk = js_files[index].test();
|
||||
} catch (e) {
|
||||
// with certain browsers like opera the above test can fail
|
||||
// because of undefined variables...
|
||||
testOk = true;
|
||||
}
|
||||
|
||||
if (testOk) {
|
||||
var s = document.createElement('script');
|
||||
s.src = js_files[index].src;
|
||||
s.type = 'text/javascript';
|
||||
head.appendChild(s);
|
||||
if (/MSIE/.test(navigator.userAgent)) {
|
||||
// Internet Explorer
|
||||
s.onreadystatechange = function () {
|
||||
if (s.readyState == 'loaded' || s.readyState == 'complete') {
|
||||
loadScript(index+1);
|
||||
}
|
||||
};
|
||||
} else {
|
||||
s.onload = function() { loadScript(index+1); };
|
||||
}
|
||||
} else {
|
||||
loadScript(index+1);
|
||||
}
|
||||
}
|
||||
|
||||
loadScript(0);
|
||||
}
|