? .DS_Store
? content-type-js-302054-22.patch
? content-type-js-302054-24.patch
? node-content_type_overview-302120-16.patch
? node-content_type_overview-302120-19.patch
? vertical-tabs-323112-10.patch
? vertical-tabs-323112-8.patch
? vertical-tabs.patch
? modules/book/book.js
? sites/default/files
? sites/default/settings.php
Index: misc/vertical-tabs.css
===================================================================
RCS file: misc/vertical-tabs.css
diff -N misc/vertical-tabs.css
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ misc/vertical-tabs.css 1 Nov 2008 02:46:13 -0000
@@ -0,0 +1,97 @@
+/* $Id */
+
+.vertical-tabs-list .description {
+ display: block;
+}
+
+/* Border style of tabs and content */
+div.vertical-tabs-div,
+ul.vertical-tabs-list {
+ border: 1px solid #ccc;
+}
+
+/* Make space for the tabs on the side */
+.vertical-tabs {
+ margin-left: 180px;
+}
+
+/* Set the background image on the tabs and content */
+.vertical-tabs,
+.vertical-tabs ul.vertical-tabs-list {
+ background: #fff;
+}
+
+/* Position and layout of tabs container */
+.vertical-tabs ul.vertical-tabs-list {
+ width: 179px;
+ float: left;
+ margin: 0 0 0 -180px;
+ border-right: 0px;
+ z-index: 1;
+ border-bottom: 0;
+}
+
+
+/* Reset LIs which probably have awkward layout inherited from tabs */
+.vertical-tabs ul.vertical-tabs-list li {
+ float: none;
+ margin: 0;
+ padding: 0;
+ background-image: none;
+}
+
+/* Layout of each tab */
+.vertical-tabs ul.vertical-tabs-list a {
+ display: block;
+ margin: 0;
+ padding: .4em .3em .1em .6em;
+ background: #fafafa;
+ text-align: left;
+ font-weight: normal;
+ border-bottom: 1px solid #ccc;
+}
+
+.vertical-tabs ul.vertical-tabs-list a.vertical-tabs-nodescription {
+ padding-bottom: .4em;
+}
+
+.vertical-tabs ul.vertical-tabs-list .description {
+ padding: 0;
+ line-height: normal;
+ min-height: 0;
+ white-space: normal;
+}
+
+.vertical-tabs ul.vertical-tabs-list a {
+ border-right: 1px solid #ccc;
+}
+
+/* Hover state of tabs */
+.vertical-tabs ul.vertical-tabs-list a:hover {
+ text-decoration: none;
+ cursor: pointer;
+}
+
+.vertical-tabs ul.vertical-tabs-list a:focus {
+ outline: none;
+}
+
+/* Selected tab */
+.vertical-tabs ul.vertical-tabs-list li.selected a {
+ background: transparent none;
+ color: black;
+ border-right: 0;
+}
+
+/* Reset some important elements of each panel */
+.vertical-tabs .vertical-tabs-div {
+ margin: 0;
+ padding: .5em;
+ margin-top: -1px;
+ margin-left: -1px;
+ background: transparent none;
+}
+
+.buttons {
+ clear: both;
+}
Index: misc/vertical-tabs.js
===================================================================
RCS file: misc/vertical-tabs.js
diff -N misc/vertical-tabs.js
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ misc/vertical-tabs.js 1 Nov 2008 02:46:13 -0000
@@ -0,0 +1,73 @@
+// $Id$
+
+/**
+ * Main vertical tabs behavior - create the vertical tabs.
+ */
+Drupal.behaviors.verticalTabs = function() {
+ // Make sure that the vertical tabs list hasn't already been constructed.
+ if (!$('.vertical-tabs-list').size()) {
+ // Create the first
and the
in it.
+ var ul = $('').find('ul');
+ // Iterate through each vertical tab that needs to be created, and create it.
+ $.each(Drupal.settings.verticalTabs, function(k, v) {
+ var description = '', cssClass = 'vertical-tabs-list-' + k;
+ // If there's a callback, that means there's a description, so add the .
+ // However, we don't actually add the description, because verticalTabsReload already does it for us.
+ // Otherwise add the CSS class denoting there is no description, so we can style it potentially differently.
+ if (v.callback && Drupal.verticalTabs[v.callback]) {
+ description = ' ';
+ }
+ else {
+ cssClass += ' vertical-tabs-nodescription';
+ }
+ // Add the - itself.
+ ul.append($('
- '+ v.name + description +'
')
+ // Add the click action to the link.
+ .find('a')
+ .bind('click', function() {
+ // Add the "selected" class to the clicked tab, and remove it from the other tabs.
+ $(this).parent().addClass('selected').siblings().removeClass('selected');
+ // Show this tab and hide all the other tabs.
+ $('.vertical-tabs-' + k).show().siblings('.vertical-tabs-div').hide();
+ return false;
+ })
+ .end())
+ .end()
+ // Add the fieldset itself.
+ .append($('#' + k + ' > .fieldset-wrapper')
+ .addClass('vertical-tabs-' + k)
+ .addClass('vertical-tabs-div'));
+ $('#' + k).remove();
+ });
+ // Put the in, but before the buttons.
+ ul.end().insertBefore('.buttons');
+ // Calculate the hight of the highest thing.
+ var max = $('.vertical-tabs ul').height();
+ $('.vertical-tabs-div').each(function() {
+ max = Math.max(max, $(this).height());
+ });
+ $('.vertical-tabs-div').height(max).hide();
+ // Show and select the first tab.
+ $('.vertical-tabs-div:first').show();
+ $('.vertical-tabs ul li:first').addClass('selected');
+ }
+}
+
+/**
+ * Reload the vertical tab descriptions.
+ */
+Drupal.behaviors.verticalTabsReload = function() {
+ // Iterate through all the tabs.
+ $.each(Drupal.settings.verticalTabs, function(k, v) {
+ // If there is a callback, then call it and stick the result in .description.
+ if (v.callback && Drupal.verticalTabs[v.callback]) {
+ $('.vertical-tabs ul.vertical-tabs-list a.vertical-tabs-list-'+ k +' span.description').html(Drupal.verticalTabs[v.callback].apply(this, v.args));
+ }
+ });
+ // Recalculate heights.
+ var max = $('.vertical-tabs ul').height();
+ $('.vertical-tabs-div').each(function() {
+ max = Math.max(max, $(this).height());
+ });
+ $('.vertical-tabs-div').height(max);
+}
Index: modules/comment/comment-node-form.js
===================================================================
RCS file: modules/comment/comment-node-form.js
diff -N modules/comment/comment-node-form.js
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ modules/comment/comment-node-form.js 1 Nov 2008 02:46:13 -0000
@@ -0,0 +1,13 @@
+// $Id$
+
+Drupal.verticalTabs.nodeFormComment = function() {
+ var input = $('.vertical-tabs-edit-comment-settings input[checked]');
+ console.log('hi');
+ if (!input.size()) {
+ console.log($('.vertical-tabs-edit-comment-settings input'));
+ input = $('.vertical-tabs-edit-comment-settings input')[Drupal.settings.nodeForm.comment];
+ }
+ else {
+ return $(input).parent().text().replace(/^\s*(.*)\s*$/, '$1');
+ }
+}
Index: modules/menu/menu.js
===================================================================
RCS file: modules/menu/menu.js
diff -N modules/menu/menu.js
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ modules/menu/menu.js 1 Nov 2008 02:46:13 -0000
@@ -0,0 +1,10 @@
+// $Id$
+
+Drupal.verticalTabs.nodeFormMenu = function() {
+ if ($('#edit-menu-link-title').val()) {
+ return $('#edit-menu-link-title').val();
+ }
+ else {
+ return Drupal.t('Not in menu');
+ }
+}
\ No newline at end of file
Index: modules/node/content_types.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/content_types.inc,v
retrieving revision 1.58
diff -u -p -r1.58 content_types.inc
--- modules/node/content_types.inc 8 Oct 2008 03:27:56 -0000 1.58
+++ modules/node/content_types.inc 1 Nov 2008 02:46:13 -0000
@@ -49,6 +49,7 @@ function node_overview_types() {
* Generates the node type editing form.
*/
function node_type_form(&$form_state, $type = NULL) {
+ drupal_add_js(drupal_get_path('module', 'node') .'/content_types.js');
if (!isset($type->type)) {
// This is a new type. Node module managed types are custom and unlocked.
$type = node_type_set_defaults(array('custom' => 1, 'locked' => 0));
@@ -67,6 +68,7 @@ function node_type_form(&$form_state, $t
'#default_value' => $type->name,
'#description' => t('The human-readable name of this content type. This text will be displayed as part of the list on the create content page. It is recommended that this name begin with a capital letter and contain only letters, numbers, and spaces. This name must be unique.'),
'#required' => TRUE,
+ '#field_suffix' => ' ',
);
if (!$type->locked) {
Index: modules/node/content_types.js
===================================================================
RCS file: modules/node/content_types.js
diff -N modules/node/content_types.js
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ modules/node/content_types.js 1 Nov 2008 02:46:13 -0000
@@ -0,0 +1,24 @@
+Drupal.behaviors.contentTypes = {
+ attach: function() {
+ if ($('#edit-type').val() == $('#edit-name').val().toLowerCase().replace(/[^a-z0-9]+/g, '_').replace(/_+/g, '_') || $('#edit-type').val() == '') {
+ $('#edit-type-wrapper').hide();
+ $('#edit-name').keyup(function() {
+ var machine = $(this).val().toLowerCase().replace(/[^a-z0-9]+/g, '_').replace(/_+/g, '_');
+ if (machine != '_' && machine != '') {
+ $('#edit-type').val(machine);
+ $('#node-type-name-suffix').empty().append(' Machine name: ' + machine + ' [').append($(''+ Drupal.t('Edit') +'').click(function() {
+ $('#edit-type-wrapper').show();
+ $('#node-type-name-suffix').hide();
+ $('#edit-name').unbind('keyup');
+ return false;
+ })).append(']');
+ }
+ else {
+ $('#edit-type').val(machine);
+ $('#node-type-name-suffix').text('');
+ }
+ });
+ $('#edit-name').keyup();
+ }
+ }
+};
\ No newline at end of file
Index: modules/node/node.js
===================================================================
RCS file: modules/node/node.js
diff -N modules/node/node.js
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ modules/node/node.js 1 Nov 2008 02:46:13 -0000
@@ -0,0 +1,38 @@
+// $Id$
+
+Drupal.verticalTabs.nodeFormRevision = function() {
+ var val = $('#edit-revision').attr('checked');
+ if (val) {
+ return Drupal.t('Create new revision');
+ }
+ else {
+ return Drupal.t('Don\'t create new revision');
+ }
+}
+
+Drupal.verticalTabs.nodeFormAuthoring = function() {
+ var name = $('#edit-name').val(), date = $('#edit-date').val();
+ if (date) {
+ return Drupal.t('By @name on @date', { '@name': name, '@date': date });
+ }
+ else {
+ return Drupal.t('By @name', { '@name': name });
+ }
+}
+
+Drupal.verticalTabs.nodeFormPublishingOptions = function() {
+ var vals = [];
+ if ($('#edit-status').attr('checked')) {
+ vals.push(Drupal.t('Published'));
+ }
+ if ($('#edit-promote').attr('checked')) {
+ vals.push(Drupal.t('Promoted to front page'));
+ }
+ if ($('#edit-sticky').attr('checked')) {
+ vals.push(Drupal.t('Sticky on top of lists'));
+ }
+ if (vals.join(', ') == '') {
+ return Drupal.t('None');
+ }
+ return vals.join(', ');
+}
Index: modules/path/path.js
===================================================================
RCS file: modules/path/path.js
diff -N modules/path/path.js
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ modules/path/path.js 1 Nov 2008 02:46:13 -0000
@@ -0,0 +1,12 @@
+// $Id$
+
+Drupal.verticalTabs.nodeFormPath = function() {
+ var path = $('#edit-path-1').val();
+
+ if (path) {
+ return Drupal.t('Alias: @alias', { '@alias': path });
+ }
+ else {
+ return Drupal.t('No alias');
+ }
+}
\ No newline at end of file
Index: modules/upload/upload.js
===================================================================
RCS file: modules/upload/upload.js
diff -N modules/upload/upload.js
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ modules/upload/upload.js 1 Nov 2008 02:46:13 -0000
@@ -0,0 +1,11 @@
+// $Id$
+
+Drupal.verticalTabs.nodeFormAttachments = function() {
+ var size = $('#upload-attachments tbody tr').size();
+ if (size) {
+ return Drupal.formatPlural(size, '1 attachment', '@count attachments');
+ }
+ else {
+ return Drupal.t('No attachments');
+ }
+}