~ubuntu-it-wiki/wiki-ubuntu-it/wiki-repo

« back to all changes in this revision

Viewing changes to applets/moinFCKplugins/moinformat/fckplugin.js

  • Committer: Leo Iannacone
  • Date: 2011-06-02 15:05:37 UTC
  • Revision ID: l3on@ubuntu.com-20110602150537-ycrnf58qf67uf593
Added applets for gui editor

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * FCKeditor - The text editor for internet
 
3
 * Copyright (C) 2003-2004 Frederico Caldeira Knabben
 
4
 * 
 
5
 * Licensed under the terms of the GNU Lesser General Public License:
 
6
 *   http://www.opensource.org/licenses/lgpl-license.php
 
7
 * 
 
8
 * For further information visit:
 
9
 *   http://www.fckeditor.net/
 
10
 * 
 
11
 * File Name: fckplugin.js
 
12
 *  MoinToolbarFontFormatCombo Class: Handles the Fonts combo selector.
 
13
 *   modified version of FCKToolbarFontFormatCombo
 
14
 *
 
15
 * File Authors:
 
16
 *   Frederico Caldeira Knabben (fredck@fckeditor.net)
 
17
 *   Florian Festi
 
18
 */
 
19
 
 
20
var MoinToolbarFontFormatCombo = function()
 
21
{
 
22
  this.CommandName = 'FontFormat';
 
23
  this.Command =  FCKCommands.GetCommand(this.CommandName);
 
24
}
 
25
 
 
26
// Inherit from MoinToolbarSpecialCombo.
 
27
MoinToolbarFontFormatCombo.prototype = new FCKToolbarSpecialCombo();
 
28
 
 
29
MoinToolbarFontFormatCombo.prototype.GetLabel = function()
 
30
{
 
31
  return FCKLang.FontFormat;
 
32
}
 
33
 
 
34
MoinToolbarFontFormatCombo.prototype.CreateItems = function(targetSpecialCombo)
 
35
{
 
36
  // Get the format names from the language file.
 
37
  var aNames = FCKLang['FontFormats'].split(';');
 
38
  var oNames = {
 
39
    p   : aNames[0],
 
40
    pre : aNames[1],
 
41
    h1  : aNames[3], // h1 as Title 1, aNames[2] is address
 
42
    h2  : aNames[4], // and so on
 
43
    h3  : aNames[5], 
 
44
    h4  : aNames[6],
 
45
    h5  : aNames[7],
 
46
    h6  : aNames[8]
 
47
  };
 
48
 
 
49
  // Get the available formats from the configuration file.
 
50
  var aTags = FCKConfig.FontFormats.split(';');
 
51
 
 
52
  for (var i in oNames)
 
53
  {
 
54
    this._Combo.AddItem(i, '<' + i + '>' + oNames[i] + '</' + i + '>', oNames[i]);
 
55
  }
 
56
}
 
57
 
 
58
FCKToolbarItems.RegisterItem( 'MoinFormat', new MoinToolbarFontFormatCombo());