/[drupal]/contributions/modules/contemplate/contemplate.js
ViewVC logotype

Contents of /contributions/modules/contemplate/contemplate.js

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download) (as text)
Tue Dec 12 18:14:26 2006 UTC (2 years, 11 months ago) by jjeff
Branch: MAIN
CVS Tags: DRUPAL-5--1-6, DRUPAL-5--1-2, DRUPAL-5--1-8, DRUPAL-5--5-1-1, DRUPAL-5--1-2-1, DRUPAL-5--1-5, DRUPAL-5--1-8-beta2, DRUPAL-5--1-7, DRUPAL-5--1-1, DRUPAL-6--0-1, DRUPAL-6--0-2, DRUPAL-5--1-8-beta1, DRUPAL-5--1-0, DRUPAL-5--1-3, HEAD
Branch point for: DRUPAL-5, DRUPAL-6--1
Changes since 1.1: +16 -17 lines
File MIME type: text/javascript
Major update to ConTemplate module. Adds separate field for RSS modification. Also, teaser, body, and rss are now individually enableable. Template tab appears on content/types/[type] pages. Node object divs are now resizable.
1 function insertAtCursor(myField, myValue) {
2 //IE support
3 if (document.selection) {
4 myField.focus();
5 sel = document.selection.createRange();
6 sel.text = myValue;
7 }
8
9 //MOZILLA/NETSCAPE support
10 else if (myField.selectionStart || myField.selectionStart == '0') {
11 var startPos = myField.selectionStart;
12 var endPos = myField.selectionEnd;
13 myField.value = myField.value.substring(0, startPos)
14 + myValue
15 + myField.value.substring(endPos, myField.value.length);
16 } else {
17 myField.value += myValue;
18 }
19 }
20
21 // calling the function
22 // insertAtCursor(document.formName.fieldName, Ôthis valueÕ);
23
24 Drupal.contemplate = new Object();
25
26 Drupal.contemplate.toggle = function() {
27 var target = $(this).attr('toggletarget');
28 $(target)[0].disabled = this.checked ? false : true;
29 $(target + '-keys').css('opacity', this.checked ? 1 : .2)
30 }
31
32 if (Drupal.jsEnabled) {
33 $(document).ready(function(){
34 $("input[@id*=enable]")
35 .click(Drupal.contemplate.toggle)
36 .click();
37 });
38 }

  ViewVC Help
Powered by ViewVC 1.1.2