~ubuntu-branches/ubuntu/oneiric/moin/oneiric-security

« back to all changes in this revision

Viewing changes to wiki/htdocs/applets/moinFCKplugins/moinbehaviour/fckplugin.js

  • Committer: Bazaar Package Importer
  • Author(s): Jamie Strandboge
  • Date: 2010-03-30 12:55:34 UTC
  • mfrom: (0.1.17 sid)
  • Revision ID: james.westby@ubuntu.com-20100330125534-4c2ufc1rok24447l
Tags: 1.9.2-2ubuntu1
* Merge from Debian testing (LP: #521834). Based on work by Stefan Ebner.
  Remaining changes:
 - Remove python-xml from Suggests field, the package isn't anymore in
   sys.path.
 - Demote fckeditor from Recommends to Suggests; the code was previously
   embedded in moin, but it was also disabled, so there's no reason for us
   to pull this in by default currently. Note: This isn't necessary anymore
   but needs a MIR for fckeditor, so postpone dropping this change until
   lucid+1
* debian/rules:
  - Replace hardcoded python2.5 with python* and hardcore python2.6 for ln
* debian/control.in: drop versioned depends on cdbs

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
 
2
 
/* ###########################################################################
3
 
 * IE functions
4
 
 * ###########################################################################
5
 
 */
6
 
 
7
 
function Doc_OnKeyDown_IE()
8
 
{
9
 
  var e = FCK.EditorWindow.event;
10
 
  if (e.keyCode == 13) // ENTER
11
 
  {
12
 
    if (e.ctrlKey || e.altKey || e.shiftKey|| !FCKSelection.HasAncestorNode("PRE")) {
13
 
      return true;
14
 
    }
15
 
    else
16
 
    { 
17
 
      FCKSelection.Delete();
18
 
      var oTmpNode = FCK.CreateElement("B");
19
 
      oTmpNode.innerHTML = " ";
20
 
      if (oTmpNode.previousSibling && oTmpNode.previousSibling.nodeType==3)
21
 
      {
22
 
        oTmpNode.previousSibling.nodeValue = 
23
 
      oTmpNode.previousSibling.nodeValue + '\r';
24
 
      }
25
 
      else
26
 
      {
27
 
        var oTxt = FCK.EditorDocument.createTextNode('\r');
28
 
        oTmpNode.parentNode.insertBefore(oTxt, oTmpNode);
29
 
      }
30
 
      var oRange = FCK.EditorDocument.selection.createRange();
31
 
      oRange.moveToElementText(oTmpNode);
32
 
      oRange.select();
33
 
      FCK.EditorDocument.selection.clear();           
34
 
      return false;
35
 
    }
36
 
  }
37
 
  return true;
38
 
}
39
 
 
40
 
 
41
 
function Doc_OnKeyUp_IE()
42
 
{
43
 
  /*
44
 
  var e = FCK.EditorWindow.event;
45
 
  if (e.keyCode == 8 || e.keyCode==46) // backspace, delete
46
 
    {
47
 
  */
48
 
  var oNode = FCKSelection.GetParentElement();
49
 
  var siHTML = oNode.innerHTML;
50
 
 
51
 
  if (siHTML.search(/ /i)!=-1)
52
 
  {
53
 
    oNode.normalize();
54
 
    alert("DING");
55
 
  }
56
 
      //    }
57
 
}
58
 
/* ##########################################################################
59
 
 * Register event handlers
60
 
 * ##########################################################################
61
 
 */
62
 
 
63
 
/*
64
 
// TODO FCK.EditorDocument is seems like deprecated, find alternative method for replace
65
 
if (FCK.EditorDocument.attachEvent) // IE
66
 
{
67
 
  FCK.EditorDocument.attachEvent('onkeydown', Doc_OnKeyDown_IE);
68
 
  //FCK.AttachToOnSelectionChange(Doc_OnKeyUp_IE);
69
 
 
70
 
}
71
 
 
72
 
*/
 
 
b'\\ No newline at end of file'