Download & Extend

May we move the file content.js to js/content.admin.js?

Project:Content Construction Kit (CCK)
Version:6.x-3.x-dev
Component:content.module
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

Since there maybe a new .js files added by another issue (#196421: Deleting unwanted multiple values / multiple values delta issues) and I was told to use the theme folder, maybe the file content.js could be moved to theme/content-admin.js?

The only reference to this file is in theme/theme.inc, and it is only used in the 'Manage Fields' screen.

The other .js file added by the above mentioned patch is theme/content-edit.js.

Makes sense?

Comments

#1

Although the js files are included in theme calls, moving them to the theme folder seems odd. I'd rather have them in a new cck/js folder. I think that's the most common pattern in contrib.

#2

Ok, then please proceed, and I'll move the new .js file to the cck/js folder as well. :)

What about the names of these files? Maybe js/content.admin.js and cck/content.node_form.js ?

#3

Title:May we move the file content.js to theme/content-admin.js?» May we move the file content.js to js/content.admin.js?

Changing the title to reflect a more consistent approach, as also applied to latest patch in #196421.

The change involves moving content.js to js/content.admin.js and apply the following mini-patch to theme/theme.inc:

<?php
drupal_add_js(drupal_get_path('module', 'content') .'/content.js');
drupal_add_js(drupal_get_path('module', 'content') .'/js/content.admin.js');
?>

This .js file is enabled for the 'Manage Fields' screen only, and it is sent transparently to any other module. Hence, side effects: none. :)

#4

Version:6.x-2.x-dev» 6.x-3.x-dev
Status:active» fixed

Committed to CVS.

Note the js has not been changed in any way. It has just been moved to the js subdirectory, for consistency with location of other javascript files.

#5

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.