2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.7 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2017 |
6 +--------------------------------------------------------------------+
7 | This file is a part of CiviCRM. |
9 | CiviCRM is free software; you can copy, modify, and distribute it |
10 | under the terms of the GNU Affero General Public License |
11 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
13 | CiviCRM is distributed in the hope that it will be useful, but |
14 | WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
16 | See the GNU Affero General Public License for more details. |
18 | You should have received a copy of the GNU Affero General Public |
19 | License and the CiviCRM Licensing Exception along |
20 | with this program; if not, contact CiviCRM LLC |
21 | at info[AT]civicrm[DOT]org. If you have questions about the |
22 | GNU Affero General Public License or the licensing of CiviCRM, |
23 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
24 +--------------------------------------------------------------------+
27 <script type="text/javascript">
30 // The set of options we can use to initialize jQuery.dashboard().
33 widgetsByColumn: {/literal}{$contactDashlets|@json_encode}{literal},
35 // These define the urls and data objects used for all of the ajax requests to the server.
38 // jQuery.dashboard() POSTs the widget-to-column settings here.
39 // The 'columns' property of data is reserved for the widget-to-columns settings:
40 // An array (keyed by zero-indexed column ID), of arrays (keyed by widget ID)
41 // of ints; 1 if the widget is minimized. 0 if not.
43 url: {/literal}'{crmURL p='civicrm/ajax/dashboard' h=0 }'{literal},
45 // columns: array(0 => array(widgetId => isMinimized, ...), ...),
46 op: 'save_columns', key: {/literal}"{crmKey name='civicrm/ajax/dashboard'}"{literal}
50 // jQuery.dashboard() GETs a widget's settings object and POST's a users submitted
51 // settings back to the server. The return, in both cases, is an associative
52 // array with the new settings markup and other info:
54 // Required properties:
55 // * markup: HTML string. The inner HTML of the settings form. jQuery.dashboard()
56 // provides the Save and Cancel buttons and wrapping <form> element. Can include
57 // <input>s of any standard type and <select>s, nested in <div>s etc.
59 // Server-side executable script callbacks (See documentation for
60 // ajaxCallbacks.getWidgets):
61 // * initScript: Called when widget settings are initialising.
62 // * script: Called when switching into settings mode. Executed every time
63 // the widget goes into settings-edit mode.
65 // The 'id' property of data is reserved for the widget ID.
66 // The 'settings' property of data is reserved for the user-submitted settings.
67 // An array (keyed by the name="" attributes of <input>s), of <input> values.
69 url: {/literal}'{crmURL p='civicrm/ajax/dashboard' h=0 }'{literal},
72 // settings: array(name => value, ...),
73 op: 'widget_settings', key: {/literal}"{crmKey name='civicrm/ajax/dashboard'}"{literal}
80 var dashboard = $('#civicrm-dashboard')
81 .on('mouseover', '.widget-header', function() {
82 $(this).closest('.widget-wrapper').addClass('db-hover-handle');
84 .on('mouseout', '.widget-header', function() {
85 $(this).closest('.widget-wrapper').removeClass('db-hover-handle');
90 $('.crm-hover-button.show-refresh').click(function(e) {
92 $.each(dashboard.widgets, function(id, widget) {
93 widget.reloadContent();