code
stringlengths
1
2.01M
repo_name
stringlengths
3
62
path
stringlengths
1
267
language
stringclasses
231 values
license
stringclasses
13 values
size
int64
1
2.01M
package GUI; import BackendSimulation.Competition; import BackendSimulation.staticData; import java.awt.Dimension; import java.awt.Rectangle; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.util.regex.PatternSyntaxException; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.JTextField; import javax.swing.ListSelectionModel; import javax.swing.RowFilter; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; import javax.swing.table.AbstractTableModel; import javax.swing.table.TableRowSorter; public class CompetitionSearch extends JFrame { private TableRowSorter sorter; private TabelCompetitii tabelCompetitii = new TabelCompetitii(); private JScrollPane jScrollPane1 = new JScrollPane(); private JButton jButton1 = new JButton(); private JTextField jTextField1 = new JTextField(); private JTable jTable1 ; public CompetitionSearch() { try { jbInit(); } catch (Exception e) { e.printStackTrace(); } } private void jbInit() throws Exception { this.getContentPane().setLayout( null ); this.setSize( new Dimension(400, 300) ); jScrollPane1.setBounds(new Rectangle(25, 50, 335, 215)); jButton1.setText("jButton1"); jButton1.setBounds(new Rectangle(255, 15, 105, 20)); jButton1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { jButton1_actionPerformed(e); } }); jTextField1.setBounds(new Rectangle(40, 15, 150, 20)); jTextField1.getDocument().addDocumentListener(new DocumentListener(){ public void changedUpdate(DocumentEvent e) {newFilter();} public void insertUpdate(DocumentEvent e) { newFilter();} public void removeUpdate(DocumentEvent e) { newFilter();} }); this.addSorter(); this.getContentPane().add(jTextField1, null); this.getContentPane().add(jButton1, null); jScrollPane1.getViewport().add(jTable1, null); this.getContentPane().add(jScrollPane1, null); this.jTable1.addMouseListener(new MouseListener() { @Override public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2) { CompetitionPage c1 = new CompetitionPage (Integer.valueOf(jTable1.getValueAt(jTable1.getSelectedRow(), 4).toString())); c1.removeAll(); c1.dispose(); new CompetitionDetails(); //(Integer.valueOf(jTable1.getValueAt(jTable1.getSelectedRow(), 4).toString())); } } @Override public void mousePressed(MouseEvent e) { } @Override public void mouseReleased(MouseEvent e) { } @Override public void mouseEntered(MouseEvent e) { } @Override public void mouseExited(MouseEvent e) { } }); this.setVisible(true); this.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { this_windowClosing(e); } }); } public void newFilter(){ RowFilter<TabelCompetitii, Object> rf = null; try{ if (jTable1.getSelectedColumn() <= 0) rf = RowFilter.regexFilter(jTextField1.getText(), jTable1.getSelectedColumn()); else rf = RowFilter.regexFilter(jTextField1.getText(), jTable1.getSelectedColumn()); } catch(PatternSyntaxException e){ e.printStackTrace(); return; } sorter.setRowFilter(rf); } public void addSorter() { sorter = new TableRowSorter<TabelCompetitii>(tabelCompetitii); jTable1 = new JTable(tabelCompetitii); jTable1.setRowSorter(sorter); jTable1.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION); } private void jButton1_actionPerformed(ActionEvent e) { CompetitionPage c1 = new CompetitionPage (Integer.valueOf(jTable1.getValueAt(jTable1.getSelectedRow(), 4).toString())); c1.removeAll(); c1.dispose(); new CompetitionDetails(); //(Integer.valueOf(jTable1.getValueAt(jTable1.getSelectedRow(), 4).toString())); } private void this_windowClosing(WindowEvent e) { new ManagerHome(); } private class TabelCompetitii extends AbstractTableModel { private String[] columnNames = { "Data", "Nume Comp", "Categorie" ,"Oras","UID"}; private Object[][] date = new Object[staticData.competitii.size()][5]; public TabelCompetitii() { loadData(); } public void loadData() { int iter = 0; for (Competition comp : staticData.competitii) { date[iter][0] = comp.dataConcursului.dateToString(); date[iter][1] = comp.numeleConcursului; date[iter][2] = comp.numeClasa[comp.clasa - 1]; date[iter][3] = comp.orasulConcursului; date[iter][4] = comp.uniqueID; iter++; } } @Override public int findColumn(String columnName) { for (int i = 0; i < columnNames.length; i++) if (columnName == columnNames[i]) return i; return -1; } @Override public int getColumnCount() { return columnNames.length; } @Override public int getRowCount() { return date.length; } @Override public String getColumnName(int col) { return columnNames[col]; } @Override public Object getValueAt(int rowIndex, int columnIndex) { return date[rowIndex][columnIndex]; } @Override public Class getColumnClass(int c) { return getValueAt(0, c).getClass(); } @Override public boolean isCellEditable(int row, int col) { return false; } } }
100simulator
trunk/Client/src/GUI/CompetitionSearch.java
Java
oos
6,757
package GUI; import java.awt.Dimension; import BackendSimulation.*; import java.awt.Rectangle; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTabbedPane; import oracle.jdeveloper.layout.VerticalFlowLayout; public class CompetitionDetails extends JFrame { private JTabbedPane jTabbedPane1 = new JTabbedPane(); private JPanel jPanel1 = new JPanel(); private JPanel jPanel2 = new JPanel(); private JPanel jPanel3 = new JPanel(); private JLabel lblCmpName = new JLabel(); private VerticalFlowLayout verticalFlowLayout1 = new VerticalFlowLayout(); private JLabel lblCmpCity = new JLabel(); private JLabel lblCmpDate = new JLabel(); private JLabel lblCmpRecord = new JLabel(); private JLabel jLabel2 = new JLabel(); public CompetitionDetails() { try { jbInit(); } catch (Exception e) { e.printStackTrace(); } } private void jbInit() throws Exception { this.getContentPane().setLayout( null ); this.setSize( new Dimension(400, 300) ); jTabbedPane1.setBounds(new Rectangle(10, 15, 375, 250)); jPanel1.setLayout(null); jPanel3.setBounds(new Rectangle(45, 10, 270, 160)); jPanel3.setLayout(verticalFlowLayout1); lblCmpName.setText("jLabel1"); lblCmpCity.setText("jLabel1"); lblCmpDate.setText("jLabel1"); lblCmpRecord.setText("jLabel1"); jLabel2.setText("Record :"); jPanel3.add(lblCmpName, null); jPanel3.add(lblCmpCity, null); jPanel3.add(lblCmpDate, null); jPanel3.add(jLabel2, null); jPanel3.add(lblCmpRecord, null); jPanel1.add(jPanel3, null); jTabbedPane1.addTab("jPanel1", jPanel1); jTabbedPane1.addTab("jPanel2", jPanel2); this.getContentPane().add(jTabbedPane1, null); initLabel(); this.setVisible(true); } void initLabel(){ lblCmpName.setText(staticData.competitii.get(0).numeleConcursului); lblCmpCity.setText(staticData.competitii.get(0).orasulConcursului +" , " +staticData.competitii.get(0).taraConcursului); lblCmpDate.setText(staticData.competitii.get(0).dataConcursului.dateToString()); lblCmpRecord.setText(staticData.competitii.get(0).record +", " + staticData.competitii.get(0).numeDetinator + ", " +staticData.competitii.get(0).dataRecordului.dateToString()); } }
100simulator
trunk/Client/src/GUI/CompetitionDetails.java
Java
oos
2,527
package GUI; import ImportsAndExports.*; import BackendSimulation.*; import java.awt.CheckboxGroup; import java.awt.Choice; import java.awt.Dimension; import java.awt.List; import java.awt.Rectangle; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.Random; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JRadioButton; import javax.swing.JTextField; public class NewGameDialogs extends JFrame { private JTextField firstNameLabel = new JTextField(); private JTextField lastNameLabel = new JTextField(); private JLabel jLabel1 = new JLabel(); private JLabel jLabel2 = new JLabel(); private JLabel jLabel3 = new JLabel(); private JRadioButton buttonEasy = new JRadioButton(); private JRadioButton buttonMedium = new JRadioButton(); private JRadioButton buttonHard = new JRadioButton(); private Choice choice1 = new Choice(); private Choice choice2 = new Choice(); private Choice choice3 = new Choice(); private JButton jButton1 = new JButton(); private List list1 = new List(); private JLabel jLabel4 = new JLabel(); public NewGameDialogs() { try { jbInit(); } catch (Exception e) { e.printStackTrace(); } } private void jbInit() throws Exception { this.getContentPane().setLayout( null ); this.setSize( new Dimension(400, 300) ); firstNameLabel.setBounds(new Rectangle(15, 35, 90, 20)); lastNameLabel.setBounds(new Rectangle(130, 35, 90, 20)); jLabel1.setText("Nume"); jLabel1.setBounds(new Rectangle(25, 15, 85, 15)); jLabel2.setText("Prenume"); jLabel2.setBounds(new Rectangle(135, 15, 85, 15)); jLabel3.setText("Data Nasterii"); jLabel3.setBounds(new Rectangle(255, 15, 120, 15)); buttonEasy.setText("Easy"); buttonEasy.setBounds(new Rectangle(10, 175, 100, 20)); buttonEasy.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { buttonEasy_actionPerformed(e); } }); buttonMedium.setText("Medium"); buttonMedium.setBounds(new Rectangle(10, 200, 100, 20)); buttonMedium.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { buttonMedium_actionPerformed(e); } }); buttonHard.setText("Hard"); buttonHard.setBounds(new Rectangle(10, 225, 100, 20)); buttonHard.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { buttonHard_actionPerformed(e); } }); choice1.setBounds(new Rectangle(235, 35, 45, 20)); choice2.setBounds(new Rectangle(285, 35, 45, 20)); choice3.setBounds(new Rectangle(335, 35, 55, 20)); jButton1.setText("Initialise new game"); jButton1.setBounds(new Rectangle(245, 230, 140, 20)); jButton1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { jButton1_actionPerformed(e); } }); list1.setBounds(new Rectangle(15, 90, 140, 70)); jLabel4.setText("Nation"); jLabel4.setBounds(new Rectangle(20, 65, 125, 20)); this.initialiseBirthDateChoice(); this.initialiseNations(); this.getContentPane().add(jLabel4, null); this.getContentPane().add(list1, null); this.getContentPane().add(jButton1, null); this.getContentPane().add(choice3, null); this.getContentPane().add(choice2, null); this.getContentPane().add(choice1, null); this.getContentPane().add(buttonHard, null); this.getContentPane().add(buttonMedium, null); this.getContentPane().add(buttonEasy, null); this.getContentPane().add(jLabel3, null); this.getContentPane().add(jLabel2, null); this.getContentPane().add(jLabel1, null); this.getContentPane().add(lastNameLabel, null); this.getContentPane().add(firstNameLabel, null); this.setVisible(true); } private void buttonEasy_actionPerformed(ActionEvent e) { if (buttonMedium.isSelected()) {buttonMedium.setSelected(false);} if (buttonHard.isSelected()) {buttonHard.setSelected(false);} } private void buttonMedium_actionPerformed(ActionEvent e) { if (buttonEasy.isSelected()) {buttonEasy.setSelected(false);} if (buttonHard.isSelected()) {buttonHard.setSelected(false);} } private void buttonHard_actionPerformed(ActionEvent e) { if (buttonEasy.isSelected()) {buttonEasy.setSelected(false);} if (buttonMedium.isSelected()) {buttonMedium.setSelected(false);} } private void initialiseBirthDateChoice() { for (int i=1;i<=12;i++) this.choice2.add(Integer.toString(i)); for (int i=1;i<=31;i++) this.choice1.add(Integer.toString(i)); for (int i=1960;i<=1992;i++) this.choice3.add(Integer.toString(i)); } private void initialiseNations(){ list1.add("Romania"); list1.add("Unknown"); } private boolean validateData(){ switch (Integer.valueOf(this.choice2.getSelectedItem())) { case 1 : {return true;} case 2 : if (Integer.valueOf(this.choice1.getSelectedItem()) > 28) {return false;} else {return true;} case 3 : {return true;} case 4 : if (Integer.valueOf(this.choice1.getSelectedItem()) == 31) {return false;} else {return true;} case 5 : {return true;} case 6 : if (Integer.valueOf(this.choice1.getSelectedItem()) == 31) {return false;} else {return true;} case 7 : {return true;} case 8 : {return true;} case 9 : if (Integer.valueOf(this.choice1.getSelectedItem()) == 31) {return false;} else {return true;} case 10 : {return true;} case 11 : if (Integer.valueOf(this.choice1.getSelectedItem()) == 31) {return false;} else {return true;} case 12 : if (Integer.valueOf(this.choice1.getSelectedItem()) == 31) {return false;} else {return true;} } return true; } private Atlet setPlayerDetails(){ Atlet player = new Atlet(); player.firstName = this.firstNameLabel.getText(); player.lastName = this.lastNameLabel.getText(); player.nationality = this.list1.getSelectedItem(); player.dataNasterii = new Data(Integer.valueOf(choice1.getSelectedItem()),Integer.valueOf(choice2.getSelectedItem()),Integer.valueOf(choice3.getSelectedItem())); player.age = staticData.dataCurenta.an - player.dataNasterii.an ; Random generator = new Random(); if (buttonEasy.isSelected()) { } if (buttonMedium.isSelected()){ } if (buttonHard.isSelected()){ } return player; } private void jButton1_actionPerformed(ActionEvent e) { if (! this.validateData()) {JOptionPane.showMessageDialog(this, "Data is not valid!", "Error", JOptionPane.ERROR_MESSAGE);} else { staticData.player = setPlayerDetails(); new staticData(); dbImporting.createSavedGame(); JOptionPane.showMessageDialog(this, "Initialisation succesful!", "Succes", JOptionPane.INFORMATION_MESSAGE); new ManagerHome(); this.dispose(); } } }
100simulator
trunk/Client/src/GUI/NewGameDialogs.java
Java
oos
7,932
package GUI;
100simulator
trunk/Client/src/GUI/package-info.java
Java
oos
16
package GUI; import BackendSimulation.staticData; import java.awt.Dimension; import java.awt.Rectangle; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.util.regex.PatternSyntaxException; import javax.swing.JButton; import javax.swing.JEditorPane; import javax.swing.JFrame; import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.JTextField; import javax.swing.ListSelectionModel; import javax.swing.RowFilter; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; import javax.swing.table.AbstractTableModel; import javax.swing.table.TableRowSorter; public class AthleteSearch extends JFrame { private TableRowSorter sorter; private TabelAtleti tabelAtleti = new TabelAtleti(); private JTable jTable1; private JScrollPane jScrollPane1 = new JScrollPane(); private JTextField jTextField1 = new JTextField(); private JButton jButton1 = new JButton(); public AthleteSearch() { try { jbInit(); } catch (Exception e) { e.printStackTrace(); } } private void jbInit() throws Exception { this.getContentPane().setLayout(null); this.setSize(new Dimension(400, 300)); jScrollPane1.setBounds(new Rectangle(50, 60, 265, 145)); jTextField1.setBounds(new Rectangle(50, 20, 115, 20)); jButton1.setText("details"); jButton1.setBounds(new Rectangle(255, 20, 110, 20)); jButton1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { jButton1_actionPerformed(e); } }); jTextField1.getDocument().addDocumentListener(new DocumentListener() { public void changedUpdate(DocumentEvent e) { newFilter(); } public void insertUpdate(DocumentEvent e) { newFilter(); } public void removeUpdate(DocumentEvent e) { newFilter(); } }); this.addSorter(); this.getContentPane().add(jButton1, null); this.getContentPane().add(jTextField1, null); jScrollPane1.getViewport().add(jTable1, null); this.getContentPane().add(jScrollPane1, null); this.jTable1.addMouseListener(new MouseListener() { int count = 0; @Override public void mouseClicked(MouseEvent e) { System.out.println("Click!!"); if (e.getClickCount() == 2) new AthletePage((Integer.valueOf(tabelAtleti.getValueAt(jTable1.getSelectedRow(), 3).toString()))); } @Override public void mousePressed(MouseEvent e) { } @Override public void mouseReleased(MouseEvent e) { } @Override public void mouseEntered(MouseEvent e) { } @Override public void mouseExited(MouseEvent e) { } }); this.setVisible(true); this.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { this_windowClosing(e); } }); } public void newFilter() { RowFilter<TabelAtleti, Object> rf = null; try { if (jTable1.getSelectedColumn() <= 0) rf = RowFilter.regexFilter(jTextField1.getText(), 0); else rf = RowFilter.regexFilter(jTextField1.getText(), jTable1.getSelectedColumn()); } catch (PatternSyntaxException e) { e.printStackTrace(); return; } sorter.setRowFilter(rf); } public void addSorter() { sorter = new TableRowSorter<TabelAtleti>(tabelAtleti); jTable1 = new JTable(tabelAtleti); jTable1.setRowSorter(sorter); jTable1.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); } private void jButton1_actionPerformed(ActionEvent e) { new AthletePage((Integer.valueOf(tabelAtleti.getValueAt(jTable1.getSelectedRow(), 3).toString()))); } private void this_windowClosing(WindowEvent e) { new ManagerHome(); } private class TabelAtleti extends AbstractTableModel { private String[] columnNames = { "Nume", "Prenume", "Varsta" }; private Object[][] date = new Object[staticData.atlet.size()][4]; public TabelAtleti() { loadData(); } public void loadData() { for (int i = 0; i < staticData.atlet.size(); i++) { date[i][0] = staticData.atlet.get(i).firstName; date[i][1] = staticData.atlet.get(i).lastName; date[i][2] = staticData.atlet.get(i).age; date[i][3] = staticData.atlet.get(i).uniqueID; } } @Override public int findColumn(String columnName) { for (int i = 0; i < columnNames.length; i++) if (columnName == columnNames[i]) return i; return -1; } @Override public int getColumnCount() { return columnNames.length; } @Override public int getRowCount() { return date.length; } @Override public String getColumnName(int col) { return columnNames[col]; } @Override public Object getValueAt(int rowIndex, int columnIndex) { return date[rowIndex][columnIndex]; } @Override public Class getColumnClass(int c) { return getValueAt(0, c).getClass(); } @Override public boolean isCellEditable(int row, int col) { return false; } } }
100simulator
trunk/Client/src/GUI/AthleteSearch.java
Java
oos
6,197
package GUI; import BackendSimulation.Atlet; import BackendSimulation.Manager; import BackendSimulation.staticData; import ImportsAndExports.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseEvent; import java.io.File; import java.io.IOException; import java.io.RandomAccessFile; import java.awt.Dimension; import java.awt.List; import java.awt.Rectangle; import java.awt.event.MouseListener; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JOptionPane; public class LoadGame extends JFrame { private JLabel jLabel1 = new JLabel(); private List list1 = new List(); private JButton jButton1 = new JButton(); public LoadGame() { try { jbInit(); } catch (Exception e) { e.printStackTrace(); } } private void jbInit() throws Exception { this.getContentPane().setLayout( null ); this.setSize( new Dimension(400, 300) ); jLabel1.setText("Currently saved games :"); jLabel1.setBounds(new Rectangle(15, 10, 220, 35)); list1.setBounds(new Rectangle(15, 55, 258, 130)); this.initGamesList(); list1.addMouseListener(new MouseListener (){ @Override public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2){ new staticData(1); // TODO // staticData.player = (Manager)dbImporting.loadSavedGame(list1.getSelectedItem())[0].getFirst(); staticData.atlet = dbImporting.loadSavedGame(list1.getSelectedItem())[1]; staticData.managers = dbImporting.loadSavedGame(list1.getSelectedItem())[2]; staticData.competitii = dbImporting.loadSavedGame(list1.getSelectedItem())[3]; staticData.player.age = staticData.dataCurenta.an - staticData.player.dataNasterii.an ; for (Atlet atl : staticData.atlet) atl.age = staticData.dataCurenta.an - atl.dataNasterii.an; for (Manager man : staticData.managers) man.age = staticData.dataCurenta.an - man.dataNasterii.an; JOptionPane.showMessageDialog(new JFrame(), "Game Loaded!", "Loading...", JOptionPane.PLAIN_MESSAGE); new ManagerHome(); LoadGame.this.dispose(); } } @Override public void mousePressed(MouseEvent e) { } @Override public void mouseReleased(MouseEvent e) { } @Override public void mouseEntered(MouseEvent e) { } @Override public void mouseExited(MouseEvent e) { } }); jButton1.setText("load"); jButton1.setBounds(new Rectangle(285, 60, 105, 25)); jButton1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { jButton1_actionPerformed(e); } }); this.getContentPane().add(jButton1, null); this.getContentPane().add(list1, null); this.getContentPane().add(jLabel1, null); this.setVisible(true); } public void initGamesList(){ File dir = new File("Saved"); String[] saves = dir.list(); for (String game : saves) {game = game.substring(0, game.length()-4); list1.add(game);} } private void jButton1_actionPerformed(ActionEvent e) { new staticData(1); // TODO // staticData.player = (Manager)dbImporting.loadSavedGame(list1.getSelectedItem())[0].getFirst(); staticData.atlet = dbImporting.loadSavedGame(list1.getSelectedItem())[1]; staticData.managers = dbImporting.loadSavedGame(list1.getSelectedItem())[2]; staticData.competitii = dbImporting.loadSavedGame(list1.getSelectedItem())[3]; staticData.player.age = staticData.dataCurenta.an - staticData.player.dataNasterii.an ; for (Atlet atl : staticData.atlet) atl.age = staticData.dataCurenta.an - atl.dataNasterii.an; for (Manager man : staticData.managers) man.age = staticData.dataCurenta.an - man.dataNasterii.an; JOptionPane.showMessageDialog(this, "Game Loaded!", "Loading...", JOptionPane.PLAIN_MESSAGE); this.dispose(); new ManagerHome(); } }
100simulator
trunk/Client/src/GUI/LoadGame.java
Java
oos
4,900
package GUI; import BackendSimulation.*; import ImportsAndExports.*; import java.awt.Dimension; import java.awt.PopupMenu; import java.awt.Rectangle; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import javax.swing.BorderFactory; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JScrollPane; import javax.swing.JTabbedPane; import javax.swing.JTable; import javax.swing.table.AbstractTableModel; public class CompetitionPage extends JFrame { private JTable jTable1 = new JTable(new TabelAtleti()); private JLabel competitionNameLabel = new JLabel(); private JLabel competitionSetByLabel = new JLabel(); private JLabel competitionRecordLabel = new JLabel(); private JLabel competitionDateLabel = new JLabel(); private JLabel jLabel2 = new JLabel(); private JLabel jLabel3 = new JLabel(); private JLabel jLabel1 = new JLabel(); private JLabel competitionClassLabel = new JLabel(); private Competition competition = new Competition(); private JScrollPane jScrollPane1 = new JScrollPane(jTable1); static int passUid; private JButton jButton1 = new JButton(); private JButton jButton2 = new JButton(); private JButton jButton3 = new JButton(); public CompetitionPage(int uid) { try { jbInit(uid); } catch (Exception e) { e.printStackTrace(); } } public CompetitionPage() { try { jbInit(); } catch (Exception e) { e.printStackTrace(); } } private void jbInit(int uid) throws Exception { passUid = uid; this.getContentPane().setLayout( null ); this.setSize(new Dimension(403, 338)); competitionNameLabel.setText("jLabel1"); competitionNameLabel.setBounds(new Rectangle(10, 5, 245, 20)); competitionSetByLabel.setText("jLabel4"); competitionSetByLabel.setBounds(new Rectangle(130, 90, 260, 15)); competitionRecordLabel.setText("jLabel4"); competitionRecordLabel.setBounds(new Rectangle(130, 70, 260, 15)); competitionDateLabel.setText("jLabel4"); competitionDateLabel.setBounds(new Rectangle(95, 50, 130, 15)); jLabel2.setText("Date : "); jLabel2.setBounds(new Rectangle(10, 50, 85, 15)); jLabel3.setText("Set by :"); jLabel3.setBounds(new Rectangle(5, 90, 120, 15)); jLabel1.setText("Current Record :"); jLabel1.setBounds(new Rectangle(5, 70, 120, 15)); competitionClassLabel.setText("jLabel1"); competitionClassLabel.setBounds(new Rectangle(10, 25, 245, 20)); jScrollPane1.setBounds(new Rectangle(10, 120, 365, 145)); jButton1.setText("jButton1"); jButton1.setBounds(new Rectangle(10, 280, 105, 20)); jButton2.setText("view results"); jButton2.setBounds(new Rectangle(135, 280, 100, 20)); jButton2.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { jButton2_actionPerformed(e); } }); jButton3.setText("skip competition"); jButton3.setBounds(new Rectangle(255, 280, 100, 20)); jButton3.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { jButton3_actionPerformed(e); } }); jScrollPane1.getViewport().add(jTable1, null); this.getContentPane().add(jButton3, null); this.getContentPane().add(jButton2, null); this.getContentPane().add(jButton1, null); this.getContentPane().add(jScrollPane1, null); this.getContentPane().add(competitionClassLabel, null); this.getContentPane().add(jLabel1, null); this.getContentPane().add(jLabel3, null); this.getContentPane().add(jLabel2, null); this.getContentPane().add(competitionDateLabel, null); this.getContentPane().add(competitionRecordLabel, null); this.getContentPane().add(competitionSetByLabel, null); this.getContentPane().add(competitionNameLabel, null); this.importCompetition(uid); this.setAll(); this.setVisible(true); this.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { this_windowClosed(e); } }); } private void importCompetition(int uid) { this.competition = staticData.competitii.get(uid); } private void setAll() { this.competitionNameLabel.setText(competition.numeleConcursului + ", " + competition.orasulConcursului); this.competitionClassLabel.setText(competition.numeClasa[competition.clasa - 1]); this.competitionDateLabel.setText(competition.dataConcursului.dateToString()); this.competitionRecordLabel.setText(competition.record + ""); this.competitionSetByLabel.setText(competition.numeDetinator + ", " + competition.dataRecordului.dateToString()); } private void jbInit() throws Exception { /* this.getContentPane().setLayout( null ); this.setSize(new Dimension(403, 338)); competitionNameLabel.setText("jLabel1"); competitionNameLabel.setBounds(new Rectangle(10, 5, 245, 20)); competitionSetByLabel.setText("jLabel4"); competitionSetByLabel.setBounds(new Rectangle(130, 90, 260, 15)); competitionRecordLabel.setText("jLabel4"); competitionRecordLabel.setBounds(new Rectangle(130, 70, 260, 15)); competitionDateLabel.setText("jLabel4"); competitionDateLabel.setBounds(new Rectangle(95, 50, 130, 15)); jLabel2.setText("Date : "); jLabel2.setBounds(new Rectangle(10, 50, 85, 15)); jLabel3.setText("Set by :"); jLabel3.setBounds(new Rectangle(5, 90, 120, 15)); jLabel1.setText("Current Record :"); jLabel1.setBounds(new Rectangle(5, 70, 120, 15)); competitionClassLabel.setText("jLabel1"); competitionClassLabel.setBounds(new Rectangle(10, 25, 245, 20)); jScrollPane1.setBounds(new Rectangle(10, 120, 365, 145)); jButton1.setText("jButton1"); jButton1.setBounds(new Rectangle(10, 280, 105, 20)); jButton2.setText("view results"); jButton2.setBounds(new Rectangle(135, 280, 100, 20)); jButton2.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { jButton2_actionPerformed(e); } }); jButton3.setText("skip competition"); jButton3.setBounds(new Rectangle(255, 280, 100, 20)); jButton3.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { jButton3_actionPerformed(e); } }); jScrollPane1.getViewport().add(jTable1, null); this.getContentPane().add(jButton3, null); this.getContentPane().add(jButton2, null); this.getContentPane().add(jButton1, null); this.getContentPane().add(jScrollPane1, null); this.getContentPane().add(competitionClassLabel, null); this.getContentPane().add(jLabel1, null); this.getContentPane().add(jLabel3, null); this.getContentPane().add(jLabel2, null); this.getContentPane().add(competitionDateLabel, null); this.getContentPane().add(competitionRecordLabel, null); this.getContentPane().add(competitionSetByLabel, null); this.getContentPane().add(competitionNameLabel, null); this.importCompetition(0); this.setAll(); this.setVisible(true); this.addWindowListener(new WindowAdapter() { public void windowClosed(WindowEvent e) { this_windowClosed(e); } });*/ } private void jButton2_actionPerformed(ActionEvent e) { new CompetitionResultsPage(passUid); this.dispose(); System.out.println("Action has been performed"); } private void jButton3_actionPerformed(ActionEvent e) { CompetitionResultsPage p = new CompetitionResultsPage(passUid); p.checkAndSetRecords(); p.dispose(); this.dispose(); } private void this_windowClosed(WindowEvent e) { System.out.println("Window closed :D"); CompetitionResultsPage p = new CompetitionResultsPage(passUid); p.checkAndSetRecords(); p.dispose(); new ManagerHome(); } private class TabelAtleti extends AbstractTableModel { private String[] columnNames = { "Nume", "Prenume", "Varsta" }; private Object[][] date = null; public TabelAtleti() { loadData(); } public void loadData() { if (staticData.competitii.get(passUid).atletiInscrisi != null) { date = new Object[staticData.competitii.get(passUid).atletiInscrisi.size()][4]; for (int i = 0; i < staticData.competitii.get(passUid).atletiInscrisi.size(); i++) { date[i][0] = staticData.atlet.get(i).firstName; date[i][1] = staticData.atlet.get(i).lastName; date[i][2] = staticData.atlet.get(i).age; date[i][3] = staticData.atlet.get(i).uniqueID; } } else { date = new Object[1][4]; date[0][0] = "a"; date[0][1] = "b"; date[0][2] = "c"; date[0][3] = "none"; } } @Override public int findColumn(String columnName) { for (int i = 0; i < columnNames.length; i++) if (columnName == columnNames[i]) return i; return -1; } @Override public int getColumnCount() { return columnNames.length; } @Override public int getRowCount() { return date.length; } @Override public String getColumnName(int col) { return columnNames[col]; } @Override public Object getValueAt(int rowIndex, int columnIndex) { return date[rowIndex][columnIndex]; } @Override public Class getColumnClass(int c) { return getValueAt(0, c).getClass(); } @Override public boolean isCellEditable(int row, int col) { return false; } } }
100simulator
trunk/Client/src/GUI/CompetitionPage.java
Java
oos
11,044
package GUI; import ImportsAndExports.*; import BackendSimulation.*; import BackendSimulation.Data; import java.awt.Dimension; import java.awt.GridLayout; import java.awt.Rectangle; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTabbedPane; import javax.swing.JTable; import javax.swing.table.AbstractTableModel; import oracle.jdeveloper.layout.BoxLayout2; import oracle.jdeveloper.layout.OverlayLayout2; public class AthletePage extends JFrame { private Atlet atlet ; private JTabbedPane jTabbedPane1 = new JTabbedPane(); private JPanel details = new JPanel(); private JLabel dataNasteriiLabel = new JLabel(); private JLabel contractedUntilLabel = new JLabel(); private JLabel contractedToLabel = new JLabel(); private JLabel seasonBestSetOnLabel = new JLabel(); private JLabel personalBestSetOnLabel = new JLabel(); private JLabel seasonBestLabel = new JLabel(); private JLabel personalBestLabel = new JLabel(); private JLabel concentrationLabel = new JLabel(); private JLabel fitnessLabel = new JLabel(); private JLabel moraleLabel = new JLabel(); private JLabel paceLabel = new JLabel(); private JLabel reactionLabel = new JLabel(); private JLabel jLabel10 = new JLabel(); private JLabel jLabel9 = new JLabel(); private JLabel jLabel8 = new JLabel(); private JLabel jLabel7 = new JLabel(); private JLabel jLabel6 = new JLabel(); private JLabel jLabel5 = new JLabel(); private JLabel speedLabel = new JLabel(); private JLabel accelerationLabel = new JLabel(); private JLabel jLabel2 = new JLabel(); private JLabel numeSiPrenume = new JLabel(); private BoxLayout2 boxLayout21 = new BoxLayout2(); private JPanel jPanel1 = new JPanel(); private JLabel jLabel1 = new JLabel(); private JTable jTable1 ; private JScrollPane jScrollPane1 = new JScrollPane(jTable1);// DEBUG AND TESTING PURPOSES public static int uid; // Testing purposes public AthletePage(int uid) { try { jbInit(uid); } catch (Exception e) { e.printStackTrace(); } } public AthletePage() { try { jbInit(); } catch (Exception e) { e.printStackTrace(); } } private void jbInit(int uid) throws Exception { this.uid = uid; this.importAthlete(uid); this.getContentPane().setLayout(boxLayout21); this.setSize( new Dimension(400, 300) ); this.setVisible(true); details.setLayout(null); dataNasteriiLabel.setText("jLabel1"); dataNasteriiLabel.setBounds(new Rectangle(10, 30, 235, 15)); contractedUntilLabel.setText("Until : "); contractedUntilLabel.setBounds(new Rectangle(255, 120, 125, 15)); contractedToLabel.setText("Contracted to :"); contractedToLabel.setBounds(new Rectangle(255, 135, 135, 15)); seasonBestSetOnLabel.setText("jLabel19"); seasonBestSetOnLabel.setBounds(new Rectangle(75, 95, 300, 15)); personalBestSetOnLabel.setText("jLabel18"); personalBestSetOnLabel.setBounds(new Rectangle(85, 65, 240, 15)); seasonBestLabel.setText("Season Best : "); seasonBestLabel.setBounds(new Rectangle(10, 80, 180, 15)); personalBestLabel.setText("Personal Best : "); personalBestLabel.setBounds(new Rectangle(10, 50, 185, 15)); concentrationLabel.setText("jLabel3"); concentrationLabel.setBounds(new Rectangle(95, 165, 35, 15)); fitnessLabel.setText("jLabel3"); fitnessLabel.setBounds(new Rectangle(95, 195, 35, 15)); moraleLabel.setText("jLabel3"); moraleLabel.setBounds(new Rectangle(95, 210, 35, 15)); paceLabel.setText("jLabel3"); paceLabel.setBounds(new Rectangle(95, 150, 35, 15)); reactionLabel.setText("jLabel3"); reactionLabel.setBounds(new Rectangle(95, 180, 40, 15)); jLabel10.setText("Morale"); jLabel10.setBounds(new Rectangle(10, 210, 60, 15)); jLabel9.setText("Fitness"); jLabel9.setBounds(new Rectangle(10, 195, 45, 15)); jLabel8.setText("Concentration"); jLabel8.setBounds(new Rectangle(10, 165, 75, 15)); jLabel7.setText("Pace"); jLabel7.setBounds(new Rectangle(10, 150, 45, 15)); jLabel6.setText("Reaction"); jLabel6.setBounds(new Rectangle(10, 180, 65, 15)); jLabel5.setText("Speed"); jLabel5.setBounds(new Rectangle(10, 120, 55, 15)); speedLabel.setText("jLabel3"); speedLabel.setBounds(new Rectangle(95, 120, 50, 15)); accelerationLabel.setText("jLabel3"); accelerationLabel.setBounds(new Rectangle(95, 135, 45, 15)); jLabel2.setText("Acceleration"); jLabel2.setBounds(new Rectangle(10, 135, 60, 15)); numeSiPrenume.setText("jLabel1"); numeSiPrenume.setBounds(new Rectangle(10, 10, 360, 15)); jPanel1.setLayout(null); jLabel1.setText("Competition History :"); jLabel1.setBounds(new Rectangle(10, 5, 325, 15)); jScrollPane1.setBounds(new Rectangle(15, 35, 365, 195)); details.add(dataNasteriiLabel, null); details.add(contractedUntilLabel, null); details.add(seasonBestSetOnLabel, null); details.add(personalBestSetOnLabel, null); details.add(seasonBestLabel, null); details.add(personalBestLabel, null); details.add(concentrationLabel, null); details.add(fitnessLabel, null); details.add(moraleLabel, null); details.add(paceLabel, null); details.add(reactionLabel, null); details.add(jLabel10, null); details.add(jLabel9, null); details.add(jLabel8, null); details.add(jLabel7, null); details.add(jLabel5, null); details.add(speedLabel, null); details.add(accelerationLabel, null); details.add(jLabel2, null); details.add(numeSiPrenume, null); details.add(jLabel6, null); details.add(contractedToLabel, null); jTabbedPane1.addTab("details", details); this.jTable1 = new JTable(new IstoricTabel(uid)); jScrollPane1.getViewport().add(jTable1, null); jPanel1.add(jScrollPane1, null); jPanel1.add(jLabel1, null); jTabbedPane1.addTab("History", jPanel1); this.getContentPane().add(jTabbedPane1, null); this.setAll(); this.setVisible(true); } private void importAthlete(int uid) { this.atlet = staticData.atlet.get(uid); } private void setAll(){ this.numeSiPrenume.setText(atlet.firstName + " " + atlet.lastName + ", " + atlet.age + " years, " + atlet.nationality); this.dataNasteriiLabel.setText("Data nasterii : " + atlet.dataNasterii.dateToString()); this.personalBestLabel.setText("Personal Best : " + atlet.personalBest); this.personalBestSetOnLabel.setText(atlet.personalBestDate.dateToString() + " " + atlet.personalBestLocation); this.seasonBestLabel.setText("Season Best : " + atlet.seasonBest); this.seasonBestSetOnLabel.setText(atlet.seasonBestDate.dateToString() + " " + atlet.seasonBestLocation); this.accelerationLabel.setText(String.valueOf(atlet.acceleration)); this.speedLabel.setText(String.valueOf(atlet.speed)); this.paceLabel.setText(String.valueOf(atlet.pace)); this.reactionLabel.setText(String.valueOf(atlet.reaction)); this.concentrationLabel.setText(String.valueOf(atlet.concentration)); this.fitnessLabel.setText(String.valueOf(atlet.fitness)); this.moraleLabel.setText(String.valueOf(atlet.morale)); } private void initiateTables(){ this.jTable1.setModel(new IstoricTabel(uid)); this.jTabbedPane1.repaint(); } private void jbInit() throws Exception { this.importAthlete(0); this.getContentPane().setLayout(boxLayout21); this.setSize( new Dimension(400, 300) ); this.setVisible(true); details.setLayout(null); dataNasteriiLabel.setText("jLabel1"); dataNasteriiLabel.setBounds(new Rectangle(10, 30, 235, 15)); contractedUntilLabel.setText("Until : "); contractedUntilLabel.setBounds(new Rectangle(255, 120, 125, 15)); contractedToLabel.setText("Contracted to :"); contractedToLabel.setBounds(new Rectangle(255, 135, 135, 15)); seasonBestSetOnLabel.setText("jLabel19"); seasonBestSetOnLabel.setBounds(new Rectangle(75, 95, 300, 15)); personalBestSetOnLabel.setText("jLabel18"); personalBestSetOnLabel.setBounds(new Rectangle(85, 65, 240, 15)); seasonBestLabel.setText("Season Best : "); seasonBestLabel.setBounds(new Rectangle(10, 80, 180, 15)); personalBestLabel.setText("Personal Best : "); personalBestLabel.setBounds(new Rectangle(10, 50, 185, 15)); concentrationLabel.setText("jLabel3"); concentrationLabel.setBounds(new Rectangle(95, 165, 35, 15)); fitnessLabel.setText("jLabel3"); fitnessLabel.setBounds(new Rectangle(95, 195, 35, 15)); moraleLabel.setText("jLabel3"); moraleLabel.setBounds(new Rectangle(95, 210, 35, 15)); paceLabel.setText("jLabel3"); paceLabel.setBounds(new Rectangle(95, 150, 35, 15)); reactionLabel.setText("jLabel3"); reactionLabel.setBounds(new Rectangle(95, 180, 40, 15)); jLabel10.setText("Morale"); jLabel10.setBounds(new Rectangle(10, 210, 60, 15)); jLabel9.setText("Fitness"); jLabel9.setBounds(new Rectangle(10, 195, 45, 15)); jLabel8.setText("Concentration"); jLabel8.setBounds(new Rectangle(10, 165, 75, 15)); jLabel7.setText("Pace"); jLabel7.setBounds(new Rectangle(10, 150, 45, 15)); jLabel6.setText("Reaction"); jLabel6.setBounds(new Rectangle(10, 180, 65, 15)); jLabel5.setText("Speed"); jLabel5.setBounds(new Rectangle(10, 120, 55, 15)); speedLabel.setText("jLabel3"); speedLabel.setBounds(new Rectangle(95, 120, 50, 15)); accelerationLabel.setText("jLabel3"); accelerationLabel.setBounds(new Rectangle(95, 135, 45, 15)); jLabel2.setText("Acceleration"); jLabel2.setBounds(new Rectangle(10, 135, 60, 15)); numeSiPrenume.setText("jLabel1"); numeSiPrenume.setBounds(new Rectangle(10, 10, 360, 15)); jPanel1.setLayout(null); jLabel1.setText("Competition History :"); jLabel1.setBounds(new Rectangle(10, 5, 325, 15)); jScrollPane1.setBounds(new Rectangle(15, 35, 365, 195)); details.add(dataNasteriiLabel, null); details.add(contractedUntilLabel, null); details.add(seasonBestSetOnLabel, null); details.add(personalBestSetOnLabel, null); details.add(seasonBestLabel, null); details.add(personalBestLabel, null); details.add(concentrationLabel, null); details.add(fitnessLabel, null); details.add(moraleLabel, null); details.add(paceLabel, null); details.add(reactionLabel, null); details.add(jLabel10, null); details.add(jLabel9, null); details.add(jLabel8, null); details.add(jLabel7, null); details.add(jLabel5, null); details.add(speedLabel, null); details.add(accelerationLabel, null); details.add(jLabel2, null); details.add(numeSiPrenume, null); details.add(jLabel6, null); details.add(contractedToLabel, null); jTabbedPane1.addTab("details", details); jScrollPane1.getViewport().add(jTable1, null); jPanel1.add(jScrollPane1, null); jPanel1.add(jLabel1, null); jTabbedPane1.addTab("History", jPanel1); this.getContentPane().add(jTabbedPane1, null); this.setAll(); this.setVisible(true); } class IstoricTabel extends AbstractTableModel{ private String[] columnNames = { "Count","Timp" }; private Object[][] date = new Object[staticData.atlet.get(uid).history.size()][2]; public IstoricTabel(int uid) { loadData(uid); } public void loadData(int uid) { System.out.println(staticData.atlet.get(uid).history.size()); for (int i=0;i<staticData.atlet.get(uid).history.size();i++) { date[i][0] = i; date[i][1] = staticData.atlet.get(uid).history.get(i); System.out.println("UID : "+ uid); System.out.println("Debug : "+staticData.atlet.get(uid).history.get(i)); } } @Override public int findColumn(String columnName) { for (int i = 0; i < columnNames.length; i++) if (columnName == columnNames[i]) return i; return -1; } @Override public int getColumnCount() { return columnNames.length; } @Override public int getRowCount() { return date.length; } @Override public String getColumnName(int col) { return columnNames[col]; } @Override public Object getValueAt(int rowIndex, int columnIndex) { return date[rowIndex][columnIndex]; } @Override public Class getColumnClass(int c) { return getValueAt(0, c).getClass(); } @Override public boolean isCellEditable(int row, int col) { return false; } } }
100simulator
trunk/Client/src/GUI/AthletePage.java
Java
oos
14,084
package GUI; import BackendSimulation.*; import java.awt.Color; import java.awt.Dimension; import java.awt.Label; import java.awt.List; import java.awt.Rectangle; import java.awt.ScrollPane; import java.awt.GridLayout; import java.awt.Scrollbar; import java.awt.TextArea; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import javax.swing.BorderFactory; import javax.swing.DefaultCellEditor; import javax.swing.JScrollPane; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JList; import javax.swing.JTable; import javax.swing.table.AbstractTableModel; import javax.swing.table.DefaultTableModel; import javax.swing.table.TableCellEditor; import javax.swing.table.TableColumn; public class Clasament extends JFrame { private JTable jTable1 = new JTable(new TabelAtleti()); private JScrollPane jScrollPane1; public Clasament() { try { jbInit(); } catch (Exception e) { e.printStackTrace(); } } private void jbInit() throws Exception { this.rutineTabel(); jScrollPane1 = new JScrollPane(jTable1); this.getContentPane().setLayout(null); this.setSize(new Dimension(400, 300)); jScrollPane1.setBounds(new Rectangle(10, 25, 375, 230)); this.getContentPane().add(jScrollPane1, null); this.jTable1.addMouseListener(new MouseListener() { @Override public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2) { new AthletePage(Integer.valueOf((jTable1.getValueAt(jTable1.getSelectedRow(), 0)).toString())); } } @Override public void mousePressed(MouseEvent e) { } @Override public void mouseReleased(MouseEvent e) { } @Override public void mouseEntered(MouseEvent e) { } @Override public void mouseExited(MouseEvent e) { } }); this.jScrollPane1.repaint(); this.setVisible(true); this.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { this_windowClosing(e); } }); } public void rutineTabel() { jTable1.setAutoCreateRowSorter(true); jTable1.setDragEnabled(false); this.jTable1.setAutoResizeMode(this.jTable1.AUTO_RESIZE_OFF); TableColumn aux = this.jTable1.getColumnModel().getColumn(0); aux.setPreferredWidth(0); } private void this_windowClosing(WindowEvent e) { new ManagerHome(); } // CLASA TABEL ATLETI !!! class TabelAtleti extends AbstractTableModel { private String[] columnNames = { "UID", "Nume", "Prenume", "Nationalitate", "Season Best", "Personal Best" }; private Object[][] date = new Object[staticData.atlet.size()][6]; public TabelAtleti() { loadData(); } public void loadData() { for (int i = 0; i < staticData.atlet.size(); i++) { date[i][0] = staticData.atlet.get(i).uniqueID; date[i][1] = staticData.atlet.get(i).firstName; date[i][2] = staticData.atlet.get(i).lastName; date[i][3] = staticData.atlet.get(i).nationality; date[i][4] = staticData.atlet.get(i).seasonBest; date[i][5] = staticData.atlet.get(i).personalBest; } date = sortData(date); } public Object[][] sortData(Object[][] data) { for (int i = 0; i < staticData.atlet.size() - 1; i++) for (int j = i + 1; j < staticData.atlet.size(); j++) if (Float.parseFloat(data[i][4].toString()) > Float.parseFloat(data[j][4].toString())) { Object[] aux = new Object[6]; for (int i2 = 0; i2 < 6; i2++) aux[i2] = data[i][i2]; for (int i2 = 0; i2 < 6; i2++) data[i][i2] = data[j][i2]; for (int i2 = 0; i2 < 6; i2++) data[j][i2] = aux[i2]; } return data; } @Override public int findColumn(String columnName) { for (int i = 0; i < columnNames.length; i++) if (columnName == columnNames[i]) return i; return -1; } @Override public int getColumnCount() { return columnNames.length; } @Override public int getRowCount() { return date.length; } @Override public String getColumnName(int col) { return columnNames[col]; } @Override public Object getValueAt(int rowIndex, int columnIndex) { return date[rowIndex][columnIndex]; } @Override public Class getColumnClass(int c) { return getValueAt(0, c).getClass(); } @Override public boolean isCellEditable(int row, int col) { return false; } } }
100simulator
trunk/Client/src/GUI/Clasament.java
Java
oos
5,628
package GUI; import java.awt.Dimension; import javax.swing.JFrame; public class CompetitionHistory extends JFrame { public CompetitionHistory() { try { jbInit(); } catch (Exception e) { e.printStackTrace(); } } private void jbInit() throws Exception { this.getContentPane().setLayout( null ); this.setSize( new Dimension(400, 300) ); } }
100simulator
trunk/Client/src/GUI/CompetitionHistory.java
Java
oos
442
package GUI; import BackendSimulation.Atlet; import BackendSimulation.Brackets; import BackendSimulation.staticData; import java.awt.Choice; import java.awt.Dimension; import java.awt.Container; import java.awt.Rectangle; import java.awt.event.ComponentAdapter; import java.awt.event.ComponentEvent; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.util.LinkedList; import javax.swing.JComboBox; import javax.swing.JFrame; import javax.swing.JScrollPane; import javax.swing.JSpinner; import javax.swing.JTable; import javax.swing.SpinnerListModel; import javax.swing.table.AbstractTableModel; import javax.swing.SpinnerDateModel; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; public class CompetitionResultsPage extends JFrame { private static LinkedList<LinkedList<Atlet>> competitie ; private static int competitionLevel = 0; private static int levelIterator = 0; private static int timeIterator = 0; private JTable jTable1 = new JTable(); private JScrollPane jScrollPane1 = new JScrollPane(); private JSpinner jSpinner1 = new JSpinner(); private JSpinner jSpinner2 = new JSpinner(); static int uid; public CompetitionResultsPage(int id) { try { jbInit(id); } catch (Exception e) { e.printStackTrace(); } } private void jbInit(int id) throws Exception { this.addWindowListener(new WindowAdapter() { public void windowOpened(WindowEvent e) { this_windowOpened(e); } }); competitie = new Brackets(id).comp; staticData.competitii.get(id).rezultate = competitie; uid = id; this.initSpinner1(); this.initSpinner2(); this.getContentPane().setLayout( null ); this.setSize(new Dimension(423, 328)); jScrollPane1.setBounds(new Rectangle(20, 100, 375, 185)); jSpinner1.setBounds(new Rectangle(200, 30, 95, 20)); jSpinner1.addChangeListener(new ChangeListener(){ public void stateChanged(ChangeEvent e){ jSpinner1_stateChanged(e); } }); jSpinner2.setBounds(new Rectangle(330, 30, 60, 20)); jSpinner2.addChangeListener(new ChangeListener(){ public void stateChanged(ChangeEvent e){ jSpinner2_stateChanged(e); } }); jScrollPane1.getViewport().add(jTable1, null); this.getContentPane().add(jSpinner2, null); this.getContentPane().add(jSpinner1, null); this.getContentPane().add(jScrollPane1, null); this.setVisible(true); this.addWindowListener(new WindowAdapter() { public void windowOpened(WindowEvent e) { this_windowOpened(e); } public void windowDeactivated(WindowEvent e) { this_windowDeactivated(e); } }); //this.debugData(); } public void checkAndSetRecords(){ /*int iter1=0,iter2=0; // probleme la iterator, trebuiesc facute cazuri switch (staticData.competitii.get(0).clasa){ case 1: {iter1=0;iter2 = 0; break;} case 2: {iter1=0;iter2 = 0; break;} case 3: {iter1=32;iter2 = 0; break;} case 4: {iter1=32;iter2 = 0; break;} case 5: {iter1=48;iter2 = 1; break;} case 6: {iter1=56;iter2 = 2; break;} case 7: {iter1=60;iter2 = 3; break;} case 8: {iter1=62;iter2 = 4; break;} } for (int i= iter1;i<63;i++) { if (iter1 == 32 || iter1 == 48 || iter1 == 56 || iter1 == 60 || iter1 == 62) {iter2++;} for (int j=0;j<8;j++) {System.out.println("Verificari : "+ (Float.compare(competitie.get(i).get(j).competitionTime[iter2],new Float(0)))); if ((competitie.get(i).get(j).competitionTime[iter2] < competitie.get(i).get(j).personalBest) && (competitie.get(i).get(j).competitionTime[iter2] != 0f) ) {competitie.get(i).get(j).setNewPersonalBest(competitie.get(i).get(j).competitionTime[iter2], staticData.competitii.get(0)); } if ((competitie.get(i).get(j).competitionTime[iter2] < competitie.get(i).get(j).seasonBest) && (competitie.get(i).get(j).competitionTime[iter2] != 0f) ) {competitie.get(i).get(j).setNewSeasonBest(competitie.get(i).get(j).competitionTime[iter2], staticData.competitii.get(0)); } if ((competitie.get(i).get(j).competitionTime[iter2] < staticData.competitii.get(0).record) && (competitie.get(i).get(j).competitionTime[iter2] != 0f)) {staticData.competitii.get(0).setNewRecord(competitie.get(i).get(j), competitie.get(i).get(j).competitionTime[iter2], staticData.dataCurenta); } } } */ for (int i : staticData.competitii.get(uid).atletiInscrisi) { for (float f : staticData.atlet.get(i).history) { if (f < staticData.atlet.get(i).personalBest) { staticData.atlet.get(i).setNewPersonalBest(f, staticData.competitii.get(0)); staticData.atlet.get(i).setNewSeasonBest(f, staticData.competitii.get(0)); } if (f < staticData.atlet.get(i).seasonBest) staticData.atlet.get(i).setNewSeasonBest(f, staticData.competitii.get(0)); if (f < staticData.recordMondial){ staticData.setNewWR(f, staticData.atlet.get(i), staticData.competitii.get(0)); } } } for (int i : staticData.competitii.get(uid).atletiInscrisi) { for (float f : staticData.atlet.get(i).history) if (f < staticData.competitii.get(uid).record) staticData.competitii.get(uid).setNewRecord(staticData.atlet.get(i),f,staticData.dataCurenta); } } private void debugData(){ for (LinkedList<Atlet> lista : competitie) if (lista.isEmpty() == false) for (Atlet a : lista) for (float f : a.competitionTime) System.out.println(a.firstName+" "+f); } private void jSpinner2_stateChanged(ChangeEvent e){ if (jSpinner2.getValue().toString().equals("Finala")) {levelIterator = 0;} else { for (int i=1;i<=32;i++) { if (Integer.valueOf(jSpinner2.getValue().toString()) == i ) {levelIterator = i-1;} } } jTable1.setModel(new TabelAtleti()); jScrollPane1.repaint(); System.out.println("DebugTest: "+(competitionLevel+levelIterator)); } private void this_windowOpened(WindowEvent e) { System.out.println("Window has been opened"); this.addResultsHistory(); this.checkAndSetRecords(); } private void jSpinner1_stateChanged(ChangeEvent e){ System.out.println("Event fired !"); levelIterator = 0; this.initSpinner2(); jTable1.setModel(new TabelAtleti()); jScrollPane1.repaint(); } private void initSpinner2(){ String value = jSpinner1.getValue().toString(); String[] toInsert = null; SpinnerListModel model = null; if (value.equalsIgnoreCase("Seria")) { competitionLevel = 0;toInsert = new String[32]; for (int i=1;i<=32;i++) {toInsert[i-1] = i+"";} timeIterator = 0; } if (value.equalsIgnoreCase("Saisprezecimea")) { competitionLevel = 32;toInsert = new String[16]; for (int i=1;i<=16;i++) {toInsert[i-1] = i+"";} timeIterator = 1; } if (value.equalsIgnoreCase("Optimea")) { competitionLevel = 49;toInsert = new String[8]; for (int i=1;i<=8;i++) {toInsert[i-1] = i+"";} timeIterator = 2; } if (value.equalsIgnoreCase("Sfertul")) { competitionLevel = 56;toInsert = new String[4]; for (int i=1;i<=4;i++) {toInsert[i-1] = i+"";} timeIterator = 3; } if (value.equalsIgnoreCase("Semifinala")) { competitionLevel = 60;toInsert = new String[2]; for (int i=1;i<=2;i++) {toInsert[i-1] = i+"";} timeIterator = 4; } if (value.equalsIgnoreCase("Finala")) { competitionLevel = 62;toInsert = new String[1]; for (int i=1;i<=1;i++) {toInsert[i-1] = "Finala";} timeIterator = 5; } model = new SpinnerListModel(toInsert); jSpinner2.setModel(model); jSpinner2.repaint(); } private void initSpinner1(){ String[] etape = {"Seria","Saisprezecimea","Optimea","Sfertul","Semifinala","Finala"}; String[] etapeSpinner = null; SpinnerListModel model = null; switch (staticData.competitii.get(uid).clasa) { case 1 : {timeIterator = 0;etapeSpinner = new String[6];etapeSpinner = etape; break;} case 2 : {timeIterator = 0;etapeSpinner = new String[6];etapeSpinner = etape; break;} case 3 : {timeIterator = 1;competitionLevel = 32;etapeSpinner = new String[5];etapeSpinner[0] ="Saisprezecimea" ;etapeSpinner[1] ="Optimea" ;etapeSpinner[2] ="Sfertul" ;etapeSpinner[3] = "Semifinala" ;etapeSpinner[4] = "Finala"; break;} case 4 : {timeIterator = 2;competitionLevel = 48;etapeSpinner = new String[4];etapeSpinner[0] ="Optimea" ;etapeSpinner[1] ="Sfertul" ;etapeSpinner[2] ="Semifinala" ;etapeSpinner[3] ="Finala" ; break;} case 5 : {timeIterator = 3;competitionLevel = 56;etapeSpinner = new String[3];etapeSpinner[0] ="Sfertul" ;etapeSpinner[1] ="Semifinala" ;etapeSpinner[2] ="Finala" ; break;} // case 6 : {timeIterator = 3;competitionLevel = 60;etapeSpinner = new String[3];etapeSpinner[0] = new String(etape[3]); etapeSpinner[1] = new String (etape[4]); etapeSpinner[2] = new String(etape[5]) ;break; } // case 7 : {timeIterator = 4;competitionLevel = 60;etapeSpinner = new String[2];etapeSpinner[0] = new String(etape[4]); etapeSpinner[1] = new String(etape[5]); break;} // case 8 : {timeIterator = 5;competitionLevel = 62;etapeSpinner = new String[1];etapeSpinner[0] = new String(etape[5]); jSpinner2 = new JSpinner(new SpinnerListModel(etapeSpinner)); break;} } System.out.println("SpinnerSize : "+etapeSpinner.length); System.out.println("CompLevel : "+competitionLevel); model = new SpinnerListModel(etapeSpinner); jSpinner1.setModel(model); jSpinner1.repaint(); jTable1.setModel(new TabelAtleti()); jScrollPane1.repaint(); } private void addResultsHistory() { for (int i : staticData.competitii.get(uid).atletiInscrisi) { LinkedList<Float> rv = new LinkedList<Float>(); for (int j=0;j<staticData.atlet.get(i).competitionTime.length;j++) { if (staticData.atlet.get(i).competitionTime[j] != 0f) rv.add(staticData.atlet.get(i).competitionTime[j]); } staticData.atlet.get(i).history.addAll(rv); } } private void this_windowDeactivated(WindowEvent e) { System.out.println("Window has been deactivated"); this.dispose(); new ManagerHome(); } private class TabelAtleti extends AbstractTableModel { private String[] columnNames = { "Nume", "Prenume", "Timp", "UID" }; private Object[][] date = new Object[competitie.get(competitionLevel).size()][4]; public TabelAtleti() { loadData(); } public void loadData() { int iter = 0; competitie.set(competitionLevel+levelIterator, sortList(competitie.get(competitionLevel+levelIterator),timeIterator)); for (Atlet i : competitie.get(competitionLevel+levelIterator)) { date[iter][0] = i.firstName; date[iter][1] = i.lastName; date[iter][2] = i.competitionTime[timeIterator]; date[iter][3] = i.uniqueID; iter++; } fireTableDataChanged(); } public LinkedList<Atlet> sortList(LinkedList<Atlet> lista,int iterator) { for (int i=0;i<lista.size()-1;i++) for (int j=i+1;j<lista.size();j++) if (lista.get(i).competitionTime[iterator] > lista.get(j).competitionTime[iterator]) { Atlet aux = lista.get(i); lista.set(i,lista.get(j)); lista.set(j, aux); } return lista; } @Override public int findColumn(String columnName) { for (int i = 0; i < columnNames.length; i++) if (columnName == columnNames[i]) return i; return -1; } @Override public int getColumnCount() { return columnNames.length; } @Override public int getRowCount() { return date.length; } @Override public String getColumnName(int col) { return columnNames[col]; } @Override public Object getValueAt(int rowIndex, int columnIndex) { return date[rowIndex][columnIndex]; } @Override public Class getColumnClass(int c) { return getValueAt(0, c).getClass(); } @Override public boolean isCellEditable(int row, int col) { return false; } } }
100simulator
trunk/Client/src/GUI/CompetitionResultsPage.java
Java
oos
14,366
package GUI; import java.awt.Dimension; import java.awt.Rectangle; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; public class Options extends JFrame { public boolean closeFlag = false; public Options() { try { jbInit(); } catch (Exception e) { e.printStackTrace(); } } private void jbInit() throws Exception { this.getContentPane().setLayout( null ); this.setSize(new Dimension(388, 289)); this.setVisible(true); this.addWindowListener(new WindowAdapter() { public void windowClosed(WindowEvent e) { this_windowClosed(e); } }); } private void this_windowClosed(WindowEvent e) { } private void jButton1_actionPerformed(ActionEvent e) { } }
100simulator
trunk/Client/src/GUI/Options.java
Java
oos
1,068
package GUI; import java.awt.Choice; import java.awt.Dimension; import BackendSimulation.*; import ImportsAndExports.*; import java.awt.GridLayout; import java.awt.Rectangle; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.util.Collections; import java.util.LinkedList; import java.util.List; import javax.swing.AbstractListModel; import javax.swing.BoundedRangeModel; import javax.swing.ComboBoxModel; import javax.swing.DebugGraphics; import javax.swing.JComboBox; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JList; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JSlider; import javax.swing.JTabbedPane; import javax.swing.JTextArea; import javax.swing.event.ChangeListener; import javax.swing.event.ListDataListener; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import javax.swing.text.PlainDocument; import oracle.jdeveloper.layout.VerticalFlowLayout; import oracle.jdeveloper.layout.XYConstraints; import oracle.jdeveloper.layout.XYLayout; public class Training extends JFrame { int f = 0; static LinkedList<String> drills = dbImporting.readDB("Training drills.txt"); static LinkedList<String> explicatii = dbImporting.readDB("Explicatii.txt"); private JTabbedPane jTabbedPane1 = new JTabbedPane(); private JPanel jPanel1 = new JPanel(); private JPanel jPanel2 = new JPanel(); private JLabel jLabel1 = new JLabel(); private JLabel jLabel2 = new JLabel(); private JLabel jLabel3 = new JLabel(); private JLabel jLabel4 = new JLabel(); private JLabel jLabel5 = new JLabel(); private JLabel jLabel6 = new JLabel(); private JLabel jLabel7 = new JLabel(); private JSlider jSlider1 = new JSlider(); private JLabel jLabel8 = new JLabel(); private JLabel jLabel9 = new JLabel(); private JScrollPane jScrollPane1 = new JScrollPane(); private JTextArea jTextArea1 = new JTextArea(); private JLabel jLabel10 = new JLabel(); private JScrollPane jScrollPane2 = new JScrollPane(); private JList jList1 = new JList(new TrainingList()); private JScrollPane jScrollPane3 = new JScrollPane(); private JTextArea jTextArea2 = new JTextArea(); static int trainingIntensity; private JPanel jPanel3 = new JPanel(); private Choice choice1 = new Choice(); private Choice choice3 = new Choice(); private Choice choice4 = new Choice(); private Choice choice5 = new Choice(); private Choice choice2 = new Choice(); private XYLayout xYLayout1 = new XYLayout(); private Choice choice6 = new Choice(); private Choice choice7 = new Choice(); public Training() { try { jbInit(); } catch (Exception e) { e.printStackTrace(); } } private void jbInit() throws Exception { this.getContentPane().setLayout( null ); this.setSize(new Dimension(435, 333)); jTabbedPane1.setBounds(new Rectangle(5, 10, 425, 295)); jPanel1.setLayout(null); jPanel2.setLayout(null); jLabel1.setText("Monday"); jLabel1.setBounds(new Rectangle(0, 10, 65, 20)); jLabel2.setText("Tuesday"); jLabel2.setBounds(new Rectangle(0, 30, 65, 20)); jLabel3.setText("Thursday"); jLabel3.setBounds(new Rectangle(0, 50, 65, 20)); jLabel4.setText("Wedensday"); jLabel4.setBounds(new Rectangle(0, 70, 75, 20)); jLabel5.setText("Friday"); jLabel5.setBounds(new Rectangle(0, 90, 65, 20)); jLabel6.setText("Saturday"); jLabel6.setBounds(new Rectangle(0, 110, 65, 20)); jLabel7.setText("Sunday"); jLabel7.setBounds(new Rectangle(0, 130, 65, 20)); jSlider1.setBounds(new Rectangle(115, 180, 290, 25)); jSlider1.addChangeListener(new BoundedChangeListener()); jLabel8.setText("Training workload"); jLabel8.setBounds(new Rectangle(10, 185, 100, 15)); jLabel9.setText("Notes :"); jLabel9.setBounds(new Rectangle(255, 5, 70, 15)); jScrollPane1.setBounds(new Rectangle(245, 25, 160, 130)); jTextArea1.setLineWrap(true); jLabel10.setText("Select a training drill to view its description"); jLabel10.setBounds(new Rectangle(5, 10, 285, 25)); jScrollPane2.setBounds(new Rectangle(10, 45, 200, 205)); jList1.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { jList1_mouseClicked(e); } public void mousePressed(MouseEvent e) { jList1_mousePressed(e); } public void mouseReleased(MouseEvent e) { jList1_mouseReleased(e); } }); jScrollPane3.setBounds(new Rectangle(225, 45, 185, 205)); jTextArea2.setEditable(false); jPanel3.setBounds(new Rectangle(70, 5, 170, 155)); jPanel3.setLayout(xYLayout1); jPanel3.add(choice7, new XYConstraints(5, 125, 165, 20)); jPanel3.add(choice6, new XYConstraints(5, 105, 165, 20)); jPanel3.add(choice1, new XYConstraints(5, 5, 165, 20)); jPanel3.add(choice3, new XYConstraints(5, 25, 165, 20)); jPanel3.add(choice4, new XYConstraints(5, 45, 165, 20)); jPanel3.add(choice2, new XYConstraints(5, 65, 165, 20)); jPanel3.add(choice5, new XYConstraints(5, 85, 165, 20)); this.initChoices(); jPanel1.add(jPanel3, null); jScrollPane1.getViewport().add(jTextArea1, null); jPanel1.add(jScrollPane1, null); jPanel1.add(jLabel9, null); jPanel1.add(jLabel8, null); jPanel1.add(jSlider1, null); jPanel1.add(jLabel7, null); jPanel1.add(jLabel6, null); jPanel1.add(jLabel5, null); jPanel1.add(jLabel4, null); jPanel1.add(jLabel3, null); jPanel1.add(jLabel2, null); jPanel1.add(jLabel1, null); jTabbedPane1.addTab("Training Programme", jPanel1); jScrollPane2.getViewport().add(jList1, null); jScrollPane3.getViewport().add(jTextArea2, null); jPanel2.add(jScrollPane3, null); jPanel2.add(jScrollPane2, null); jPanel2.add(jLabel10, null); jTabbedPane1.addTab("Details", jPanel2); this.getContentPane().add(jTabbedPane1, null); this.setVisible(true); this.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { this_windowClosing(e); } }); } void initChoices(){ for (String s : drills){ this.choice1.add(s); this.choice2.add(s); this.choice3.add(s); this.choice4.add(s); this.choice5.add(s); this.choice6.add(s); this.choice7.add(s); } } private void jList1_mouseClicked(MouseEvent e) { System.out.println("Click !!!"); jTextArea2.setText(explicatii.get(jList1.getSelectedIndex())); } private void jList1_mousePressed(MouseEvent e) { f ++; } private void jList1_mouseReleased(MouseEvent e) { f++; if (f == 2) { jTextArea2.setText(explicatii.get(jList1.getSelectedIndex())); } f = 0; } private void this_windowClosing(WindowEvent e) { new ManagerHome(); } class TrainingList extends AbstractListModel{ LinkedList<String> data = drills; public TrainingList(){ } @Override public int getSize() { return data.size(); } @Override public Object getElementAt(int index) { return data.get(index); } } class BoundedChangeListener implements ChangeListener{ @Override public void stateChanged(javax.swing.event.ChangeEvent e) { Object source = e.getSource(); if (source instanceof JSlider){ JSlider model = (JSlider) source ; if (!model.getValueIsAdjusting()){ System.out.println("Changed : "+model.getValue()); trainingIntensity = model.getValue(); } } } } }
100simulator
trunk/Client/src/GUI/Training.java
Java
oos
8,773
package BackendSimulation; public class Data { public int zi; public int luna; public int an; public String[] numeLuni = {"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"}; public int[] nrzile = {31,28,31,30,31,30,31,31,30,31,30,30}; public Data() { super(); } public Data(int zi,int luna,int an) { this.zi = zi; this.luna = luna; this.an = an; } public String dateToString() { return this.zi + " " + numeLuni[this.luna - 1] + " " + this.an; } public Data urmatoareaZi() { if (zi == nrzile[luna-1]) { if (luna == 12) {zi = 1; luna = 1; an++;} else { luna++; zi = 1; } } else zi++; return new Data(zi,luna,an); } public static int nrZileIntreDate(Data a,Data b) { int rv=0; boolean f = false; while (f == false) { if ((a.zi == b.zi) && (a.luna == b.luna) ) {f = true;} else {rv++; a = a.urmatoareaZi();} } return rv-1; } // FOR DEBUG PURPOSES public static void main(String args[]){ Data d1 = new Data(1,1,1111); Data d2 = new Data(11,1,1111); System.out.println(nrZileIntreDate(d1,d2)); } }
100simulator
trunk/Client/src/BackendSimulation/Data.java
Java
oos
1,525
package BackendSimulation; import java.security.SecureRandom; import java.util.*; import java.math.*; import javax.xml.crypto.Data; public class Brackets{ int numarAtleti; String[] depthName = {"Serii","Saisprezecimi","Optimi","Sferturi","Semifinala","Finala","Castigator"}; static Random generator = new Random(); LinkedList<Atlet> allAthletes = new LinkedList<Atlet>(); int[] depthValues = {0,1,2,3,4,5}; int[] toStopAtDepth = {32,16,8,4,2,1,0}; public LinkedList<LinkedList<Atlet>> comp = new LinkedList<LinkedList<Atlet>>(); static int iterator = 0; public Brackets(int uid){ for (Atlet a : staticData.atlet) { for (int i : staticData.competitii.get(uid).atletiInscrisi) { if (a.uniqueID == i) {allAthletes.add(a);System.out.println("Added : "+a); } } } numarAtleti = staticData.competitii.get(uid).nrAtleti[staticData.competitii.get(uid).clasa-1]; System.out.println("DebugData, nrAtleti = "+numarAtleti); switch (numarAtleti) { case 256: { iterator = 0; this.initialiseBracket(); allAthletes = this.avansareSerii(); this.initialiseBracket(); allAthletes = this.avansareSaisprezecimi(); this.initialiseBracket(); allAthletes = this.avansareOptimi(); this.initialiseBracket(); allAthletes = this.avansareSferturi(); this.initialiseBracket(); allAthletes = this.avansareSemifinale(); this.initialiseBracket(); numarAtleti = 1; allAthletes = this.finala(); break; } case 128 :{ for (int i=0;i<32;i++) {comp.add(null);} iterator = 1; this.initialiseBracket(); allAthletes = this.avansareSaisprezecimi(); this.initialiseBracket(); allAthletes = this.avansareOptimi(); this.initialiseBracket(); allAthletes = this.avansareSferturi(); this.initialiseBracket(); allAthletes = this.avansareSemifinale(); this.initialiseBracket(); numarAtleti = 1; allAthletes = this.finala(); break; } case 64 :{ for (int i=0;i<48;i++) {comp.add(null);} iterator = 2; this.initialiseBracket(); allAthletes = this.avansareOptimi(); this.initialiseBracket(); allAthletes = this.avansareSferturi(); this.initialiseBracket(); allAthletes = this.avansareSemifinale(); this.initialiseBracket(); numarAtleti = 1; allAthletes = this.finala(); break; } case 32 :{ for (int i=0;i<56;i++) {comp.add(null);} iterator = 3; this.initialiseBracket(); allAthletes = this.avansareSferturi(); this.initialiseBracket(); allAthletes = this.avansareSemifinale(); this.initialiseBracket(); numarAtleti = 1; allAthletes = this.finala(); break; } case 16 :{ for (int i=0;i<60;i++) {comp.add(null);} iterator = 4; this.initialiseBracket(); allAthletes = this.avansareSemifinale(); this.initialiseBracket(); numarAtleti = 1; allAthletes = this.finala(); break; } case 8:{ for (int i=0;i<62;i++) {comp.add(null);} iterator = 5; this.initialiseBracket(); break; } } //this.printData(); } public void initialiseBracket() { if (this.numarAtleti == 1) {comp.add(allAthletes);} else { allAthletes = this.generateTimp(allAthletes); iterator++; for (int i=0;i<this.numarAtleti/8;i++) { comp.add(split()); } } numarAtleti /= 2; } public LinkedList<Atlet> split(){ LinkedList<Atlet> returnValue = new LinkedList<Atlet>(); if (this.allAthletes.isEmpty() == true) {return null;} else { for (int j=0;j<8;j++) {int i; if (this.allAthletes.size() == 1) {i = 0;} else {i = generator.nextInt(this.allAthletes.size() - 1);} returnValue.add(allAthletes.get(i)); this.allAthletes.remove(i); } } return returnValue; } public LinkedList<Atlet> avansareSerii() { LinkedList<Atlet> returnValue = new LinkedList<Atlet>(); for (int i=0;i<this.toStopAtDepth[0];i++) { for (Atlet x : comp.get(i)) { returnValue.add(x); } } returnValue = sortList(returnValue); for (int i = 0;i<128;i++) {returnValue.removeLast();} // for (Atlet i : returnValue) {i.competitionTime = 99.99f;} return returnValue; } public LinkedList<Atlet> avansareSaisprezecimi() { LinkedList<Atlet> returnValue = new LinkedList<Atlet>(); for (int i = 32;i<48;i++) { comp.set(i, this.sortList(comp.get(i))); } for (int i = 32; i < 48;i++) { for (int j=0;j<4;j++) { returnValue.add(comp.get(i).get(j)); } } // returnValue = this.setDefaultTime(returnValue); return returnValue; } public LinkedList<Atlet> avansareOptimi() { LinkedList<Atlet> returnValue = new LinkedList<Atlet>(); for (int i = 48;i<56;i++) { comp.set(i, this.sortList(comp.get(i))); } for (int i=48; i<56;i++) { for (int j=0;j<4;j++) { returnValue.add(comp.get(i).get(j)); } } // returnValue = this.setDefaultTime(returnValue); return returnValue; } public LinkedList<Atlet> avansareSferturi() { LinkedList<Atlet> returnValue = new LinkedList<Atlet>(); for (int i = 56;i<60;i++) { comp.set(i, this.sortList(comp.get(i))); } for (int i=56; i<60;i++) { for (int j=0;j<4;j++) { returnValue.add(comp.get(i).get(j)); } } // returnValue = this.setDefaultTime(returnValue); return returnValue; } public LinkedList<Atlet> avansareSemifinale() { LinkedList<Atlet> returnValue = new LinkedList<Atlet>(); for (int i = 60;i<62;i++) { comp.set(i, this.sortList(comp.get(i))); } for (int i=60; i<62;i++) { for (int j=0;j<4;j++) { returnValue.add(comp.get(i).get(j)); } } // returnValue = this.setDefaultTime(returnValue); return returnValue; } public LinkedList<Atlet> finala() { LinkedList<Atlet> returnValue = new LinkedList<Atlet>(); int i = 62; comp.set(i, this.sortList(comp.get(i))); returnValue.add(comp.get(i).get(0)); returnValue.get(0).competitionTime[6] = returnValue.get(0).competitionTime[5]; return returnValue; } public void printData() {int iter1 = 1,iter2 = 0; for (LinkedList<Atlet> lista : comp) { {if (toStopAtDepth[iter2] == iter1-1) {iter2++; iter1 = 1;} } System.out.println(depthName[iter2]+iter1); for (Atlet i : lista) { System.out.print(i.firstName+": "+i.competitionTime[iter2]+"; "); } System.out.println(); iter1++; } } public LinkedList<Atlet> sortList(LinkedList<Atlet> lista) { for (int i=0;i<lista.size()-1;i++) for (int j=i+1;j<lista.size();j++) if (lista.get(i).competitionTime[iterator-1] > lista.get(j).competitionTime[iterator-1]) { Atlet aux = lista.get(i); lista.set(i,lista.get(j)); lista.set(j, aux); } return lista; } public float round(float f) { String s = f+""; String real,fract; if (s.startsWith("1") == true) { if (s.length() == 4 || s.length() == 5) {return f;} else{ real = s.substring(0, 2); fract = s.substring(3,6); } } else { if (s.length() == 3 || s.length() == 4) {return f;} else { real = s.substring(0,1); fract = s.substring(2,5); } } float r = Float.parseFloat(real); float fr = Float.parseFloat(fract); if (fr%10 >= 5f) {fr = fr + (10-fr%10);} else {fr = fr - fr%10;} return (float) (r + (float) (fr/1000) ); } public LinkedList<Atlet> generateTimp(LinkedList<Atlet> toParse) { for (Atlet a : toParse) { generator.setSeed(System.nanoTime() * System.currentTimeMillis() * + generator.nextLong()); float phasePenalty = 0f; float formaDeMoment = -0.15f; formaDeMoment += (float) generator.nextInt(10)/100; formaDeMoment += a.fitness/2000; float speed = 8.6f; int decider = generator.nextInt(3); int concentrValue = (int) a.concentration; System.out.println("ConcValue : "+concentrValue); float bonus = generator.nextInt(20*concentrValue + 1)/100 ; float plecare = (float) generator.nextInt(200)/10000; boolean bonusSutime = generator.nextBoolean(); switch (iterator) { case 0: {phasePenalty = (float) (0.25 + (generator.nextInt(10)/100)) ; break;} case 1: {phasePenalty = (float) (0.15 + (generator.nextInt(10)/100)) ; break;} case 2: {phasePenalty = (float) (0.10 + (generator.nextInt(10)/100)) ; break;} case 3: {phasePenalty = (float) (0.10 + (generator.nextInt(5)/100)) ; break;} case 4: {phasePenalty = (float) (generator.nextInt(10)/100) ; break;} case 5: {break;} } switch (decider) { case 0 : {break;} case 1 : {speed += 0.00854152f * bonus; break;} case 2 : {speed += 0.00640614f * bonus; break;} case 3 : {speed += 0.00640614f * bonus; break;} } speed += 0.00854152 * a.acceleration; speed += 0.00640614f * a.speed; speed += 0.00640614f * a.pace; speed += (-1 + 0.01*a.fitness); float timp = (float) 100/speed ; timp += 0.655f - 0.0053*a.reaction; timp += plecare; timp += phasePenalty; timp += formaDeMoment; if (bonusSutime) {timp -= 0.01;} staticData.atlet.get(a.uniqueID).competitionTime[iterator] = this.round(timp); } return toParse; } }
100simulator
trunk/Client/src/BackendSimulation/Brackets.java
Java
oos
13,288
package BackendSimulation; import ImportsAndExports.*; import java.util.LinkedList; public class staticData { public static int competitionCount = 0; public static LinkedList<Integer> passedComp = new LinkedList<Integer>(); public static LinkedList<Atlet> atlet = new LinkedList<Atlet>(); public static LinkedList<Competition> competitii = new LinkedList<Competition>(); public static LinkedList<Manager> managers = new LinkedList<Manager>(); public static Atlet player = new Atlet(); public static Data dataCurenta = new Data(1,1,2011); public static float recordMondial = 9.56f; public static String detinatorRecordMondial = "Usain Bolt, Jamaica"; public static Data dataStabiliriiWR = new Data(1,1,2011); public static String loculStabiliriiWR = ""; public staticData(int i) { super(); this.passedComp.clear(); } public staticData() { super(); this.athleteImport(); this.competitionsImport(); this.managersImport(); } void athleteImport() { this.atlet = dbImporting.parseAtletImport(); for (int i=0;i<this.atlet.size();i++) atlet.get(i).age = this.dataCurenta.an - atlet.get(i).dataNasterii.an; } void competitionsImport(){ this.competitii = dbImporting.parseCompetitionImport(); } public static void setNewWR(float f,Atlet a,Competition comp) { recordMondial = f; detinatorRecordMondial = a.firstName + " " + a.lastName + ", " + a.nationality; dataStabiliriiWR = dataCurenta; loculStabiliriiWR = comp.numeleConcursului+", "+comp.orasulConcursului; } void managersImport(){ managers = dbImporting.parseManagerImport(); for (int i=0;i<this.managers.size();i++) managers.get(i).age = this.dataCurenta.an - managers.get(i).dataNasterii.an; } }
100simulator
trunk/Client/src/BackendSimulation/staticData.java
Java
oos
1,970
package BackendSimulation; import java.util.LinkedList; import java.util.Random; public class AttributesCheck { static LinkedList<Integer> diff = new LinkedList<Integer>(); static Random generator = new Random(); public AttributesCheck() { super(); } public static void updateDaily(){ for (Atlet a : staticData.atlet) { a.acceleration += 0.03; a.speed += 0.03; a.pace += 0.03; a.reaction += 0.03; a.concentration += 0.03; a.currentAbility += 0.03; } } public static void setNewCA(){ int iter = 0; for (Atlet a : staticData.atlet) { diff.add(generator.nextInt(17)); if (a.currentAbility + diff.get(iter) < a.potentialAbility) a.currentAbility += diff.get(iter); else a.currentAbility = a.potentialAbility; } } public static void updateMonthly(){ float aux = 0f; int iter = 0; setNewCA(); for (Atlet a : staticData.atlet) { if (a.currentAbility != a.potentialAbility) { aux = generator.nextInt(10)/10; if ((a.acceleration + aux) > (a.currentAbility/10)) a.acceleration = a.currentAbility/10; else a.acceleration += aux; aux = generator.nextInt(10)/10; if ((a.speed + aux) > (a.currentAbility/10)) a.speed = a.currentAbility/10; else a.speed += aux; aux = generator.nextInt(10)/10; if ((a.pace + aux) > (a.currentAbility/10)) a.pace = a.currentAbility/10; else a.pace += aux; aux = generator.nextInt(10)/10; if ((a.reaction + aux) > (a.currentAbility/10)) a.reaction = a.currentAbility/10; else a.reaction += aux; aux = generator.nextInt(10)/10; if ((a.concentration + aux) > (a.currentAbility/10)) a.concentration = a.currentAbility/10; else a.concentration += aux; iter ++ ; } else { aux = generator.nextInt(10)/10; if ((a.acceleration + aux) > (a.currentAbility/10)) a.acceleration = a.currentAbility/10; else a.acceleration += aux; aux = generator.nextInt(10)/10; if ((a.speed + aux) > (a.currentAbility/10)) a.speed = a.currentAbility/10; else a.speed += aux; aux = generator.nextInt(10)/10; if ((a.pace + aux) > (a.currentAbility/10)) a.pace = a.currentAbility/10; else a.pace += aux; aux = generator.nextInt(10)/10; if ((a.reaction + aux) > (a.currentAbility/10)) a.reaction = a.currentAbility/10; else a.reaction += aux; aux = generator.nextInt(10)/10; if ((a.concentration + aux) > (a.currentAbility/10)) a.concentration = a.currentAbility/10; else a.concentration += aux; } } } }
100simulator
trunk/Client/src/BackendSimulation/AttributesCheck.java
Java
oos
4,118
package BackendSimulation; /* * The backend simulation page * */
100simulator
trunk/Client/src/BackendSimulation/package-info.java
Java
oos
74
package BackendSimulation; import java.util.LinkedList; public class Competition { public int uniqueID; public int clasa; public String[] numeClasa = {"Olympic Games","World Championships","Diamond League","World Athletics Series","Meeting"}; public int[] nrAtleti = {256,256,128,64,32}; public Data dataConcursului; public String numeleConcursului; public String orasulConcursului; public String taraConcursului; public float record; public Data dataRecordului; public String numeDetinator; public LinkedList<Integer> atletiInscrisi = new LinkedList<Integer>(); public LinkedList<LinkedList<Atlet>> rezultate ; public LinkedList<LinkedList<Atlet>> istoric ; public Competition(LinkedList<String> aux) { this.uniqueID = Integer.valueOf(aux.get(0)); this.clasa = Integer.valueOf(aux.get(1)); this.dataConcursului = new Data(Integer.valueOf(aux.get(2)),Integer.valueOf(aux.get(3)),Integer.valueOf(aux.get(4))); this.numeleConcursului = aux.get(5); this.orasulConcursului = aux.get(6); this.taraConcursului = aux.get(7); this.record = Float.valueOf(aux.get(8)); this.dataRecordului = new Data(Integer.valueOf(aux.get(9)),Integer.valueOf(aux.get(10)),Integer.valueOf(aux.get(11))); this.numeDetinator = aux.get(12); if (aux.get(13).contains("null")) { atletiInscrisi = null; } else { String[] s = aux.get(13).split(" "); for (String substr : s){ atletiInscrisi.add(Integer.valueOf(substr)); } } } public Competition() { super(); } public void setNewRecord(Atlet ath,float time,Data data) { this.record = time; this.dataRecordului = data; this.numeDetinator = ath.firstName + " " + ath.lastName; } }
100simulator
trunk/Client/src/BackendSimulation/Competition.java
Java
oos
2,075
package BackendSimulation; import java.util.LinkedList; public class Atlet { public int uniqueID; public float acceleration; public float speed; public float pace; public float reaction; public float concentration; public float fitness; public float morale; public float currentAbility; public float potentialAbility; public String firstName; public String lastName; public String nationality; public Data dataNasterii; public int age; public float personalBest; public float seasonBest; public Data personalBestDate; public String personalBestLocation; public Data seasonBestDate; public String seasonBestLocation; public Data dataFinalaContract; public int idManager; public float[] competitionTime = new float[7]; public LinkedList<Float> history = new LinkedList<Float>(); public Atlet(LinkedList<String> info) { this.uniqueID = Integer.valueOf(info.get(0)); this.acceleration = Float.valueOf(info.get(1)); this.speed = Float.valueOf(info.get(2)); this.pace = Float.valueOf(info.get(3)); this.reaction = Float.valueOf(info.get(4)); this.concentration = Float.valueOf(info.get(5)); this.fitness = Float.valueOf(info.get(6)); this.morale = Float.valueOf(info.get(7)); this.currentAbility = Float.valueOf(info.get(8)); this.potentialAbility = Float.valueOf(info.get(9)); this.firstName = info.get(10); this.lastName = info.get(11); this.nationality = info.get(12); this.dataNasterii = new Data(Integer.valueOf(info.get(13)),Integer.valueOf(info.get(14)),Integer.valueOf(info.get(15))); this.personalBest = Float.valueOf(info.get(16)); this.personalBestDate = new Data(Integer.valueOf(info.get(17)),Integer.valueOf(info.get(18)),Integer.valueOf(info.get(19))); this.personalBestLocation = info.get(20); this.seasonBest = Float.valueOf(info.get(21)); this.seasonBestDate = new Data(Integer.valueOf(info.get(22)),Integer.valueOf(info.get(23)),Integer.valueOf(info.get(24))); this.seasonBestLocation = info.get(25); if (info.get(26).contains("null") == false) { String[] s = info.get(26).split(" "); for (String str : s) { float aux = Float.valueOf(str); this.history.add(aux); } } } public Atlet() { super(); } public void setNewPersonalBest(float time,Competition comp){ this.personalBest = time; this.personalBestDate = comp.dataConcursului; this.personalBestLocation = comp.numeleConcursului + ", " + comp.orasulConcursului + ", " + comp.taraConcursului; } public void setNewSeasonBest(float time,Competition comp){ this.seasonBest = time; this.seasonBestDate = comp.dataConcursului; this.seasonBestLocation = comp.numeleConcursului + ", " + comp.orasulConcursului + ", " + comp.taraConcursului; } public void addResultsToHistory(){ for (int i=0;i<7;i++) if (this.competitionTime[i] != 0f) {history.add(this.competitionTime[i]);System.out.println("Timp : "+this.competitionTime[i]); } } }
100simulator
trunk/Client/src/BackendSimulation/Atlet.java
Java
oos
3,427
package BackendSimulation; import java.util.LinkedList; public class Manager { public int uniqueID; public String firstName; public String lastName; public String nationalitate; public Data dataNasterii; public int age; public LinkedList<Integer> idAtletiSubContract = new LinkedList<Integer>(); public float training; public float business; public float knowledge; public float renume; public float ability; public Manager(LinkedList<String> aux) { this.uniqueID = Integer.valueOf(aux.get(0)); this.firstName = aux.get(1); this.lastName = aux.get(2); this.nationalitate = aux.get(3); this.dataNasterii = new Data(Integer.valueOf(aux.get(4)),Integer.valueOf(aux.get(5)),Integer.valueOf(aux.get(6))); this.training = Float.valueOf(aux.get(7)); this.business = Float.valueOf(aux.get(8)); this.knowledge = Float.valueOf(aux.get(9)); this.renume = Float.valueOf(aux.get(10)); this.ability = Float.valueOf(aux.get(11)); if (aux.get(12).contains("null")) { this.idAtletiSubContract = null; } else { String[] s = aux.get(12).split(" "); for (int i=0;i<s.length;i++) this.idAtletiSubContract.add(Integer.valueOf(s[i])); } } public Manager() { super(); } }
100simulator
trunk/Client/src/BackendSimulation/Manager.java
Java
oos
1,539
package Main; import GUI.*; public class Main { public Main() { } public static void main(String args[]){ new GUI.Main(); } }
100simulator
trunk/Client/src/Main/Main.java
Java
oos
167
package com.busi.system.manager; import java.util.List; import org.hibernate.Criteria; import org.hibernate.criterion.Restrictions; import com.busi.framework.base.BaseManager; import com.busi.system.model.SystemPermission; public class SystemPermissionManager extends BaseManager{ }
100gd-compare
trunk/system/com/busi/system/manager/SystemPermissionManager.java
Java
epl
303
package com.busi.system.dao; import com.busi.framework.base.BaseDao; import com.busi.system.model.SystemPermission; public class SystemPermissionDao extends BaseDao{ public Class getEntityClass(){ return SystemPermission.class; } }
100gd-compare
trunk/system/com/busi/system/dao/SystemPermissionDao.java
Java
epl
253
package com.busi.framework.exception; public class CheckKeyWordException extends Exception { private static final long serialVersionUID = 1L; public CheckKeyWordException() { super(); } public CheckKeyWordException(String message, Throwable arg1) { super(message, arg1); } public CheckKeyWordException(String message) { super(message); } public CheckKeyWordException(Throwable message) { super(message); } }
100gd-compare
trunk/system/com/busi/framework/exception/CheckKeyWordException.java
Java
epl
492
package com.busi.framework.base.db; import java.sql.Connection; import java.sql.DriverManager; public class ConnectionPool { public static Connection getConnPool(){ Connection con = null; try{ Class.forName("org.logicalcobwebs.proxool.ProxoolDriver"); con = DriverManager.getConnection("proxool.dbname"); }catch(Exception e){ //con = JdbcConnection.getInstance1(); e.printStackTrace(); } return con; } public static void main(String[] args){ ConnectionPool.getConnPool(); } }
100gd-compare
trunk/system/com/busi/framework/base/db/ConnectionPool.java
Java
epl
530
package com.busi.framework.base.db; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.sql.DataSource; import org.jdom.Document; import org.jdom.Element; import org.jdom.input.SAXBuilder; import org.logicalcobwebs.proxool.configuration.PropertyConfigurator; import com.busi.framework.base.CC; import com.busi.system.password.PasswordUtil; public class JdbcConnection { private static Connection con = null; public static Connection getInstance1(){ if(con == null){ con = getConnection(); } return con; } private static Connection getConnection(){ Map map = parseDbXml(); //String url = "jdbc:oracle:thin:@192.168.0.94:1521:orcl"; //String url = "jdbc:oracle:thin:@127.0.0.1:1521:xe"; String url = PasswordUtil.getInstance().decryption((String)map.get("driver-url")); String username = PasswordUtil.getInstance().decryption((String)map.get("user")); String password = PasswordUtil.getInstance().decryption((String)map.get("password")); try{ Class.forName((String)map.get("driver-class")); con = DriverManager.getConnection(url , username , password); }catch(Exception e){ e.printStackTrace(); } return con; } private static Map parseDbXml(){ Map map = new HashMap(); String xmlPath = CC.REAL_PATH + "/WEB-INF/proxool.xml"; //String xmlPath = "E:\\hhdc\\hdjs\\web\\WebContent\\WEB-INF\\proxool.xml"; SAXBuilder builder = new SAXBuilder(false); try{ Document doc = builder.build(xmlPath); Element root= doc.getRootElement(); List listProxool = root.getChildren("proxool"); Element proxool = (Element)listProxool.get(0); map.put("driver-url", proxool.getChildText("driver-url")); map.put("driver-class", proxool.getChildText("driver-class")); Element driverProp = proxool.getChild("driver-properties"); List listProp = driverProp.getChildren(); for(int i = 0 ; i < listProp.size() ; i ++ ){ Element prop = (Element)listProp.get(i); String attributeValue = prop.getAttributeValue("name"); if(attributeValue.equals("user")){ map.put("user", prop.getAttributeValue("value")); } if(attributeValue.equals("password")){ map.put("password", prop.getAttributeValue("value")); } } }catch(Exception e){ e.printStackTrace(); } return map; } }
100gd-compare
trunk/system/com/busi/framework/base/db/JdbcConnection.java
Java
epl
2,581
package com.busi.framework.base; public interface Model { public String getLogField(); }
100gd-compare
trunk/system/com/busi/framework/base/Model.java
Java
epl
96
package com.busi.framework.base; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; public class HttpSessionTread { private static ThreadLocal tread = new ThreadLocal() { protected synchronized Object initialValue() { return new HttpSessionTread(); } }; public static HttpSessionTread get() { return (HttpSessionTread) tread.get(); } private HttpServletRequest httpServletRequest; private String loginUserName; public String getLoginUserName() { return loginUserName; } public void setLoginUserName(String loginUserName) { this.loginUserName = loginUserName; } public HttpServletRequest getHttpServletRequest() { return httpServletRequest; } public void setHttpServletRequest(HttpServletRequest httpServletRequest) { this.httpServletRequest = httpServletRequest; } }
100gd-compare
trunk/system/com/busi/framework/base/HttpSessionTread.java
Java
epl
882
package com.busi.framework.base; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import com.busi.system.dao.SystemDeptDao; import com.busi.system.dao.SystemMenuDao; import com.busi.system.dao.SystemMenuOperationDao; import com.busi.system.dao.SystemPermissionDao; import com.busi.system.dao.SystemUserDao; public class BaseManager{ protected final Log log = LogFactory.getLog(getClass()); public BaseDao baseDao; public SystemUserDao systemUserDao; public SystemMenuDao systemMenuDao; public SystemDeptDao systemDeptDao; public SystemMenuOperationDao systemOperationDao; public SystemPermissionDao systemPermissionDao; public SystemMenuDao getSystemMenuDao() { return systemMenuDao; } public void setSystemMenuDao(SystemMenuDao systemMenuDao) { this.systemMenuDao = systemMenuDao; } public SystemUserDao getSystemUserDao() { return systemUserDao; } public void setSystemUserDao(SystemUserDao systemUserDao) { this.systemUserDao = systemUserDao; } public BaseDao getBaseDao() { return baseDao; } public void setBaseDao(BaseDao baseDao) { this.baseDao = baseDao; } public SystemDeptDao getSystemDeptDao() { return systemDeptDao; } public void setSystemDeptDao(SystemDeptDao systemDeptDao) { this.systemDeptDao = systemDeptDao; } public SystemMenuOperationDao getSystemOperationDao() { return systemOperationDao; } public void setSystemOperationDao(SystemMenuOperationDao systemOperationDao) { this.systemOperationDao = systemOperationDao; } public SystemPermissionDao getSystemPermissionDao() { return systemPermissionDao; } public void setSystemPermissionDao(SystemPermissionDao systemPermissionDao) { this.systemPermissionDao = systemPermissionDao; } }
100gd-compare
trunk/system/com/busi/framework/base/BaseManager.java
Java
epl
1,822
package com.busi.framework.action; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.apache.struts.actions.DispatchAction; import com.busi.framework.base.CC; import com.busi.framework.base.HttpSessionTread; import com.busi.framework.exception.CheckKeyWordException; public class DispatchActionTread extends DispatchAction{ public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response){ ActionForward af = null; try{ String loginName = (String)request.getSession().getAttribute(CC.COMMON_LOGIN_NAME); HttpSessionTread.get().setLoginUserName(loginName); HttpSessionTread.get().setHttpServletRequest(request); af = super.execute(mapping, form, request, response); }catch(CheckKeyWordException kwe){ String loginUrl = CC.CTX + "/index.do?method=toInputErrorKey"; af = new ActionForward(loginUrl); af.setRedirect(true); }catch(Exception ne){ ne.printStackTrace(); //String loginUrl = CC.CTX + "/index.do?method=login"; //af = new ActionForward(loginUrl); //af.setRedirect(true); } return af; } }
100gd-compare
trunk/system/com/busi/framework/action/DispatchActionTread.java
Java
epl
1,372
package com.busi.framework.action; import java.util.HashMap; import java.util.Map; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import com.busi.utils.tools.StringTools; public class ParameterActionForward extends ActionMapping{ private ActionForward forward = null; private Map map = new HashMap(); public void setParam(String key , String value){ map.put(key, value); } public ParameterActionForward(ActionForward forward){ this.forward = forward; } public ActionForward findForwardParam(){ return replaceParamInPath(forward , map); } private ActionForward replaceParamInPath(ActionForward forward , Map map){ String path = StringTools.setParameters(forward.getPath() , map); ActionForward newForward = new ActionForward(); newForward.setPath(path); newForward.setRedirect(forward.getRedirect()); return newForward; } }
100gd-compare
trunk/system/com/busi/framework/action/ParameterActionForward.java
Java
epl
949
package com.busi.relevance; import java.util.ArrayList; import java.util.List; import javax.servlet.ServletConfig; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import org.jdom.Document; import org.jdom.Element; import org.jdom.input.SAXBuilder; import org.jdom.xpath.XPath; public class RelevanceXml extends HttpServlet { private final String xmlPath = "/WEB-INF/RelevanceConfig/relev_cfg.xml"; private static Element rootEle; private static RelevanceXml relevanceXml; public static RelevanceXml getInstance(){ if(relevanceXml == null){ relevanceXml = new RelevanceXml(); } return relevanceXml; } ServletConfig config; public ServletConfig getConfig() { return config; } public void setConfig(ServletConfig config) { this.config = config; } public void init(ServletConfig conf)throws ServletException{ this.config=conf; String strXmlPath = conf.getServletContext().getRealPath("/") + xmlPath; SAXBuilder sax = new SAXBuilder(); try{ Document doc = sax.build(strXmlPath); RelevanceXml.getInstance().rootEle = doc.getRootElement(); }catch(Exception e){ e.printStackTrace(); } } public List getSqlListByName(String name){ List list = new ArrayList(); try{ List<Element> listEle = RelevanceXml.getInstance().rootEle.getChildren(); for(Element e : listEle){ if(e.getAttribute("name").getValue().equals(name)){ List<Element> listSql = e.getChildren("hql"); for(Element esql : listSql){ list.add(esql.getTextTrim()); } } } }catch(Exception e){ e.printStackTrace(); } return list; } public static void main(String[] args) throws Exception{ RelevanceXml x = RelevanceXml.getInstance(); String path = "E:\\xf\\xfweb\\web\\xfweb\\WebContent\\WEB-INF\\RelevanceConfig\\relev_cfg.xml"; SAXBuilder sax = new SAXBuilder(); Document doc = sax.build(path); x.rootEle = doc.getRootElement(); x.getSqlListByName("templetId"); } }
100gd-compare
trunk/system/com/busi/relevance/RelevanceXml.java
Java
epl
2,177
package com.duying.gdc; import com.busi.framework.action.BaseAction; import com.duying.gdc.manager.GdMcCompareManager; import com.duying.gdc.manager.GdMcImportManager; import com.duying.gdc.manager.GdMcPersonManager; public class GdBaseAction extends BaseAction{ public GdMcImportManager gdMcImportManager; public GdMcPersonManager gdMcPersonManager; public GdMcCompareManager gdMcCompareManager; public GdMcPersonManager getGdMcPersonManager() { return gdMcPersonManager; } public GdMcCompareManager getGdMcCompareManager() { return gdMcCompareManager; } public void setGdMcCompareManager(GdMcCompareManager gdMcCompareManager) { this.gdMcCompareManager = gdMcCompareManager; } public void setGdMcPersonManager(GdMcPersonManager gdMcPersonManager) { this.gdMcPersonManager = gdMcPersonManager; } public GdMcImportManager getGdMcImportManager() { return gdMcImportManager; } public void setGdMcImportManager(GdMcImportManager gdMcImportManager) { this.gdMcImportManager = gdMcImportManager; } }
100gd-compare
trunk/gdc/com/duying/gdc/GdBaseAction.java
Java
epl
1,081
package com.duying.gdc.manager; import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.struts.upload.FormFile; import com.busi.framework.base.PageSupport; import com.busi.utils.tools.DateTools; import com.busi.utils.tools.StringTools; import com.duying.gdc.GdBaseManager; import com.duying.gdc.action.form.GdMcImportForm; import com.duying.gdc.model.GdMcImport; import com.duying.gdc.model.GdMcPerson; public class GdMcImportManager extends GdBaseManager{ public PageSupport getPage(Map map){ return this.gdMcImportDao.getPage(map); } public GdMcImport getObjByDate(Date adate){ String hql = "from GdMcImport gmi where gmi.import_date =:import_date"; Map map = new HashMap(); map.put("import_date", adate); Object obj = this.baseDao.getUniqueBy(hql, map); if(obj == null){ return null; }else{ return (GdMcImport)obj; } } public void saveToDb(GdMcImportForm gmiForm){ GdMcImport gmi = new GdMcImport(); gmi.setImport_date(DateTools.stringToDate(gmiForm.getStr_import_date(), DateTools.FULL_YM)); gmi.setGd_number(gmiForm.getGd_number()); gmi.setJg_number(gmiForm.getJg_number()); gmi.setJg_gp_number(gmiForm.getJg_gp_number()); this.baseDao.saveOrUpdateLog(gmi); Integer totalCgsl = 0; try{ FormFile ff = gmiForm.getFormFile(); InputStreamReader isr = new InputStreamReader(ff.getInputStream()); BufferedReader br = new BufferedReader(isr); String aline = br.readLine(); String[] cellValue; while(aline != null){ cellValue = aline.split(","); GdMcPerson gmp = new GdMcPerson(); gmp.setXh(StringTools.formatStr2Int(cellValue[0])); gmp.setZqzh(cellValue[1]); gmp.setGdmc(cellValue[2]); gmp.setZjhm(cellValue[3]); Integer cgsl = StringTools.formatStr2Int(cellValue[4]); totalCgsl += cgsl; gmp.setCgsl(cgsl); gmp.setCgbl(cellValue[5]); gmp.setGdMcImport(gmi); this.baseDao.saveOrUpdateLog(gmp); aline = br.readLine(); } }catch(Exception e){ e.printStackTrace(); } gmi.setGp_number(totalCgsl); this.baseDao.saveOrUpdateLog(gmi); } public List getLastThirteenImport(Date import_date){ String hql = "from GdMcImport gmi where gmi.import_date <=:import_date order by gmi.import_date desc"; Map map = new HashMap(); map.put("import_date", import_date); return this.baseDao.findPageByHql(hql, 13, 1, map).getItems(); } }
100gd-compare
trunk/gdc/com/duying/gdc/manager/GdMcImportManager.java
Java
epl
2,569
package com.duying.gdc.manager; import java.util.HashMap; import java.util.List; import java.util.Map; import com.duying.gdc.GdBaseManager; public class GdMcPersonManager extends GdBaseManager{ public List getByImportIdOrderByXH(Integer importId){ String hql = "from GdMcPerson gmp where gmp.gdMcImport.id =:importId order by gmp.xh asc"; Map map = new HashMap(); map.put("importId", importId); List list = this.baseDao.getByHQL(hql, map); return list; } public List getByImportIdOrderByZQZH(Integer importId){ String hql = "from GdMcPerson gmp where gmp.gdMcImport.id =:importId order by gmp.zqzh asc"; Map map = new HashMap(); map.put("importId", importId); List list = this.baseDao.getByHQL(hql, map); return list; } }
100gd-compare
trunk/gdc/com/duying/gdc/manager/GdMcPersonManager.java
Java
epl
780
package com.duying.gdc.dao; import java.util.Map; import org.hibernate.criterion.DetachedCriteria; import org.hibernate.criterion.Order; import com.busi.framework.base.BaseDao; import com.busi.framework.base.CC; import com.busi.framework.base.PageSupport; import com.busi.utils.tools.NumberTools; import com.duying.gdc.model.GdMcImport; public class GdMcImportDao extends BaseDao{ public Class getEntityClass(){ return GdMcImport.class; } public PageSupport getPage(Map map){ DetachedCriteria dc = DetachedCriteria.forClass(getEntityClass()); int pageSize = 0; int pageNo = 1; if(map != null){ Object objPageSize = map.get("pageSize"); if(objPageSize != null){ pageSize = NumberTools.formatObject2IntDefaultZeroNoExp(objPageSize); }else{ pageSize = CC.PAGE_SIZE; } Object objPageNo = map.get("pageNo"); if(objPageNo != null){ pageNo = NumberTools.formatObject2IntDefaultZeroNoExp(objPageNo); }else{ pageNo = 1; } } dc.addOrder(Order.desc("import_date")); return findPageByCriteria(dc , pageSize , pageNo); } }
100gd-compare
trunk/gdc/com/duying/gdc/dao/GdMcImportDao.java
Java
epl
1,128
package com.duying.gdc; import com.busi.framework.base.BaseManager; import com.duying.gdc.dao.GdMcImportDao; public class GdBaseManager extends BaseManager{ public GdMcImportDao gdMcImportDao; public GdMcImportDao getGdMcImportDao() { return gdMcImportDao; } public void setGdMcImportDao(GdMcImportDao gdMcImportDao) { this.gdMcImportDao = gdMcImportDao; } }
100gd-compare
trunk/gdc/com/duying/gdc/GdBaseManager.java
Java
epl
389
/* Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ body { /* Font */ font-family: Arial, Verdana, sans-serif; font-size: 12px; /* Text color */ color: #222; /* Remove the background color to make it transparent */ background-color: #fff; } html { /* #3658: [IE6] Editor document has horizontal scrollbar on long lines To prevent this misbehavior, we show the scrollbar always */ _overflow-y: scroll } img:-moz-broken { -moz-force-broken-image-icon : 1; width : 24px; height : 24px; } img, input, textarea { cursor: default; }
100gd-compare
trunk/WebContent/components/ckeditor/contents.css
CSS
epl
674
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license --> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Installation Guide - CKEditor</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <style type="text/css"> h3 { border-bottom: 1px solid #AAAAAA; } pre { background-color: #F9F9F9; border: 1px dashed #2F6FAB; padding: 1em; line-height: 1.1em; } #footer hr { margin: 10px 0 15px 0; height: 1px; border: solid 1px gray; border-bottom: none; } #footer p { margin: 0 10px 10px 10px; float: left; } #footer #copy { float: right; } </style> </head> <body> <h1> CKEditor Installation Guide</h1> <h3> What&#39;s CKEditor?</h3> <p> CKEditor is a text editor to be used inside web pages. It&#39;s not a replacement for desktop text editors like Word or OpenOffice, but a component to be used as part of web applications and web sites.</p> <h3> Installation</h3> <p> Installing CKEditor is an easy task. Just follow these simple steps:</p> <ol> <li><strong>Download</strong> the latest version of the editor from our web site: <a href="http://ckeditor.com">http://ckeditor.com</a>. You should have already completed this step, but be sure you have the very latest version.</li> <li><strong>Extract</strong> (decompress) the downloaded file into the root of your web site.</li> </ol> <p> <strong>Note:</strong> CKEditor is by default installed in the &quot;ckeditor&quot; folder. You can place the files in whichever you want though.</p> <h3> Checking Your Installation </h3> <p> The editor comes with a few sample pages that can be used to verify that installation proceeded properly. Take a look at the <a href="_samples">_samples</a> directory.</p> <p> To test your installation, just call the following page at your web site:</p> <pre> http://&lt;your site&gt;/&lt;CKEditor installation path&gt;/_samples/index.html For example: http://www.example.com/ckeditor/_samples/index.html</pre> <h3> Documentation</h3> <p> The full editor documentation is available online at the following address:<br /> <a href="http://docs.cksource.com/ckeditor">http://docs.cksource.com/ckeditor</a></p> <div id="footer"> <hr /> <p> CKEditor - The text editor for Internet - <a href="http://ckeditor.com/">http://ckeditor.com</a> </p> <p id="copy"> Copyright &copy; 2003-2010, <a href="http://cksource.com/">CKSource</a> - Frederico Knabben. All rights reserved. </p> </div> </body> </html>
100gd-compare
trunk/WebContent/components/ckeditor/INSTALL.html
HTML
epl
2,859
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <!-- Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license --> <html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script type="text/javascript"> function gup( name ) { name = name.replace( /[\[]/, '\\\[' ).replace( /[\]]/, '\\\]' ) ; var regexS = '[\\?&]' + name + '=([^&#]*)' ; var regex = new RegExp( regexS ) ; var results = regex.exec( window.location.href ) ; if ( results ) return results[ 1 ] ; else return '' ; } var interval; function sendData2Master() { var destination = window.parent.parent ; try { if ( destination.XDTMaster ) { var t = destination.XDTMaster.read( [ gup( 'cmd' ), gup( 'data' ) ] ) ; window.clearInterval( interval ) ; } } catch (e) {} } function onLoad() { interval = window.setInterval( sendData2Master, 100 ); } </script> </head> <body onload="onLoad()"><p></p></body> </html>
100gd-compare
trunk/WebContent/components/ckeditor/plugins/wsc/dialogs/ciframe.html
HTML
epl
1,120
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"> <!-- Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license --> <html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script type="text/javascript"> function doLoadScript( url ) { if ( !url ) return false ; var s = document.createElement( "script" ) ; s.type = "text/javascript" ; s.src = url ; document.getElementsByTagName( "head" )[ 0 ].appendChild( s ) ; return true ; } var opener; function tryLoad() { opener = window.parent; // get access to global parameters var oParams = window.opener.oldFramesetPageParams; // make frameset rows string prepare var sFramesetRows = ( parseInt( oParams.firstframeh, 10 ) || '30') + ",*," + ( parseInt( oParams.thirdframeh, 10 ) || '150' ) + ',0' ; document.getElementById( 'itFrameset' ).rows = sFramesetRows ; // dynamic including init frames and crossdomain transport code // from config sproxy_js_frameset url var addScriptUrl = oParams.sproxy_js_frameset ; doLoadScript( addScriptUrl ) ; } </script> </head> <frameset id="itFrameset" onload="tryLoad();" border="0" rows="30,*,*,0"> <frame scrolling="no" framespacing="0" frameborder="0" noresize="noresize" marginheight="0" marginwidth="2" src="" name="navbar"></frame> <frame scrolling="auto" framespacing="0" frameborder="0" noresize="noresize" marginheight="0" marginwidth="0" src="" name="mid"></frame> <frame scrolling="no" framespacing="0" frameborder="0" noresize="noresize" marginheight="1" marginwidth="1" src="" name="bot"></frame> <frame scrolling="no" framespacing="0" frameborder="0" noresize="noresize" marginheight="1" marginwidth="1" src="" name="spellsuggestall"></frame> </frameset> </html>
100gd-compare
trunk/WebContent/components/ckeditor/plugins/wsc/dialogs/tmpFrameset.html
HTML
epl
1,935
/* Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.plugins.add('uicolor',{requires:['dialog'],lang:['en'],init:function(a){if(CKEDITOR.env.ie6Compat)return;a.addCommand('uicolor',new CKEDITOR.dialogCommand('uicolor'));a.ui.addButton('UIColor',{label:a.lang.uicolor.title,command:'uicolor',icon:this.path+'uicolor.gif'});CKEDITOR.dialog.add('uicolor',this.path+'dialogs/uicolor.js');CKEDITOR.scriptLoader.load(CKEDITOR.getUrl('plugins/uicolor/yui/yui.js'));a.element.getDocument().appendStyleSheet(CKEDITOR.getUrl('plugins/uicolor/yui/assets/yui.css'));}});
100gd-compare
trunk/WebContent/components/ckeditor/plugins/uicolor/plugin.js
JavaScript
epl
670
/* Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.plugins.setLang('uicolor','en',{uicolor:{title:'UI Color Picker',preview:'Live preview',config:'Paste this string into your config.js file',predefined:'Predefined color sets'}});
100gd-compare
trunk/WebContent/components/ckeditor/plugins/uicolor/lang/en.js
JavaScript
epl
343
/* Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */
100gd-compare
trunk/WebContent/components/ckeditor/plugins/dialog/dialogDefinition.js
JavaScript
epl
152
/* Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.editorConfig = function( config ) { config.language = 'zh-cn';//中文 config.uiColor = '#BFEE62';//编辑器颜色 config.font_names = '宋体;楷体_GB2312;新宋体;黑体;隶书;幼圆;微软雅黑;Arial;Comic Sans MS;Courier New;Tahoma;Times New Roman;Verdana'; config.skin = 'v2'; //config.width =771;//宽度 //config.height = 250;//高度 config.toolbar_Full =[['Undo','Redo','Source','Preview','Table','-','FontName','FontSize','-','Image','-','Bold','Italic','Underline','-','JustifyLeft','JustifyCenter','JustifyRight','-','Link','Unlink','-','TextColor','BGColor','-','PasteText','PasteWord','-','RemoveFormat','Maximize']]; //config.toolbar_Basic =[['Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink','-','About']]; config.pasteFromWordPromptCleanup = true; };
100gd-compare
trunk/WebContent/components/ckeditor/config.js
JavaScript
epl
1,026
<?php /* * Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.html or http://ckeditor.com/license */ /** * \brief CKEditor class that can be used to create editor * instances in PHP pages on server side. * @see http://ckeditor.com * * Sample usage: * @code * $CKEditor = new CKEditor(); * $CKEditor->editor("editor1", "<p>Initial value.</p>"); * @endcode */ class CKEditor { /** * The version of %CKEditor. * \private */ var $version = '3.2'; /** * A constant string unique for each release of %CKEditor. * \private */ var $_timestamp = 'A1QD'; /** * URL to the %CKEditor installation directory (absolute or relative to document root). * If not set, CKEditor will try to guess it's path. * * Example usage: * @code * $CKEditor->basePath = '/ckeditor/'; * @endcode */ var $basePath; /** * An array that holds the global %CKEditor configuration. * For the list of available options, see http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html * * Example usage: * @code * $CKEditor->config['height'] = 400; * // Use @@ at the beggining of a string to ouput it without surrounding quotes. * $CKEditor->config['width'] = '@@screen.width * 0.8'; * @endcode */ var $config = array(); /** * A boolean variable indicating whether CKEditor has been initialized. * Set it to true only if you have already included * &lt;script&gt; tag loading ckeditor.js in your website. */ var $initialized = false; /** * Boolean variable indicating whether created code should be printed out or returned by a function. * * Example 1: get the code creating %CKEditor instance and print it on a page with the "echo" function. * @code * $CKEditor = new CKEditor(); * $CKEditor->returnOutput = true; * $code = $CKEditor->editor("editor1", "<p>Initial value.</p>"); * echo "<p>Editor 1:</p>"; * echo $code; * @endcode */ var $returnOutput = false; /** * An array with textarea attributes. * * When %CKEditor is created with the editor() method, a HTML &lt;textarea&gt; element is created, * it will be displayed to anyone with JavaScript disabled or with incompatible browser. */ var $textareaAttributes = array( "rows" => 8, "cols" => 60 ); /** * A string indicating the creation date of %CKEditor. * Do not change it unless you want to force browsers to not use previously cached version of %CKEditor. */ var $timestamp = "A1QD"; /** * An array that holds event listeners. * \private */ var $_events = array(); /** * An array that holds global event listeners. * \private */ var $_globalEvents = array(); /** * Main Constructor. * * @param $basePath (string) URL to the %CKEditor installation directory (optional). */ function CKEditor($basePath = null) { if (!empty($basePath)) { $this->basePath = $basePath; } } /** * Creates a %CKEditor instance. * In incompatible browsers %CKEditor will downgrade to plain HTML &lt;textarea&gt; element. * * @param $name (string) Name of the %CKEditor instance (this will be also the "name" attribute of textarea element). * @param $value (string) Initial value (optional). * @param $config (array) The specific configurations to apply to this editor instance (optional). * @param $events (array) Event listeners for this editor instance (optional). * * Example usage: * @code * $CKEditor = new CKEditor(); * $CKEditor->editor("field1", "<p>Initial value.</p>"); * @endcode * * Advanced example: * @code * $CKEditor = new CKEditor(); * $config = array(); * $config['toolbar'] = array( * array( 'Source', '-', 'Bold', 'Italic', 'Underline', 'Strike' ), * array( 'Image', 'Link', 'Unlink', 'Anchor' ) * ); * $events['instanceReady'] = 'function (ev) { * alert("Loaded: " + ev.editor.name); * }'; * $CKEditor->editor("field1", "<p>Initial value.</p>", $config, $events); * @endcode */ function editor($name, $value = "", $config = array(), $events = array()) { $attr = ""; foreach ($this->textareaAttributes as $key => $val) { $attr.= " " . $key . '="' . str_replace('"', '&quot;', $val) . '"'; } $out = "<textarea name=\"" . $name . "\"" . $attr . ">" . htmlspecialchars($value) . "</textarea>\n"; if (!$this->initialized) { $out .= $this->init(); } $_config = $this->configSettings($config, $events); $js = $this->returnGlobalEvents(); if (!empty($_config)) $js .= "CKEDITOR.replace('".$name."', ".$this->jsEncode($_config).");"; else $js .= "CKEDITOR.replace('".$name."');"; $out .= $this->script($js); if (!$this->returnOutput) { print $out; $out = ""; } return $out; } /** * Replaces a &lt;textarea&gt; with a %CKEditor instance. * * @param $id (string) The id or name of textarea element. * @param $config (array) The specific configurations to apply to this editor instance (optional). * @param $events (array) Event listeners for this editor instance (optional). * * Example 1: adding %CKEditor to &lt;textarea name="article"&gt;&lt;/textarea&gt; element: * @code * $CKEditor = new CKEditor(); * $CKEditor->replace("article"); * @endcode */ function replace($id, $config = array(), $events = array()) { $out = ""; if (!$this->initialized) { $out .= $this->init(); } $_config = $this->configSettings($config, $events); $js = $this->returnGlobalEvents(); if (!empty($_config)) { $js .= "CKEDITOR.replace('".$id."', ".$this->jsEncode($_config).");"; } else { $js .= "CKEDITOR.replace('".$id."');"; } $out .= $this->script($js); if (!$this->returnOutput) { print $out; $out = ""; } return $out; } /** * Replace all &lt;textarea&gt; elements available in the document with editor instances. * * @param $className (string) If set, replace all textareas with class className in the page. * * Example 1: replace all &lt;textarea&gt; elements in the page. * @code * $CKEditor = new CKEditor(); * $CKEditor->replaceAll(); * @endcode * * Example 2: replace all &lt;textarea class="myClassName"&gt; elements in the page. * @code * $CKEditor = new CKEditor(); * $CKEditor->replaceAll( 'myClassName' ); * @endcode */ function replaceAll($className = null) { $out = ""; if (!$this->initialized) { $out .= $this->init(); } $_config = $this->configSettings(); $js = $this->returnGlobalEvents(); if (empty($_config)) { if (empty($className)) { $js .= "CKEDITOR.replaceAll();"; } else { $js .= "CKEDITOR.replaceAll('".$className."');"; } } else { $classDetection = ""; $js .= "CKEDITOR.replaceAll( function(textarea, config) {\n"; if (!empty($className)) { $js .= " var classRegex = new RegExp('(?:^| )' + '". $className ."' + '(?:$| )');\n"; $js .= " if (!classRegex.test(textarea.className))\n"; $js .= " return false;\n"; } $js .= " CKEDITOR.tools.extend(config, ". $this->jsEncode($_config) .", true);"; $js .= "} );"; } $out .= $this->script($js); if (!$this->returnOutput) { print $out; $out = ""; } return $out; } /** * Adds event listener. * Events are fired by %CKEditor in various situations. * * @param $event (string) Event name. * @param $javascriptCode (string) Javascript anonymous function or function name. * * Example usage: * @code * $CKEditor->addEventHandler('instanceReady', 'function (ev) { * alert("Loaded: " + ev.editor.name); * }'); * @endcode */ function addEventHandler($event, $javascriptCode) { if (!isset($this->_events[$event])) { $this->_events[$event] = array(); } // Avoid duplicates. if (!in_array($javascriptCode, $this->_events[$event])) { $this->_events[$event][] = $javascriptCode; } } /** * Clear registered event handlers. * Note: this function will have no effect on already created editor instances. * * @param $event (string) Event name, if not set all event handlers will be removed (optional). */ function clearEventHandlers($event = null) { if (!empty($event)) { $this->_events[$event] = array(); } else { $this->_events = array(); } } /** * Adds global event listener. * * @param $event (string) Event name. * @param $javascriptCode (string) Javascript anonymous function or function name. * * Example usage: * @code * $CKEditor->addGlobalEventHandler('dialogDefinition', 'function (ev) { * alert("Loading dialog: " + ev.data.name); * }'); * @endcode */ function addGlobalEventHandler($event, $javascriptCode) { if (!isset($this->_globalEvents[$event])) { $this->_globalEvents[$event] = array(); } // Avoid duplicates. if (!in_array($javascriptCode, $this->_globalEvents[$event])) { $this->_globalEvents[$event][] = $javascriptCode; } } /** * Clear registered global event handlers. * Note: this function will have no effect if the event handler has been already printed/returned. * * @param $event (string) Event name, if not set all event handlers will be removed (optional). */ function clearGlobalEventHandlers($event = null) { if (!empty($event)) { $this->_globalEvents[$event] = array(); } else { $this->_globalEvents = array(); } } /** * Prints javascript code. * \private * * @param string $js */ function script($js) { $out = "<script type=\"text/javascript\">"; $out .= "//<![CDATA[\n"; $out .= $js; $out .= "\n//]]>"; $out .= "</script>\n"; return $out; } /** * Returns the configuration array (global and instance specific settings are merged into one array). * \private * * @param $config (array) The specific configurations to apply to editor instance. * @param $events (array) Event listeners for editor instance. */ function configSettings($config = array(), $events = array()) { $_config = $this->config; $_events = $this->_events; if (is_array($config) && !empty($config)) { $_config = array_merge($_config, $config); } if (is_array($events) && !empty($events)) { foreach ($events as $eventName => $code) { if (!isset($_events[$eventName])) { $_events[$eventName] = array(); } if (!in_array($code, $_events[$eventName])) { $_events[$eventName][] = $code; } } } if (!empty($_events)) { foreach($_events as $eventName => $handlers) { if (empty($handlers)) { continue; } else if (count($handlers) == 1) { $_config['on'][$eventName] = '@@'.$handlers[0]; } else { $_config['on'][$eventName] = '@@function (ev){'; foreach ($handlers as $handler => $code) { $_config['on'][$eventName] .= '('.$code.')(ev);'; } $_config['on'][$eventName] .= '}'; } } } return $_config; } /** * Return global event handlers. * \private */ function returnGlobalEvents() { static $returnedEvents; $out = ""; if (!isset($returnedEvents)) { $returnedEvents = array(); } if (!empty($this->_globalEvents)) { foreach ($this->_globalEvents as $eventName => $handlers) { foreach ($handlers as $handler => $code) { if (!isset($returnedEvents[$eventName])) { $returnedEvents[$eventName] = array(); } // Return only new events if (!in_array($code, $returnedEvents[$eventName])) { $out .= ($code ? "\n" : "") . "CKEDITOR.on('". $eventName ."', $code);"; $returnedEvents[$eventName][] = $code; } } } } return $out; } /** * Initializes CKEditor (executed only once). * \private */ function init() { static $initComplete; $out = ""; if (!empty($initComplete)) { return ""; } if ($this->initialized) { $initComplete = true; return ""; } $args = ""; $ckeditorPath = $this->ckeditorPath(); if (!empty($this->timestamp) && $this->timestamp != "%"."TIMESTAMP%") { $args = '?t=' . $this->timestamp; } // Skip relative paths... if (strpos($ckeditorPath, '..') !== 0) { $out .= $this->script("window.CKEDITOR_BASEPATH='". $ckeditorPath ."';"); } $out .= "<script type=\"text/javascript\" src=\"" . $ckeditorPath . 'ckeditor.js' . $args . "\"></script>\n"; $extraCode = ""; if ($this->timestamp != $this->_timestamp) { $extraCode .= ($extraCode ? "\n" : "") . "CKEDITOR.timestamp = '". $this->timestamp ."';"; } if ($extraCode) { $out .= $this->script($extraCode); } $initComplete = $this->initialized = true; return $out; } /** * Return path to ckeditor.js. * \private */ function ckeditorPath() { if (!empty($this->basePath)) { return $this->basePath; } /** * The absolute pathname of the currently executing script. * Note: If a script is executed with the CLI, as a relative path, such as file.php or ../file.php, * $_SERVER['SCRIPT_FILENAME'] will contain the relative path specified by the user. */ if (isset($_SERVER['SCRIPT_FILENAME'])) { $realPath = dirname($_SERVER['SCRIPT_FILENAME']); } else { /** * realpath — Returns canonicalized absolute pathname */ $realPath = realpath( './' ) ; } /** * The filename of the currently executing script, relative to the document root. * For instance, $_SERVER['PHP_SELF'] in a script at the address http://example.com/test.php/foo.bar * would be /test.php/foo.bar. */ $selfPath = dirname($_SERVER['PHP_SELF']); $file = str_replace("\\", "/", __FILE__); if (!$selfPath || !$realPath || !$file) { return "/ckeditor/"; } $documentRoot = substr($realPath, 0, strlen($realPath) - strlen($selfPath)); $fileUrl = substr($file, strlen($documentRoot)); $ckeditorUrl = str_replace("ckeditor_php5.php", "", $fileUrl); return $ckeditorUrl; } /** * This little function provides a basic JSON support. * http://php.net/manual/en/function.json-encode.php * \private * * @param mixed $val * @return string */ function jsEncode($val) { if (is_null($val)) { return 'null'; } if ($val === false) { return 'false'; } if ($val === true) { return 'true'; } if (is_scalar($val)) { if (is_float($val)) { // Always use "." for floats. $val = str_replace(",", ".", strval($val)); } // Use @@ to not use quotes when outputting string value if (strpos($val, '@@') === 0) { return substr($val, 2); } else { // All scalars are converted to strings to avoid indeterminism. // PHP's "1" and 1 are equal for all PHP operators, but // JS's "1" and 1 are not. So if we pass "1" or 1 from the PHP backend, // we should get the same result in the JS frontend (string). // Character replacements for JSON. static $jsonReplaces = array(array("\\", "/", "\n", "\t", "\r", "\b", "\f", '"'), array('\\\\', '\\/', '\\n', '\\t', '\\r', '\\b', '\\f', '\"')); $val = str_replace($jsonReplaces[0], $jsonReplaces[1], $val); return '"' . $val . '"'; } } $isList = true; for ($i = 0, reset($val); $i < count($val); $i++, next($val)) { if (key($val) !== $i) { $isList = false; break; } } $result = array(); if ($isList) { foreach ($val as $v) $result[] = $this->jsEncode($v); return '[ ' . join(', ', $result) . ' ]'; } else { foreach ($val as $k => $v) $result[] = $this->jsEncode($k).': '.$this->jsEncode($v); return '{ ' . join(', ', $result) . ' }'; } } }
100gd-compare
trunk/WebContent/components/ckeditor/ckeditor_php4.php
PHP
epl
15,980
/* Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ // Compressed version of core/ckeditor_base.js. See original for instructions. /*jsl:ignore*/ if(!window.CKEDITOR)window.CKEDITOR=(function(){var a={timestamp:'',version:'3.2',revision:'5205',_:{},status:'unloaded',basePath:(function(){var d=window.CKEDITOR_BASEPATH||'';if(!d){var e=document.getElementsByTagName('script');for(var f=0;f<e.length;f++){var g=e[f].src.match(/(^|.*[\\\/])ckeditor(?:_basic)?(?:_source)?.js(?:\?.*)?$/i);if(g){d=g[1];break;}}}if(d.indexOf('://')==-1)if(d.indexOf('/')===0)d=location.href.match(/^.*?:\/\/[^\/]*/)[0]+d;else d=location.href.match(/^[^\?]*\/(?:)/)[0]+d;return d;})(),getUrl:function(d){if(d.indexOf('://')==-1&&d.indexOf('/')!==0)d=this.basePath+d;if(this.timestamp&&d.charAt(d.length-1)!='/')d+=(d.indexOf('?')>=0?'&':'?')+('t=')+this.timestamp;return d;}},b=window.CKEDITOR_GETURL;if(b){var c=a.getUrl;a.getUrl=function(d){return b.call(a,d)||c.call(a,d);};}return a;})(); /*jsl:end*/ // Uncomment the following line to have a new timestamp generated for each // request, having clear cache load of the editor code. // CKEDITOR.timestamp = ( new Date() ).valueOf(); if ( CKEDITOR.loader ) CKEDITOR.loader.load( 'core/ckeditor' ); else { // Set the script name to be loaded by the loader. CKEDITOR._autoLoad = 'core/ckeditor'; // Include the loader script. document.write( '<script type="text/javascript" src="' + CKEDITOR.getUrl( '_source/core/loader.js' ) + '"></script>' ); }
100gd-compare
trunk/WebContent/components/ckeditor/ckeditor_source.js
JavaScript
epl
1,608
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license --> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Ajax - CKEditor Sample</title> <meta content="text/html; charset=utf-8" http-equiv="content-type" /> <script type="text/javascript" src="../ckeditor.js"></script> <script src="sample.js" type="text/javascript"></script> <link href="sample.css" rel="stylesheet" type="text/css" /> <script type="text/javascript"> //<![CDATA[ var editor; function createEditor() { if ( editor ) return; var html = document.getElementById( 'editorcontents' ).innerHTML; // Create a new editor inside the <div id="editor"> editor = CKEDITOR.appendTo( 'editor' ); editor.setData( html ); // This sample may break here if the ckeditor_basic.js is used. In such case, the following code should be used instead: /* if ( editor.setData ) editor.setData( html ); else { CKEDITOR.on( 'loaded', function() { editor.setData( html ); }); } */ } function removeEditor() { if ( !editor ) return; // Retrieve the editor contents. In an Ajax application, this data would be // sent to the server or used in any other way. document.getElementById( 'editorcontents' ).innerHTML = editor.getData(); document.getElementById( 'contents' ).style.display = ''; // Destroy the editor. editor.destroy(); editor = null; } //]]> </script> </head> <body> <h1> CKEditor Sample </h1> <!-- This <div> holds alert messages to be display in the sample page. --> <div id="alerts"> <noscript> <p> <strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript support, like yours, you should still see the contents (HTML data) and you should be able to edit it normally, without a rich editor interface. </p> </noscript> </div> <p> <input onclick="createEditor();" type="button" value="Create Editor" /> <input onclick="removeEditor();" type="button" value="Remove Editor" /> </p> <!-- This div will hold the editor. --> <div id="editor"> </div> <div id="contents" style="display: none"> <p> Edited Contents:</p> <!-- This div will be used to display the editor contents. --> <div id="editorcontents"> </div> </div> <div id="footer"> <hr /> <p> CKEditor - The text editor for Internet - <a href="http://ckeditor.com/">http://ckeditor.com</a> </p> <p id="copy"> Copyright &copy; 2003-2010, <a href="http://cksource.com/">CKSource</a> - Frederico Knabben. All rights reserved. </p> </div> </body> </html>
100gd-compare
trunk/WebContent/components/ckeditor/_samples/ajax.html
HTML
epl
2,828
/* Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.dialog.add( 'myDialog', function( editor ) { return { title : 'My Dialog', minWidth : 400, minHeight : 200, contents : [ { id : 'tab1', label : 'First Tab', title : 'First Tab', elements : [ { id : 'input1', type : 'text', label : 'Input 1' } ] } ] }; } );
100gd-compare
trunk/WebContent/components/ckeditor/_samples/api_dialog/my_dialog.js
JavaScript
epl
513
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license --> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Shared toolbars - CKEditor Sample</title> <meta content="text/html; charset=utf-8" http-equiv="content-type" /> <script type="text/javascript" src="../ckeditor.js"></script> <script src="sample.js" type="text/javascript"></script> <link href="sample.css" rel="stylesheet" type="text/css" /> <style id="styles" type="text/css"> #editorsForm { height: 400px; overflow: auto; border: solid 1px #555; margin: 10px 0; padding: 0 10px; } </style> </head> <body> <h1> CKEditor Sample </h1> <!-- This <div> holds alert messages to be display in the sample page. --> <div id="alerts"> <noscript> <p> <strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript support, like yours, you should still see the contents (HTML data) and you should be able to edit it normally, without a rich editor interface. </p> </noscript> </div> <div id="topSpace"> </div> <form action="sample_posteddata.php" id="editorsForm" method="post"> <p> <label for="editor1"> Editor 1 (uses the shared toolbar and element path):</label><br /> <textarea cols="80" id="editor1" name="editor1" rows="10">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea> </p> <p> <label for="editor2"> Editor 2 (uses the shared toolbar and element path):</label><br /> <textarea cols="80" id="editor2" name="editor2" rows="10">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea> </p> <p> <label for="editor3"> Editor 3 (uses the shared toolbar only):</label><br /> <textarea cols="80" id="editor3" name="editor3" rows="10">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea> </p> <p> <label for="editor4"> Editor 4 (no shared spaces):</label><br /> <textarea cols="80" id="editor4" name="editor4" rows="10">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea> </p> <p> <input type="submit" value="Submit" /> </p> </form> <div id="bottomSpace"> </div> <div id="footer"> <hr /> <p> CKEditor - The text editor for Internet - <a href="http://ckeditor.com/">http://ckeditor.com</a> </p> <p id="copy"> Copyright &copy; 2003-2010, <a href="http://cksource.com/">CKSource</a> - Frederico Knabben. All rights reserved. </p> </div> <script type="text/javascript"> //<![CDATA[ // Create all editor instances at the end of the page, so we are sure // that the "bottomSpace" div is available in the DOM (IE issue). CKEDITOR.replace( 'editor1', { sharedSpaces : { top : 'topSpace', bottom : 'bottomSpace' }, // Removes the maximize plugin as it's not usable // in a shared toolbar. // Removes the resizer as it's not usable in a // shared elements path. removePlugins : 'maximize,resize' } ); CKEDITOR.replace( 'editor2', { sharedSpaces : { top : 'topSpace', bottom : 'bottomSpace' }, // Removes the maximize plugin as it's not usable // in a shared toolbar. // Removes the resizer as it's not usable in a // shared elements path. removePlugins : 'maximize,resize' } ); CKEDITOR.replace( 'editor3', { sharedSpaces : { top : 'topSpace' }, // Removes the maximize plugin as it's not usable // in a shared toolbar. removePlugins : 'maximize' } ); CKEDITOR.replace( 'editor4' ); //]]> </script> </body> </html>
100gd-compare
trunk/WebContent/components/ckeditor/_samples/sharedspaces.html
HTML
epl
4,244
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license --> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Replace Textarea by Code - CKEditor Sample</title> <meta content="text/html; charset=utf-8" http-equiv="content-type" /> <script type="text/javascript" src="../ckeditor.js"></script> <script src="sample.js" type="text/javascript"></script> <link href="sample.css" rel="stylesheet" type="text/css" /> </head> <body> <h1> CKEditor Sample </h1> <!-- This <div> holds alert messages to be display in the sample page. --> <div id="alerts"> <noscript> <p> <strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript support, like yours, you should still see the contents (HTML data) and you should be able to edit it normally, without a rich editor interface. </p> </noscript> </div> <form action="sample_posteddata.php" method="post"> <p> <label for="editor1"> Editor 1:</label><br /> <textarea cols="20" id="editor1" name="editor1" rows="10">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea> <script type="text/javascript"> //<![CDATA[ // This call can be placed at any point after the // <textarea>, or inside a <head><script> in a // window.onload event handler. // Replace the <textarea id="editor"> with an CKEditor // instance, using default configurations. CKEDITOR.replace( 'editor1' ); //]]> </script> </p> <p> <label for="editor2"> Editor 2:</label><br /> <textarea cols="80" id="editor2" name="editor2" rows="10">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea> <script type="text/javascript"> //<![CDATA[ // This call can be placed at any point after the // <textarea>, or inside a <head><script> in a // window.onload event handler. // Replace the <textarea id="editor"> with an CKEditor // instance, using default configurations. CKEDITOR.replace( 'editor2' ); //]]> </script> </p> <p> <input type="submit" value="Submit" /> </p> </form> <div id="footer"> <hr /> <p> CKEditor - The text editor for Internet - <a href="http://ckeditor.com/">http://ckeditor.com</a> </p> <p id="copy"> Copyright &copy; 2003-2010, <a href="http://cksource.com/">CKSource</a> - Frederico Knabben. All rights reserved. </p> </div> </body> </html>
100gd-compare
trunk/WebContent/components/ckeditor/_samples/replacebycode.html
HTML
epl
2,851
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license --> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>User Interface Globalization - CKEditor Sample</title> <meta content="text/html; charset=utf-8" http-equiv="content-type" /> <script type="text/javascript" src="../ckeditor.js"></script> <script type="text/javascript" src="../lang/_languages.js"></script> <script src="sample.js" type="text/javascript"></script> <link href="sample.css" rel="stylesheet" type="text/css" /> </head> <body> <h1> CKEditor Sample </h1> <!-- This <div> holds alert messages to be display in the sample page. --> <div id="alerts"> <noscript> <p> <strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript support, like yours, you should still see the contents (HTML data) and you should be able to edit it normally, without a rich editor interface. </p> </noscript> </div> <form action="sample_posteddata.php" method="post"> <p> <label for="editor1"> Available languages (<span id="count"> </span>languages!):</label><br /> <script type="text/javascript"> //<![CDATA[ document.write( '<select disabled="disabled" id="languages" onchange="createEditor( this.value );">' ); // Get the language list from the _languages.js file. for ( var i = 0 ; i < window.CKEDITOR_LANGS.length ; i++ ) { document.write( '<option value="' + window.CKEDITOR_LANGS[i].code + '">' + window.CKEDITOR_LANGS[i].name + '</option>' ); } document.write( '</select>' ); //]]> </script> <br /> <span style="color: #888888">(You may see strange characters if your system doesn't support the selected language)</span> </p> <p> <textarea cols="80" id="editor1" name="editor1" rows="10">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea> <script type="text/javascript"> //<![CDATA[ // Set the number of languages. document.getElementById( 'count' ).innerHTML = window.CKEDITOR_LANGS.length; var editor; function createEditor( languageCode ) { if ( editor ) editor.destroy(); // Replace the <textarea id="editor"> with an CKEditor // instance, using default configurations. editor = CKEDITOR.replace( 'editor1', { language : languageCode, on : { instanceReady : function() { // Wait for the editor to be ready to set // the language combo. var languages = document.getElementById( 'languages' ); languages.value = this.langCode; languages.disabled = false; } } } ); } // At page startup, load the default language: createEditor( '' ); //]]> </script> </p> </form> <div id="footer"> <hr /> <p> CKEditor - The text editor for Internet - <a href="http://ckeditor.com/">http://ckeditor.com</a> </p> <p id="copy"> Copyright &copy; 2003-2010, <a href="http://cksource.com/">CKSource</a> - Frederico Knabben. All rights reserved. </p> </div> </body> </html>
100gd-compare
trunk/WebContent/components/ckeditor/_samples/ui_languages.html
HTML
epl
3,504
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license --> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>ENTER Key Configuration - CKEditor Sample</title> <meta content="text/html; charset=utf-8" http-equiv="content-type" /> <script type="text/javascript" src="../ckeditor.js"></script> <script src="sample.js" type="text/javascript"></script> <link href="sample.css" rel="stylesheet" type="text/css" /> <script type="text/javascript"> //<![CDATA[ var editor; function changeEnter() { // If we already have an editor, let's destroy it first. if ( editor ) editor.destroy( true ); // Create the editor again, with the appropriate settings. editor = CKEDITOR.replace( 'editor1', { enterMode : Number( document.getElementById( 'xEnter' ).value ), shiftEnterMode : Number( document.getElementById( 'xShiftEnter' ).value ) }); } window.onload = changeEnter; //]]> </script> </head> <body> <h1> CKEditor Sample </h1> <!-- This <div> holds alert messages to be display in the sample page. --> <div id="alerts"> <noscript> <p> <strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript support, like yours, you should still see the contents (HTML data) and you should be able to edit it normally, without a rich editor interface. </p> </noscript> </div> <div style="float: left; margin-right: 20px"> When ENTER is pressed:<br /> <select id="xEnter" onchange="changeEnter();"> <option selected="selected" value="1">Create new &lt;P&gt; (recommended)</option> <option value="3">Create new &lt;DIV&gt;</option> <option value="2">Break the line with a &lt;BR&gt;</option> </select> </div> <div style="float: left"> When SHIFT + ENTER is pressed:<br /> <select id="xShiftEnter" onchange="changeEnter();"> <option value="1">Create new &lt;P&gt;</option> <option value="3">Create new &lt;DIV&gt;</option> <option selected="selected" value="2">Break the line with a &lt;BR&gt; (recommended)</option> </select> </div> <br style="clear: both" /> <form action="sample_posteddata.php" method="post"> <p> <br /> <textarea cols="80" id="editor1" name="editor1" rows="10">This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.</textarea> </p> <p> <input type="submit" value="Submit" /> </p> </form> <div id="footer"> <hr /> <p> CKEditor - The text editor for Internet - <a href="http://ckeditor.com/">http://ckeditor.com</a> </p> <p id="copy"> Copyright &copy; 2003-2010, <a href="http://cksource.com/">CKSource</a> - Frederico Knabben. All rights reserved. </p> </div> </body> </html>
100gd-compare
trunk/WebContent/components/ckeditor/_samples/enterkey.html
HTML
epl
3,007
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license --> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Replace Textareas by Class Name - CKEditor Sample</title> <meta content="text/html; charset=utf-8" http-equiv="content-type" /> <script type="text/javascript" src="../ckeditor.js"></script> <script src="sample.js" type="text/javascript"></script> <link href="sample.css" rel="stylesheet" type="text/css" /> </head> <body> <h1> CKEditor Sample </h1> <!-- This <div> holds alert messages to be display in the sample page. --> <div id="alerts"> <noscript> <p> <strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript support, like yours, you should still see the contents (HTML data) and you should be able to edit it normally, without a rich editor interface. </p> </noscript> </div> <form action="sample_posteddata.php" method="post"> <p> <label for="editor1"> Editor 1:</label><br /> <textarea class="ckeditor" cols="10" id="editor1" name="editor1" rows="5">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea> </p> <p> <input type="submit" value="Submit" /> </p> </form> <div id="footer"> <hr /> <p> CKEditor - The text editor for Internet - <a href="http://ckeditor.com/">http://ckeditor.com</a> </p> <p id="copy"> Copyright &copy; 2003-2010, <a href="http://cksource.com/">CKSource</a> - Frederico Knabben. All rights reserved. </p> </div> </body> </html>
100gd-compare
trunk/WebContent/components/ckeditor/_samples/replacebyclass.html
HTML
epl
1,846
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license --> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>API usage - CKEditor Sample</title> <meta content="text/html; charset=utf-8" http-equiv="content-type" /> <script type="text/javascript" src="../ckeditor.js"></script> <script src="sample.js" type="text/javascript"></script> <link href="sample.css" rel="stylesheet" type="text/css" /> <script type="text/javascript"> //<![CDATA[ // The instanceReady event is fired when an instance of CKEditor has finished // its initialization. CKEDITOR.on( 'instanceReady', function( ev ) { // Show the editor name and description in the browser status bar. document.getElementById( 'eMessage' ).innerHTML = '<p>Instance "' + ev.editor.name + '" loaded.<\/p>'; // Show this sample buttons. document.getElementById( 'eButtons' ).style.visibility = ''; }); function InsertHTML() { // Get the editor instance that we want to interact with. var oEditor = CKEDITOR.instances.editor1; var value = document.getElementById( 'plainArea' ).value; // Check the active editing mode. if ( oEditor.mode == 'wysiwyg' ) { // Insert the desired HTML. oEditor.insertHtml( value ); } else alert( 'You must be on WYSIWYG mode!' ); } function SetContents() { // Get the editor instance that we want to interact with. var oEditor = CKEDITOR.instances.editor1; var value = document.getElementById( 'plainArea' ).value; // Set the editor contents (replace the actual one). oEditor.setData( value ); } function GetContents() { // Get the editor instance that we want to interact with. var oEditor = CKEDITOR.instances.editor1; // Get the editor contents alert( oEditor.getData() ); } function ExecuteCommand(commandName) { // Get the editor instance that we want to interact with. var oEditor = CKEDITOR.instances.editor1; // Check the active editing mode. if ( oEditor.mode == 'wysiwyg' ) { // Execute the command. oEditor.execCommand( commandName ); } else alert( 'You must be on WYSIWYG mode!' ); } function CheckDirty() { // Get the editor instance that we want to interact with. var oEditor = CKEDITOR.instances.editor1; alert( oEditor.checkDirty() ); } function ResetDirty() { // Get the editor instance that we want to interact with. var oEditor = CKEDITOR.instances.editor1; oEditor.resetDirty(); alert( 'The "IsDirty" status has been reset' ); } //]]> </script> </head> <body> <h1> CKEditor Sample </h1> <!-- This <div> holds alert messages to be display in the sample page. --> <div id="alerts"> <noscript> <p> <strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript support, like yours, you should still see the contents (HTML data) and you should be able to edit it normally, without a rich editor interface. </p> </noscript> </div> <form action="sample_posteddata.php" method="post"> <p> This sample shows how to use the CKeditor JavaScript API to interact with the editor at runtime.</p> <textarea cols="80" id="editor1" name="editor1" rows="10">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea> <script type="text/javascript"> //<![CDATA[ // Replace the <textarea id="editor1"> with an CKEditor instance. var editor = CKEDITOR.replace( 'editor1' ); //]]> </script> <div id="eMessage"> </div> <div id="eButtons" style="visibility: hidden"> <input onclick="InsertHTML();" type="button" value="Insert HTML" /> <input onclick="SetContents();" type="button" value="Set Editor Contents" /> <input onclick="GetContents();" type="button" value="Get Editor Contents (XHTML)" /> <br /> <textarea cols="80" id="plainArea" rows="3">&lt;h2&gt;Test&lt;/h2&gt;&lt;p&gt;This is some &lt;a href="/Test1.html"&gt;sample&lt;/a&gt; HTML&lt;/p&gt;</textarea> <br /> <br /> <input onclick="ExecuteCommand('bold');" type="button" value="Execute &quot;bold&quot; Command" /> <input onclick="ExecuteCommand('link');" type="button" value="Execute &quot;link&quot; Command" /> <br /> <br /> <input onclick="CheckDirty();" type="button" value="checkDirty()" /> <input onclick="ResetDirty();" type="button" value="resetDirty()" /> </div> </form> <div id="footer"> <hr /> <p> CKEditor - The text editor for Internet - <a href="http://ckeditor.com/">http://ckeditor.com</a> </p> <p id="copy"> Copyright &copy; 2003-2010, <a href="http://cksource.com/">CKSource</a> - Frederico Knabben. All rights reserved. </p> </div> </body> </html>
100gd-compare
trunk/WebContent/components/ckeditor/_samples/api.html
HTML
epl
4,991
/* Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ // This file is not required by CKEditor and may be safely ignored. // It is just a helper file that displays a red message about browser compatibility // at the top of the samples (if incompatible browser is detected). if ( window.CKEDITOR ) { (function() { var showCompatibilityMsg = function() { var env = CKEDITOR.env; var html = '<p><strong>Your browser is not compatible with CKEditor.</strong>'; var browsers = { gecko : 'Firefox 2.0', ie : 'Internet Explorer 6.0', opera : 'Opera 9.5', webkit : 'Safari 3.0' }; var alsoBrowsers = ''; for ( var key in env ) { if ( browsers[ key ] ) { if ( env[key] ) html += ' CKEditor is compatible with ' + browsers[ key ] + ' or higher.'; else alsoBrowsers += browsers[ key ] + '+, '; } } alsoBrowsers = alsoBrowsers.replace( /\+,([^,]+), $/, '+ and $1' ); html += ' It is also compatible with ' + alsoBrowsers + '.'; html += '</p><p>With non compatible browsers, you should still be able to see and edit the contents (HTML) in a plain text field.</p>'; var alertsEl = document.getElementById( 'alerts' ); alertsEl && ( alertsEl.innerHTML = html ); }; var onload = function() { // Show a friendly compatibility message as soon as the page is loaded, // for those browsers that are not compatible with CKEditor. if ( !CKEDITOR.env.isCompatible ) showCompatibilityMsg(); }; // Register the onload listener. if ( window.addEventListener ) window.addEventListener( 'load', onload, false ); else if ( window.attachEvent ) window.attachEvent( 'onload', onload ); })(); }
100gd-compare
trunk/WebContent/components/ckeditor/_samples/sample.js
JavaScript
epl
1,866
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license --> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Sample - CKEditor</title> <meta content="text/html; charset=utf-8" http-equiv="content-type"/> <link href="../sample.css" rel="stylesheet" type="text/css"/> </head> <body> <h1> CKEditor Sample </h1> <!-- This <div> holds alert messages to be display in the sample page. --> <div id="alerts"> <noscript> <p> <strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript support, like yours, you should still see the contents (HTML data) and you should be able to edit it normally, without a rich editor interface. </p> </noscript> </div> <!-- This <fieldset> holds the HTML that you will usually find in your pages. --> <fieldset title="Output"> <legend>Output</legend> <form action="../sample_posteddata.php" method="post"> <p> <label for="editor1"> Editor 1:</label><br/> </p> <p> <?php // Include CKEditor class. include_once "../../ckeditor.php"; // The initial value to be displayed in the editor. $initialValue = '<p>This is some <strong>sample text</strong>.</p>'; // Create class instance. $CKEditor = new CKEditor(); // Path to CKEditor directory, ideally instead of relative dir, use an absolute path: // $CKEditor->basePath = '/ckeditor/' // If not set, CKEditor will try to detect the correct path. $CKEditor->basePath = '../../'; // Create textarea element and attach CKEditor to it. $CKEditor->editor("editor1", $initialValue); ?> <input type="submit" value="Submit"/> </p> </form> </fieldset> <div id="footer"> <hr /> <p> CKEditor - The text editor for Internet - <a href="http://ckeditor.com/">http://ckeditor.com</a> </p> <p id="copy"> Copyright &copy; 2003-2010, <a href="http://cksource.com/">CKSource</a> - Frederico Knabben. All rights reserved. </p> </div> </body> </html>
100gd-compare
trunk/WebContent/components/ckeditor/_samples/php/standalone.php
PHP
epl
2,253
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license --> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Sample - CKEditor</title> <meta content="text/html; charset=utf-8" http-equiv="content-type"/> <link href="../sample.css" rel="stylesheet" type="text/css"/> </head> <body> <h1> CKEditor Sample </h1> <!-- This <div> holds alert messages to be display in the sample page. --> <div id="alerts"> <noscript> <p> <strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript support, like yours, you should still see the contents (HTML data) and you should be able to edit it normally, without a rich editor interface. </p> </noscript> </div> <!-- This <fieldset> holds the HTML that you will usually find in your pages. --> <fieldset title="Output"> <legend>Output</legend> <form action="../sample_posteddata.php" method="post"> <p> <label>Editor 1:</label><br/> </p> <?php /** * Adds global event, will hide "Target" tab in Link dialog in all instances. */ function CKEditorHideLinkTargetTab(&$CKEditor) { $function = 'function (ev) { // Take the dialog name and its definition from the event data var dialogName = ev.data.name; var dialogDefinition = ev.data.definition; // Check if the definition is from the Link dialog. if ( dialogName == "link" ) dialogDefinition.removeContents("target") }'; $CKEditor->addGlobalEventHandler('dialogDefinition', $function); } /** * Adds global event, will notify about opened dialog. */ function CKEditorNotifyAboutOpenedDialog(&$CKEditor) { $function = 'function (evt) { alert("Loading dialog: " + evt.data.name); }'; $CKEditor->addGlobalEventHandler('dialogDefinition', $function); } // Include CKEditor class. include("../../ckeditor.php"); // Create class instance. $CKEditor = new CKEditor(); // Set configuration option for all editors. $CKEditor->config['width'] = 750; // Path to CKEditor directory, ideally instead of relative dir, use an absolute path: // $CKEditor->basePath = '/ckeditor/' // If not set, CKEditor will try to detect the correct path. $CKEditor->basePath = '../../'; // The initial value to be displayed in the editor. $initialValue = '<p>This is some <strong>sample text</strong>. You are using <a href="http://ckeditor.com/">CKEditor</a>.</p>'; // Event that will be handled only by the first editor. $CKEditor->addEventHandler('instanceReady', 'function (evt) { alert("Loaded editor: " + evt.editor.name); }'); // Create first instance. $CKEditor->editor("editor1", $initialValue); // Clear event handlers, instances that will be created later will not have // the 'instanceReady' listener defined a couple of lines above. $CKEditor->clearEventHandlers(); ?> <p> <label>Editor 2:</label><br/> </p> <?php // Configuration that will be used only by the second editor. $config['width'] = '600'; $config['toolbar'] = 'Basic'; // Add some global event handlers (for all editors). CKEditorHideLinkTargetTab($CKEditor); CKEditorNotifyAboutOpenedDialog($CKEditor); // Event that will be handled only by the second editor. // Instead of calling addEventHandler(), events may be passed as an argument. $events['instanceReady'] = 'function (evt) { alert("Loaded second editor: " + evt.editor.name); }'; // Create second instance. $CKEditor->editor("editor2", $initialValue, $config, $events); ?> <p> <input type="submit" value="Submit"/> </p> </form> </fieldset> <div id="footer"> <hr /> <p> CKEditor - The text editor for Internet - <a href="http://ckeditor.com/">http://ckeditor.com</a> </p> <p id="copy"> Copyright &copy; 2003-2010, <a href="http://cksource.com/">CKSource</a> - Frederico Knabben. All rights reserved. </p> </div> </body> </html>
100gd-compare
trunk/WebContent/components/ckeditor/_samples/php/events.php
PHP
epl
4,124
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license --> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Sample - CKEditor</title> <meta content="text/html; charset=utf-8" http-equiv="content-type"/> <link href="../sample.css" rel="stylesheet" type="text/css"/> </head> <body> <h1> CKEditor Sample </h1> <!-- This <div> holds alert messages to be display in the sample page. --> <div id="alerts"> <noscript> <p> <strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript support, like yours, you should still see the contents (HTML data) and you should be able to edit it normally, without a rich editor interface. </p> </noscript> </div> <!-- This <fieldset> holds the HTML that you will usually find in your pages. --> <fieldset title="Output"> <legend>Output</legend> <form action="../sample_posteddata.php" method="post"> <p> <label for="editor1"> Editor 1:</label><br/> <textarea cols="80" id="editor1" name="editor1" rows="10">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea> </p> <p> <input type="submit" value="Submit"/> </p> </form> </fieldset> <div id="footer"> <hr /> <p> CKEditor - The text editor for Internet - <a href="http://ckeditor.com/">http://ckeditor.com</a> </p> <p id="copy"> Copyright &copy; 2003-2010, <a href="http://cksource.com/">CKSource</a> - Frederico Knabben. All rights reserved. </p> </div> <?php // Include CKEditor class. include_once "../../ckeditor.php"; // Create class instance. $CKEditor = new CKEditor(); // Path to CKEditor directory, ideally instead of relative dir, use an absolute path: // $CKEditor->basePath = '/ckeditor/' // If not set, CKEditor will try to detect the correct path. $CKEditor->basePath = '../../'; // Replace textarea with id (or name) "editor1". $CKEditor->replace("editor1"); ?> </body> </html>
100gd-compare
trunk/WebContent/components/ckeditor/_samples/php/replace.php
PHP
epl
2,288
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license --> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Sample - CKEditor</title> <meta content="text/html; charset=utf-8" http-equiv="content-type"/> <link href="../sample.css" rel="stylesheet" type="text/css"/> </head> <body> <h1> CKEditor Sample </h1> <!-- This <div> holds alert messages to be display in the sample page. --> <div id="alerts"> <noscript> <p> <strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript support, like yours, you should still see the contents (HTML data) and you should be able to edit it normally, without a rich editor interface. </p> </noscript> </div> <!-- This <fieldset> holds the HTML that you will usually find in your pages. --> <fieldset title="Output"> <legend>Output</legend> <form action="../sample_posteddata.php" method="post"> <p> <label for="editor1"> Editor 1:</label><br/> <textarea cols="80" id="editor1" name="editor1" rows="10">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea> </p> <p> <label for="editor2"> Editor 2:</label><br/> <textarea cols="80" id="editor2" name="editor2" rows="10">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea> </p> <p> <input type="submit" value="Submit"/> </p> </form> </fieldset> <div id="footer"> <hr /> <p> CKEditor - The text editor for Internet - <a href="http://ckeditor.com/">http://ckeditor.com</a> </p> <p id="copy"> Copyright &copy; 2003-2010, <a href="http://cksource.com/">CKSource</a> - Frederico Knabben. All rights reserved. </p> </div> <?php // Include CKEditor class. include("../../ckeditor.php"); // Create class instance. $CKEditor = new CKEditor(); // Path to CKEditor directory, ideally instead of relative dir, use an absolute path: // $CKEditor->basePath = '/ckeditor/' // If not set, CKEditor will try to detect the correct path. $CKEditor->basePath = '../../'; // Replace all textareas with CKEditor. $CKEditor->replaceAll(); ?> </body> </html>
100gd-compare
trunk/WebContent/components/ckeditor/_samples/php/replaceall.php
PHP
epl
2,561
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license --> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Sample - CKEditor</title> <meta content="text/html; charset=utf-8" http-equiv="content-type"/> <link href="../sample.css" rel="stylesheet" type="text/css"/> </head> <body> <h1> CKEditor Sample </h1> <!-- This <div> holds alert messages to be display in the sample page. --> <div id="alerts"> <noscript> <p> <strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript support, like yours, you should still see the contents (HTML data) and you should be able to edit it normally, without a rich editor interface. </p> </noscript> </div> <!-- This <fieldset> holds the HTML that you will usually find in your pages. --> <fieldset title="Output"> <legend>Output</legend> <form action="../sample_posteddata.php" method="post"> <p> <label>Editor 1:</label><br/> </p> <?php // Include CKEditor class. include("../../ckeditor.php"); // Create class instance. $CKEditor = new CKEditor(); // Do not print the code directly to the browser, return it instead $CKEditor->returnOutput = true; // Path to CKEditor directory, ideally instead of relative dir, use an absolute path: // $CKEditor->basePath = '/ckeditor/' // If not set, CKEditor will try to detect the correct path. $CKEditor->basePath = '../../'; // Set global configuration (will be used by all instances of CKEditor). $CKEditor->config['width'] = 600; // Change default textarea attributes $CKEditor->textareaAttributes = array("cols" => 80, "rows" => 10); // The initial value to be displayed in the editor. $initialValue = '<p>This is some <strong>sample text</strong>. You are using <a href="http://ckeditor.com/">CKEditor</a>.</p>'; // Create first instance. $code = $CKEditor->editor("editor1", $initialValue); echo $code; ?> <p> <label>Editor 2:</label><br/> </p> <?php // Configuration that will be used only by the second editor. $config['toolbar'] = array( array( 'Source', '-', 'Bold', 'Italic', 'Underline', 'Strike' ), array( 'Image', 'Link', 'Unlink', 'Anchor' ) ); $config['skin'] = 'v2'; // Create second instance. echo $CKEditor->editor("editor2", $initialValue, $config); ?> <p> <input type="submit" value="Submit"/> </p> </form> </fieldset> <div id="footer"> <hr /> <p> CKEditor - The text editor for Internet - <a href="http://ckeditor.com/">http://ckeditor.com</a> </p> <p id="copy"> Copyright &copy; 2003-2010, <a href="http://cksource.com/">CKSource</a> - Frederico Knabben. All rights reserved. </p> </div> </body> </html>
100gd-compare
trunk/WebContent/components/ckeditor/_samples/php/advanced.php
PHP
epl
2,950
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license --> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Replace DIV - CKEditor Sample</title> <meta content="text/html; charset=utf-8" http-equiv="content-type" /> <script type="text/javascript" src="../ckeditor.js"></script> <script src="sample.js" type="text/javascript"></script> <link href="sample.css" rel="stylesheet" type="text/css" /> <style id="styles" type="text/css"> div.editable { border: solid 2px Transparent; padding-left: 15px; padding-right: 15px; } div.editable:hover { border-color: black; } </style> <script type="text/javascript"> //<![CDATA[ // Uncomment the following code to test the "Timeout Loading Method". // CKEDITOR.loadFullCoreTimeout = 5; window.onload = function() { // Listen to the double click event. if ( window.addEventListener ) document.body.addEventListener( 'dblclick', onDoubleClick, false ); else if ( window.attachEvent ) document.body.attachEvent( 'ondblclick', onDoubleClick ); }; function onDoubleClick( ev ) { // Get the element which fired the event. This is not necessarily the // element to which the event has been attached. var element = ev.target || ev.srcElement; // Find out the div that holds this element. element = element.parentNode; if ( element.nodeName.toLowerCase() == 'div' && ( element.className.indexOf( 'editable' ) != -1 ) ) replaceDiv( element ); } var editor; function replaceDiv( div ) { if ( editor ) editor.destroy(); editor = CKEDITOR.replace( div ); } //]]> </script> </head> <body> <h1> CKEditor Sample </h1> <!-- This <div> holds alert messages to be display in the sample page. --> <div id="alerts"> <noscript> <p> <strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript support, like yours, you should still see the contents (HTML data) and you should be able to edit it normally, without a rich editor interface. </p> </noscript> </div> <p> Double-click on any of the following DIVs to transform them into editor instances.</p> <div class="editable"> <h3> Part 1</h3> <p> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras et ipsum quis mi semper accumsan. Integer pretium dui id massa. Suspendisse in nisl sit amet urna rutrum imperdiet. Nulla eu tellus. Donec ante nisi, ullamcorper quis, fringilla nec, sagittis eleifend, pede. Nulla commodo interdum massa. Donec id metus. Fusce eu ipsum. Suspendisse auctor. Phasellus fermentum porttitor risus. </p> </div> <div class="editable"> <h3> Part 2</h3> <p> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras et ipsum quis mi semper accumsan. Integer pretium dui id massa. Suspendisse in nisl sit amet urna rutrum imperdiet. Nulla eu tellus. Donec ante nisi, ullamcorper quis, fringilla nec, sagittis eleifend, pede. Nulla commodo interdum massa. Donec id metus. Fusce eu ipsum. Suspendisse auctor. Phasellus fermentum porttitor risus. </p> <p> Donec velit. Mauris massa. Vestibulum non nulla. Nam suscipit arcu nec elit. Phasellus sollicitudin iaculis ante. Ut non mauris et sapien tincidunt adipiscing. Vestibulum vitae leo. Suspendisse nec mi tristique nulla laoreet vulputate. </p> </div> <div class="editable"> <h3> Part 3</h3> <p> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras et ipsum quis mi semper accumsan. Integer pretium dui id massa. Suspendisse in nisl sit amet urna rutrum imperdiet. Nulla eu tellus. Donec ante nisi, ullamcorper quis, fringilla nec, sagittis eleifend, pede. Nulla commodo interdum massa. Donec id metus. Fusce eu ipsum. Suspendisse auctor. Phasellus fermentum porttitor risus. </p> </div> <div id="footer"> <hr /> <p> CKEditor - The text editor for Internet - <a href="http://ckeditor.com/">http://ckeditor.com</a> </p> <p id="copy"> Copyright &copy; 2003-2010, <a href="http://cksource.com/">CKSource</a> - Frederico Knabben. All rights reserved. </p> </div> </body> </html>
100gd-compare
trunk/WebContent/components/ckeditor/_samples/divreplace.html
HTML
epl
4,435
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license --> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Full Page Editing - CKEditor Sample</title> <meta content="text/html; charset=utf-8" http-equiv="content-type" /> <script type="text/javascript" src="../ckeditor.js"></script> <script src="sample.js" type="text/javascript"></script> <link href="sample.css" rel="stylesheet" type="text/css" /> </head> <body> <h1> CKEditor Sample </h1> <!-- This <div> holds alert messages to be display in the sample page. --> <div id="alerts"> <noscript> <p> <strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript support, like yours, you should still see the contents (HTML data) and you should be able to edit it normally, without a rich editor interface. </p> </noscript> </div> <form action="sample_posteddata.php" method="post"> <p> In this sample the editor is configured to edit entire HTML pages, from the &lt;html&gt; tag to &lt;/html&gt;.</p> <p> <label for="editor1"> Editor 1:</label><br /> <textarea cols="80" id="editor1" name="editor1" rows="10">&lt;html&gt;&lt;head&gt;&lt;title&gt;CKEditor Sample&lt;/title&gt;&lt;/head&gt;&lt;body&gt;&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</textarea> <script type="text/javascript"> //<![CDATA[ CKEDITOR.replace( 'editor1', { fullPage : true }); //]]> </script> </p> <p> <input type="submit" value="Submit" /> </p> </form> <div id="footer"> <hr /> <p> CKEditor - The text editor for Internet - <a href="http://ckeditor.com/">http://ckeditor.com</a> </p> <p id="copy"> Copyright &copy; 2003-2010, <a href="http://cksource.com/">CKSource</a> - Frederico Knabben. All rights reserved. </p> </div> </body> </html>
100gd-compare
trunk/WebContent/components/ckeditor/_samples/fullpage.html
HTML
epl
2,218
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license --> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Skins - CKEditor Sample</title> <meta content="text/html; charset=utf-8" http-equiv="content-type" /> <script type="text/javascript" src="../ckeditor.js"></script> <script src="sample.js" type="text/javascript"></script> <link href="sample.css" rel="stylesheet" type="text/css" /> </head> <body> <h1> CKEditor Sample </h1> <!-- This <div> holds alert messages to be display in the sample page. --> <div id="alerts"> <noscript> <p> <strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript support, like yours, you should still see the contents (HTML data) and you should be able to edit it normally, without a rich editor interface. </p> </noscript> </div> <form action="sample_posteddata.php" method="post"> <p> "Kama" skin:<br /> <textarea cols="80" id="editor_kama" name="editor_kama" rows="10">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea> <script type="text/javascript"> //<![CDATA[ CKEDITOR.replace( 'editor_kama', { skin : 'kama' }); //]]> </script> </p> <p> "Office 2003" skin:<br /> <textarea cols="80" id="editor_office2003" name="editor_office2003" rows="10">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea> <script type="text/javascript"> //<![CDATA[ CKEDITOR.replace( 'editor_office2003', { skin : 'office2003' }); //]]> </script> </p> <p> "V2" skin:<br /> <textarea cols="80" id="editor_v2" name="editor_v2" rows="10">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea> <script type="text/javascript"> //<![CDATA[ CKEDITOR.replace( 'editor_v2', { skin : 'v2' }); //]]> </script> </p> </form> <div id="footer"> <hr /> <p> CKEditor - The text editor for Internet - <a href="http://ckeditor.com/">http://ckeditor.com</a> </p> <p id="copy"> Copyright &copy; 2003-2010, <a href="http://cksource.com/">CKSource</a> - Frederico Knabben. All rights reserved. </p> </div> </body> </html>
100gd-compare
trunk/WebContent/components/ckeditor/_samples/skins.html
HTML
epl
2,742
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <?php /* Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ ?> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Sample - CKEditor</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <link type="text/css" rel="stylesheet" href="sample.css" /> </head> <body> <h1> CKEditor - Posted Data </h1> <table border="1" cellspacing="0" id="outputSample"> <colgroup><col width="100" /></colgroup> <thead> <tr> <th>Field&nbsp;Name</th> <th>Value</th> </tr> </thead> <?php if ( isset( $_POST ) ) $postArray = &$_POST ; // 4.1.0 or later, use $_POST else $postArray = &$HTTP_POST_VARS ; // prior to 4.1.0, use HTTP_POST_VARS foreach ( $postArray as $sForm => $value ) { if ( get_magic_quotes_gpc() ) $postedValue = htmlspecialchars( stripslashes( $value ) ) ; else $postedValue = htmlspecialchars( $value ) ; ?> <tr> <th style="vertical-align: top"><?php echo $sForm?></th> <td><pre><?php echo $postedValue?></pre></td> </tr> <?php } ?> </table> <div id="footer"> <hr /> <p> CKEditor - The text editor for Internet - <a href="http://ckeditor.com/">http://ckeditor.com</a> </p> <p id="copy"> Copyright &copy; 2003-2010, <a href="http://cksource.com/">CKSource</a> - Frederico Knabben. All rights reserved. </p> </div> </body> </html>
100gd-compare
trunk/WebContent/components/ckeditor/_samples/sample_posteddata.php
PHP
epl
1,596
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license --> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>jQuery adapter - CKEditor Sample</title> <meta content="text/html; charset=utf-8" http-equiv="content-type" /> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script> <script type="text/javascript" src="../ckeditor.js"></script> <script type="text/javascript" src="../adapters/jquery.js"></script> <script src="sample.js" type="text/javascript"></script> <link href="sample.css" rel="stylesheet" type="text/css" /> <script type="text/javascript"> //<![CDATA[ $(function() { var config = { toolbar: [ ['Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink'], ['UIColor'] ] }; // Initialize the editor. // Callback function can be passed and executed after full instance creation. $('.jquery_ckeditor').ckeditor(config); }); //]]> </script> </head> <body> <h1> CKEditor Sample </h1> <!-- This <div> holds alert messages to be display in the sample page. --> <div id="alerts"> <noscript> <p> <strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript support, like yours, you should still see the contents (HTML data) and you should be able to edit it normally, without a rich editor interface. </p> </noscript> </div> <!-- This <fieldset> holds the HTML that you will usually find in your pages. --> <form action="sample_posteddata.php" method="post"> <p> <label for="editor1"> Editor 1:</label><br /> <textarea class="jquery_ckeditor" cols="80" id="editor1" name="editor1" rows="10">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea> </p> <p> <input type="submit" value="Submit" /> </p> </form> <div id="footer"> <hr /> <p> CKEditor - The text editor for Internet - <a href="http://ckeditor.com/">http://ckeditor.com</a> </p> <p id="copy"> Copyright &copy; 2003-2010, <a href="http://cksource.com/">CKSource</a> - Frederico Knabben. All rights reserved. </p> </div> </body> </html>
100gd-compare
trunk/WebContent/components/ckeditor/_samples/jqueryadapter.html
HTML
epl
2,486
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license --> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Samples List - CKEditor</title> <link type="text/css" rel="stylesheet" href="sample.css" /> </head> <body> <h1> CKEditor Samples List </h1> <h2> Basic Samples </h2> <ul> <li><a href="replacebyclass.html">Replace textareas by class name</a></li> <li><a href="replacebycode.html">Replace textareas by code</a></li> <li><a href="fullpage.html">Full page support (editing from &lt;html&gt; to &lt;/html&gt;)</a></li> </ul> <h2> Basic Customization </h2> <ul> <li><a href="skins.html">Skins</a></li> <li><a href="ui_color.html">User Interface Color</a></li> <li><a href="ui_languages.html">User Interface Languages</a></li> </ul> <h2> Advanced Samples </h2> <ul> <li><a href="divreplace.html">Replace DIV elements on the fly</a>&nbsp; </li> <li><a href="ajax.html">Create and destroy editor instances for Ajax applications</a></li> <li><a href="api.html">Basic usage of the API</a></li> <li><a href="api_dialog.html">Using the JavaScript API to customize dialogs</a></li> <li><a href="enterkey.html">Using the "Enter" key in CKEditor</a></li> <li><a href="sharedspaces.html">Shared toolbars</a></li> <li><a href="jqueryadapter.html">jQuery adapter example</a></li> </ul> <div id="footer"> <hr /> <p> CKEditor - The text editor for Internet - <a href="http://ckeditor.com/">http://ckeditor.com</a> </p> <p id="copy"> Copyright &copy; 2003-2010, <a href="http://cksource.com/">CKSource</a> - Frederico Knabben. All rights reserved. </p> </div> </body> </html>
100gd-compare
trunk/WebContent/components/ckeditor/_samples/index.html
HTML
epl
1,902
/* Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ fieldset { margin: 0; padding: 10px; } form { margin: 0; padding: 0; } pre { background-color: #F7F7F7; border: 1px solid #D7D7D7; overflow: auto; margin: 0; padding: 0.25em; } #alerts { color: Red; } #footer hr { margin: 10px 0 15px 0; height: 1px; border: solid 1px gray; border-bottom: none; } #footer p { margin: 0 10px 10px 10px; float: left; } #footer #copy { float: right; } #outputSample { width: 100%; table-layout: fixed; } #outputSample thead th { color: #dddddd; background-color: #999999; padding: 4px; white-space: nowrap; } #outputSample tbody th { vertical-align: top; text-align: left; } #outputSample pre { margin: 0; padding: 0; white-space: pre; /* CSS2 */ white-space: -moz-pre-wrap; /* Mozilla*/ white-space: -o-pre-wrap; /* Opera 7 */ white-space: pre-wrap; /* CSS 2.1 */ white-space: pre-line; /* CSS 3 (and 2.1 as well, actually) */ word-wrap: break-word; /* IE */ }
100gd-compare
trunk/WebContent/components/ckeditor/_samples/sample.css
CSS
epl
1,162
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license --> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>UI Color Setting Tool - CKEditor Sample</title> <meta content="text/html; charset=utf-8" http-equiv="content-type" /> <script type="text/javascript" src="../ckeditor.js"></script> <script src="sample.js" type="text/javascript"></script> <link href="sample.css" rel="stylesheet" type="text/css" /> </head> <body> <h1> CKEditor Sample </h1> <!-- This <div> holds alert messages to be display in the sample page. --> <div id="alerts"> <noscript> <p> <strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript support, like yours, you should still see the contents (HTML data) and you should be able to edit it normally, without a rich editor interface. </p> </noscript> </div> <p> Click the UI Color Picker button to test your color preferences at runtime.</p> <form action="sample_posteddata.php" method="post"> <p> <textarea cols="80" id="editor1" name="editor1" rows="10">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea> <script type="text/javascript"> //<![CDATA[ // Replace the <textarea id="editor"> with an CKEditor // instance, using default configurations. CKEDITOR.replace( 'editor1', { extraPlugins : 'uicolor', toolbar : [ [ 'Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink' ], [ 'UIColor' ] ] }); //]]> </script> </p> <p> <textarea cols="80" id="editor2" name="editor2" rows="10">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea> <script type="text/javascript"> //<![CDATA[ // Replace the <textarea id="editor"> with an CKEditor // instance, using default configurations. CKEDITOR.replace( 'editor2', { extraPlugins : 'uicolor', uiColor: '#14B8C4', toolbar : [ [ 'Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink' ], [ 'UIColor' ] ] } ); //]]> </script> </p> <p> <input type="submit" value="Submit" /> </p> </form> <div id="footer"> <hr /> <p> CKEditor - The text editor for Internet - <a href="http://ckeditor.com/">http://ckeditor.com</a> </p> <p id="copy"> Copyright &copy; 2003-2010, <a href="http://cksource.com/">CKSource</a> - Frederico Knabben. All rights reserved. </p> </div> </body> </html>
100gd-compare
trunk/WebContent/components/ckeditor/_samples/ui_color.html
HTML
epl
2,915
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license --> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Using API to customize dialogs - CKEditor Sample</title> <meta content="text/html; charset=utf-8" http-equiv="content-type" /> <script type="text/javascript" src="../ckeditor.js"></script> <script src="sample.js" type="text/javascript"></script> <link href="sample.css" rel="stylesheet" type="text/css" /> <style id="styles" type="text/css"> .cke_button_myDialogCmd .cke_icon { display: none !important; } .cke_button_myDialogCmd .cke_label { display: inline !important; } </style> <script type="text/javascript"> //<![CDATA[ // When opening a dialog, its "definition" is created for it, for // each editor instance. The "dialogDefinition" event is then // fired. We should use this event to make customizations to the // definition of existing dialogs. CKEDITOR.on( 'dialogDefinition', function( ev ) { // Take the dialog name and its definition from the event // data. var dialogName = ev.data.name; var dialogDefinition = ev.data.definition; // Check if the definition is from the dialog we're // interested on (the "Link" dialog). if ( dialogName == 'link' ) { // Get a reference to the "Link Info" tab. var infoTab = dialogDefinition.getContents( 'info' ); // Add a text field to the "info" tab. infoTab.add( { type : 'text', label : 'My Custom Field', id : 'customField', 'default' : 'Sample!', validate : function() { if ( /\d/.test( this.getValue() ) ) return 'My Custom Field must not contain digits'; } }); // Remove the "Link Type" combo and the "Browser // Server" button from the "info" tab. infoTab.remove( 'linkType' ); infoTab.remove( 'browse' ); // Set the default value for the URL field. var urlField = infoTab.get( 'url' ); urlField['default'] = 'www.example.com'; // Remove the "Target" tab from the "Link" dialog. dialogDefinition.removeContents( 'target' ); // Add a new tab to the "Link" dialog. dialogDefinition.addContents({ id : 'customTab', label : 'My Tab', accessKey : 'M', elements : [ { id : 'myField1', type : 'text', label : 'My Text Field' }, { id : 'myField2', type : 'text', label : 'Another Text Field' } ] }); } }); //]]> </script> </head> <body> <h1> CKEditor Sample </h1> <!-- This <div> holds alert messages to be display in the sample page. --> <div id="alerts"> <noscript> <p> <strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript support, like yours, you should still see the contents (HTML data) and you should be able to edit it normally, without a rich editor interface. </p> </noscript> </div> <!-- This <fieldset> holds the HTML that you will usually find in your pages. --> <p> This sample shows how to use the dialog API to customize dialogs whithout changing the original editor code. The following customizations are being done::</p> <ol> <li><strong>Add dialog pages</strong> ("My Tab" in the Link dialog).</li> <li><strong>Remove a dialog tab</strong> ("Target" tab from the Link dialog).</li> <li><strong>Add dialog fields</strong> ("My Custom Field" into the Link dialog).</li> <li><strong>Remove dialog fields</strong> ("Link Type" and "Browser Server" the Link dialog).</li> <li><strong>Set default values for dialog fields</strong> (for the "URL" field in the Link dialog). </li> <li><strong>Create a custom dialog</strong> ("My Dialog" button).</li> </ol> <textarea cols="80" id="editor1" name="editor1" rows="10">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea> <script type="text/javascript"> //<![CDATA[ // Replace the <textarea id="editor1"> with an CKEditor instance. var editor = CKEDITOR.replace( 'editor1', { // Defines a simpler toolbar to be used in this sample. // Note that we have added out "MyButton" button here. toolbar : [ [ 'Source', '-', 'Bold', 'Italic', 'Underline', 'Strike','-','Link', '-', 'MyButton' ] ] }); // Listen for the "pluginsLoaded" event, so we are sure that the // "dialog" plugin has been loaded and we are able to do our // customizations. editor.on( 'pluginsLoaded', function( ev ) { // If our custom dialog has not been registered, do that now. if ( !CKEDITOR.dialog.exists( 'myDialog' ) ) { // We need to do the following trick to find out the dialog // definition file URL path. In the real world, you would simply // point to an absolute path directly, like "/mydir/mydialog.js". var href = document.location.href.split( '/' ); href.pop(); href.push( 'api_dialog', 'my_dialog.js' ); href = href.join( '/' ); // Finally, register the dialog. CKEDITOR.dialog.add( 'myDialog', href ); } // Register the command used to open the dialog. editor.addCommand( 'myDialogCmd', new CKEDITOR.dialogCommand( 'myDialog' ) ); // Add the a custom toolbar buttons, which fires the above // command.. editor.ui.addButton( 'MyButton', { label : 'My Dialog', command : 'myDialogCmd' } ); }); //]]> </script> <div id="footer"> <hr /> <p> CKEditor - The text editor for Internet - <a href="http://ckeditor.com/">http://ckeditor.com</a> </p> <p id="copy"> Copyright &copy; 2003-2010, <a href="http://cksource.com/">CKSource</a> - Frederico Knabben. All rights reserved. </p> </div> </body> </html>
100gd-compare
trunk/WebContent/components/ckeditor/_samples/api_dialog.html
HTML
epl
6,132
/* Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ // Compressed version of core/ckeditor_base.js. See original for instructions. /*jsl:ignore*/ if(!window.CKEDITOR)window.CKEDITOR=(function(){var a={timestamp:'',version:'3.2',revision:'5205',_:{},status:'unloaded',basePath:(function(){var d=window.CKEDITOR_BASEPATH||'';if(!d){var e=document.getElementsByTagName('script');for(var f=0;f<e.length;f++){var g=e[f].src.match(/(^|.*[\\\/])ckeditor(?:_basic)?(?:_source)?.js(?:\?.*)?$/i);if(g){d=g[1];break;}}}if(d.indexOf('://')==-1)if(d.indexOf('/')===0)d=location.href.match(/^.*?:\/\/[^\/]*/)[0]+d;else d=location.href.match(/^[^\?]*\/(?:)/)[0]+d;return d;})(),getUrl:function(d){if(d.indexOf('://')==-1&&d.indexOf('/')!==0)d=this.basePath+d;if(this.timestamp&&d.charAt(d.length-1)!='/')d+=(d.indexOf('?')>=0?'&':'?')+('t=')+this.timestamp;return d;}},b=window.CKEDITOR_GETURL;if(b){var c=a.getUrl;a.getUrl=function(d){return b.call(a,d)||c.call(a,d);};}return a;})(); /*jsl:end*/ // Uncomment the following line to have a new timestamp generated for each // request, having clear cache load of the editor code. // CKEDITOR.timestamp = ( new Date() ).valueOf(); // Set the script name to be loaded by the loader. CKEDITOR._autoLoad = 'core/ckeditor_basic'; // Include the loader script. document.write( '<script type="text/javascript" src="' + CKEDITOR.getUrl( '_source/core/loader.js' ) + '"></script>' );
100gd-compare
trunk/WebContent/components/ckeditor/ckeditor_basic_source.js
JavaScript
epl
1,530
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license --> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Changelog - CKEditor</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <style type="text/css"> #footer hr { margin: 10px 0 15px 0; height: 1px; border: solid 1px gray; border-bottom: none; } #footer p { margin: 0 10px 10px 10px; float: left; } #footer #copy { float: right; } </style> </head> <body> <h1> CKEditor Changelog </h1> <h3> CKEditor 3.2</h3> <p> New features:</p> <ul> <li>Several accessibility enhancements:<ul> <li><a href="http://dev.fckeditor.net/ticket/4502">#4502</a> : The editor accessibility is now totally based on <a href="http://www.w3.org/WAI/intro/aria">WAI-ARIA</a>.</li> <li><a href="http://dev.fckeditor.net/ticket/5015">#5015</a> : Adding accessibility help dialog plugin.</li> <li><a href="http://dev.fckeditor.net/ticket/5014">#5014</a> : Keyboard navigation compliance with screen reader suggested keys.</li> <li><a href="http://dev.fckeditor.net/ticket/4595">#4595</a> : Better accessibility in the Templates dialog.</li> <li><a href="http://dev.fckeditor.net/ticket/3389">#3389</a> : Esc/Arrow Key now works for closing sub menu.</li> </ul></li> <li><a href="http://dev.fckeditor.net/ticket/4973">#4973</a> : The Style field in the Div Container dialog is now loading the styles defined in the default styleset used by the Styles toolbar combo.</li> </ul> <p> Fixed issues:</p> <ul> <li><a href="http://dev.fckeditor.net/ticket/5049">#5049</a> : Form Field list command in JAWS incorrectly lists extra fields.</li> <li><a href="http://dev.fckeditor.net/ticket/5008">#5008</a> : Lock/Unlock ratio buttons in the Image dialog was poorly designed in High Contrast mode.</li> <li><a href="http://dev.fckeditor.net/ticket/3980">#3980</a> : All labels in dialogs now use &lt;label&gt; instead of &lt;div&gt;.</li> <li><a href="http://dev.fckeditor.net/ticket/5213">#5213</a> : Reorganization of some entries in the language files to make it more consistent.</li> <li><a href="http://dev.fckeditor.net/ticket/5199">#5199</a> : In IE, single row toolbars didn't have the bottom padding.</li> </ul> <h3> CKEditor 3.1.1</h3> <p> New features:</p> <ul> <li><a href="http://dev.fckeditor.net/ticket/4399">#4399</a> : Improved support for external file browsers by allowing executing a callback function.</li> <li><a href="http://dev.fckeditor.net/ticket/4612">#4612</a> : The text of links is now updated if it matches the URL to which it points to.</li> <li><a href="http://dev.fckeditor.net/ticket/4936">#4936</a> : New localization support for the Welsh language.</li> </ul> <p> Fixed issues:</p> <ul> <li><a href="http://dev.fckeditor.net/ticket/4272">#4272</a> : Kama skin toolbar was broken in IE+Quirks+RTL.</li> <li><a href="http://dev.fckeditor.net/ticket/4987">#4987</a> : Changed the url which is called by the Browser Server button in the Link tab of Image Properties dialog.</li> <li><a href="http://dev.fckeditor.net/ticket/5030">#5030</a> : The CKEDITOR.timestamp wasn't been appended to the skin.js file.</li> <li><a href="http://dev.fckeditor.net/ticket/4993">#4993</a> : Removed the float style from images when the user selects 'not set' for alignment.</li> <li><a href="http://dev.fckeditor.net/ticket/4944">#4944</a> : Fixed a bug where nested list structures with inconsequent levels were not being pasted correctly from MS Word.</li> <li><a href="http://dev.fckeditor.net/ticket/4637">#4637</a> : Table cells' 'nowrap' attribute was not being loaded by the cell property dialog. Thanks to pomu0325.</li> <li><a href="http://dev.fckeditor.net/ticket/4724">#4724</a> : Using the mouse to insert a link in IE might create incorrect results.</li> <li><a href="http://dev.fckeditor.net/ticket/4640">#4640</a> : Small optimizations for the fileBrowser plugin.</li> <li><a href="http://dev.fckeditor.net/ticket/4583">#4583</a> : The "Target Frame Name" field is now visible when target is set to 'frame' only.</li> <li><a href="http://dev.fckeditor.net/ticket/4863">#4863</a> : Fixing iframedialog's height doesn't stretch to 100% (except IE Quirks).</li> <li><a href="http://dev.fckeditor.net/ticket/4964">#4964</a> : The BACKSPACE key positioning was not correct in some cases with Firefox.</li> <li><a href="http://dev.fckeditor.net/ticket/4980">#4980</a> : Setting border, vspace and hspace of images to zero was not working.</li> <li><a href="http://dev.fckeditor.net/ticket/4773">#4773</a> : The fileBrowser plugin was overwriting onClick functions eventually defined on fileButton elements.</li> <li><a href="http://dev.fckeditor.net/ticket/4731">#4731</a> : The clipboard plugin was missing a reference to the dialog plugin.</li> <li><a href="http://dev.fckeditor.net/ticket/5051">#5051</a> : The about plugin was missing a reference to the dialog plugin.</li> <li><a href="http://dev.fckeditor.net/ticket/5146">#5146</a> : The wsc plugin was missing a reference to the dialog plugin.</li> <li><a href="http://dev.fckeditor.net/ticket/4632">#4632</a> : The print command will now properly break on the insertion point of page break for printing.</li> <li><a href="http://dev.fckeditor.net/ticket/4862">#4862</a> : The English (United Kingdom) language file has been renamed to en-gb.js.</li> <li><a href="http://dev.fckeditor.net/ticket/4618">#4618</a> : Selecting an emoticon or the lock and reset buttons in the image dialog fired the onBeforeUnload event in IE.</li> <li><a href="http://dev.fckeditor.net/ticket/4678">#4678</a> : It was not possible to set tables' width to empty value.</li> <li><a href="http://dev.fckeditor.net/ticket/5012">#5012</a> : Fixed dependency issues with the menu plugin.</li> <li><a href="http://dev.fckeditor.net/ticket/5040">#5040</a> : The editor will not properly ignore font related settings that have extra item separators (semi-colons).</li> <li><a href="http://dev.fckeditor.net/ticket/4046">#4046</a> : Justify should respect config.enterMode = CKEDITOR.ENTER_BR.</li> <li><a href="http://dev.fckeditor.net/ticket/4622">#4622</a> : Inserting tables multiple times was corrupting the undo system.</li> <li><a href="http://dev.fckeditor.net/ticket/4647">#4647</a> : [IE] Selection on an element within positioned container is lost after open context-menu then click one menu item.</li> <li><a href="http://dev.fckeditor.net/ticket/4683">#4683</a> : Double-quote character in attribute values was not escaped in the editor output.</li> <li><a href="http://dev.fckeditor.net/ticket/4762">#4762</a> : [IE] Unexpected vertical-scrolling behavior happens whenever focus is moving out of editor in source mode.</li> <li><a href="http://dev.fckeditor.net/ticket/4772">#4772</a> : Text color was not being applied properly on links.</li> <li><a href="http://dev.fckeditor.net/ticket/4795">#4795</a> : [IE] Press 'Del' key on horizontal line or table result in error.</li> <li><a href="http://dev.fckeditor.net/ticket/4824">#4824</a> : [IE] &lt;br/&gt; at the very first table cell breaks the editor selection.</li> <li><a href="http://dev.fckeditor.net/ticket/4851">#4851</a> : [IE] Delete table rows with context-menu may cause error.</li> <li><a href="http://dev.fckeditor.net/ticket/4951">#4951</a> : Replacing text with empty string was throwing errors.</li> <li><a href="http://dev.fckeditor.net/ticket/4963">#4963</a> : Link dialog was not opening properly for e-mail type links.</li> <li><a href="http://dev.fckeditor.net/ticket/5043">#5043</a> : Removed the possibility of having an unwanted script tag being outputted with the editor contents.</li> <li><a href="http://dev.fckeditor.net/ticket/3678">#3678</a> : There were issues when editing links inside floating divs with IE.</li> <li><a href="http://dev.fckeditor.net/ticket/4763">#4763</a> : Pressing ENTER key with text selected was not deleting the text in some situations.</li> <li><a href="http://dev.fckeditor.net/ticket/5096">#5096</a> : Simple ampersand attribute value doesn't work for more than one occurrence.</li> <li><a href="http://dev.fckeditor.net/ticket/3494">#3494</a> : Context menu is too narrow in some translations.</li> <li><a href="http://dev.fckeditor.net/ticket/5005">#5005</a> : Fixed HTML errors in PHP samples.</li> <li><a href="http://dev.fckeditor.net/ticket/5123">#5123</a> : Fixed broken XHTML in User Interface Languages sample.</li> <li><a href="http://dev.fckeditor.net/ticket/4893">#4893</a> : Editor now understands table cell inline styles.</li> <li><a href="http://dev.fckeditor.net/ticket/4611">#4611</a> : Selection around &lt;select&gt; in editor doesn't cause error anymore.</li> <li><a href="http://dev.fckeditor.net/ticket/4886">#4886</a> : Extra BR tags were being created in the output HTML.</li> <li><a href="http://dev.fckeditor.net/ticket/4933">#4933</a> : Empty tags with BR were being left in the DOM.</li> <li><a href="http://dev.fckeditor.net/ticket/5127">#5127</a> : There were errors when removing dialog definition pages through code.</li> <li><a href="http://dev.fckeditor.net/ticket/4767">#4767</a> : CKEditor was not working when ckeditor_source.js is loaded in the &lt;body&gt; .</li> <li><a href="http://dev.fckeditor.net/ticket/5062">#5062</a> : Avoided security warning message when loading the wysiwyg area in IE6 under HTTPS.</li> <li><a href="http://dev.fckeditor.net/ticket/5135">#5135</a> : The TAB key will now behave properly when in Source mode.</li> <li><a href="http://dev.fckeditor.net/ticket/4988">#4988</a> : It wasn't possible to use forcePasteAsPlainText with Safari on Mac.</li> <li><a href="http://dev.fckeditor.net/ticket/5095">#5095</a> : Safari on Mac deleted the current selection in the editor when Edit menu was clicked.</li> <li><a href="http://dev.fckeditor.net/ticket/5140">#5140</a> : In High Contrast mode, arrows were now been displayed for menus with submenus.</li> <li><a href="http://dev.fckeditor.net/ticket/5163">#5163</a> : The undo system was not working on some specific cases.</li> <li><a href="http://dev.fckeditor.net/ticket/5162">#5162</a> : The ajax sample was throwing errors when loading data.</li> <li><a href="http://dev.fckeditor.net/ticket/4999">#4999</a> : The Template dialog was not generating an undo snapshot.</li> <li>Updated the following language files:<ul> <li><a href="http://dev.fckeditor.net/ticket/5006">#5006</a> : Dutch;</li> <li><a href="http://dev.fckeditor.net/ticket/5039">#5039</a> : Finnish;</li> <li><a href="http://dev.fckeditor.net/ticket/5148">#5148</a> : Hebrew;</li> <li><a href="http://dev.fckeditor.net/ticket/5071">#5071</a> : Russian;</li> <li><a href="http://dev.fckeditor.net/ticket/5147">#5147</a> : Spanish;</li> </ul></li> </ul> <h3> CKEditor 3.1</h3> <p> New features:</p> <ul> <li><a href="http://dev.fckeditor.net/ticket/4067">#4067</a> : Introduced the full page editing support (from &lt;html&gt; to &lt;/html&gt;).</li> <li><a href="http://dev.fckeditor.net/ticket/4228">#4228</a> : Introduced the Shared Spaces feature.</li> <li><a href="http://dev.fckeditor.net/ticket/4379">#4379</a> : Introduced the new powerful pasting system and word cleanup procedure, including enhancements to the paste as plain text feature.</li> <li><a href="http://dev.fckeditor.net/ticket/2872">#2872</a> : Introduced the new native PHP API, the first standardized server side support.</li> <li><a href="http://dev.fckeditor.net/ticket/4210">#4210</a> : Added CKEditor plugin for jQuery.</li> <li><a href="http://dev.fckeditor.net/ticket/2885">#2885</a> : Added 'div' dialog and corresponding context menu options.</li> <li><a href="http://dev.fckeditor.net/ticket/4574">#4574</a> : Added the table merging tools and corresponding context menu options.</li> <li><a href="http://dev.fckeditor.net/ticket/4340">#4340</a> : Added the email protection option for link dialog.</li> <li><a href="http://dev.fckeditor.net/ticket/4463">#4463</a> : Added inline CSS support in all places where custom stylesheet could apply.</li> <li><a href="http://dev.fckeditor.net/ticket/3881">#3881</a> : Added color dialog for 'more color' option in color buttons.</li> <li><a href="http://dev.fckeditor.net/ticket/4341">#4341</a> : Added the 'showborder' plugin.</li> <li><a href="http://dev.fckeditor.net/ticket/4549">#4549</a> : Make the anti-cache query string configurable.</li> <li><a href="http://dev.fckeditor.net/ticket/4708">#4708</a> : Added the 'htmlEncodeOutput' config option.</li> <li><a href="http://dev.fckeditor.net/ticket/4342">#4342</a> : Introduced the bodyId and bodyClass settings to specify the id and class. to be used in the editing area at runtime.</li> <li><a href="http://dev.fckeditor.net/ticket/3401">#3401</a> : Introduced the baseHref setting so it's possible to set the URL to be used to resolve absolute and relative URLs in the contents.</li> <li><a href="http://dev.fckeditor.net/ticket/4729">#4729</a> : Added support to fake elements for comments.</li> </ul> <p> Fixed issues:</p> <ul> <li><a href="http://dev.fckeditor.net/ticket/4707">#4707</a> : Fixed invalid link is requested in image preview.</li> <li><a href="http://dev.fckeditor.net/ticket/4461">#4461</a> : Fixed toolbar separator line along side combo enlarging the toolbar height.</li> <li><a href="http://dev.fckeditor.net/ticket/4596">#4596</a> : Fixed image re-size lock buttons aren't accessible in high-contrast mode.</li> <li><a href="http://dev.fckeditor.net/ticket/4676">#4676</a> : Fixed editing tables using table properties dialog overwrites original style values.</li> <li><a href="http://dev.fckeditor.net/ticket/4714">#4714</a> : Fixed IE6 JavaScript error when editing flash by commit 'Flash' dialog.</li> <li><a href="http://dev.fckeditor.net/ticket/3905">#3905</a> : Fixed 'wysiwyg' mode causes unauthenticated content warnings over SSL in FF 3.5.</li> <li><a href="http://dev.fckeditor.net/ticket/4768">#4768</a> : Fixed open context menu in IE throws js error when focus is not inside document.</li> <li><a href="http://dev.fckeditor.net/ticket/4822">#4822</a> : Fixed applying 'Headers' to existing table does not work in IE.</li> <li><a href="http://dev.fckeditor.net/ticket/4855">#4855</a> : Fixed toolbar doesn't wrap well for 'v2' skin in all browsers.</li> <li><a href="http://dev.fckeditor.net/ticket/4882">#4882</a> : Fixed auto detect paste from MS-Word is not working for Safari.</li> <li><a href="http://dev.fckeditor.net/ticket/4882">#4882</a> : Fixed unexpected margin style left behind on content cleaning up from MS-Word.</li> <li><a href="http://dev.fckeditor.net/ticket/4896">#4896</a> : Fixed paste nested list from MS-Word with measurement units set to cm is broken.</li> <li><a href="http://dev.fckeditor.net/ticket/4899">#4899</a> : Fixed unable to undo pre-formatted style.</li> <li><a href="http://dev.fckeditor.net/ticket/4900">#4900</a> : Fixed ratio-lock inconsistent between browsers.</li> <li><a href="http://dev.fckeditor.net/ticket/4901">#4901</a> : Fixed unable to edit any link with popup window's features in Firefox.</li> <li><a href="http://dev.fckeditor.net/ticket/4904">#4904</a> : Fixed when paste happen from dialog, it always throw JavaScript error.</li> <li><a href="http://dev.fckeditor.net/ticket/4905">#4905</a> : Fixed paste plain text result incorrect when content from dialog.</li> <li><a href="http://dev.fckeditor.net/ticket/4889">#4889</a> : Fixed unable to undo 'New Page' command after typing inside editor.</li> <li><a href="http://dev.fckeditor.net/ticket/4892">#4892</a> : Fixed table alignment style is not properly represented by the wrapping div.</li> <li><a href="http://dev.fckeditor.net/ticket/4918">#4918</a> : Fixed switching mode when maximized is showing background page contents.</li> </ul> <h3> CKEditor 3.0.2</h3> <p> New features:</p> <ul> <li><a href="http://dev.fckeditor.net/ticket/4343">#4343</a> : Added the configuration option &#39;browserContextMenuOnCtrl&#39; so it&#39;s possible to enable the default browser context menu by holding the CTRL key.</li> </ul> <p> Fixed issues:</p> <ul> <li><a href="http://dev.fckeditor.net/ticket/4552">#4552</a> : Fixed float panel doesn't show up since editor instanced been destroyed once.</li> <li><a href="http://dev.fckeditor.net/ticket/3918">#3918</a> : Fixed fake object is editable with Image dialog.</li> <li><a href="http://dev.fckeditor.net/ticket/4053">#4053</a> : Fixed 'Form Properties' missing from context menu when selection collapsed inside form.</li> <li><a href="http://dev.fckeditor.net/ticket/4401">#4401</a> : Fixed customized by removing 'upload' tab page from 'Link dialog' cause JavaScript error.</li> <li><a href="http://dev.fckeditor.net/ticket/4477">#4477</a> : Adding missing tag names in object style elements.</li> <li><a href="http://dev.fckeditor.net/ticket/4567">#4567</a> : Fixed IE throw error when pressing BACKSPACE in source mode.</li> <li><a href="http://dev.fckeditor.net/ticket/4573">#4573</a> : Fixed 'IgnoreEmptyPargraph' config doesn't work with the config 'entities' is set to 'false'.</li> <li><a href="http://dev.fckeditor.net/ticket/4614">#4614</a> : Fixed attribute protection fails because of line-break.</li> <li><a href="http://dev.fckeditor.net/ticket/4546">#4546</a> : Fixed UIColor plugin doesn't work when editor id contains CSS selector preserved keywords.</li> <li><a href="http://dev.fckeditor.net/ticket/4609">#4609</a> : Fixed flash object is lost when loading data from outside editor.</li> <li><a href="http://dev.fckeditor.net/ticket/4625">#4625</a> : Fixed editor stays visible in a div with style 'visibility:hidden'.</li> <li><a href="http://dev.fckeditor.net/ticket/4621">#4621</a> : Fixed clicking below table caused an empty table been generated.</li> <li><a href="http://dev.fckeditor.net/ticket/3373">#3373</a> : Fixed empty context menu when there's no menu item at all.</li> <li><a href="http://dev.fckeditor.net/ticket/4473">#4473</a> : Fixed setting rules on the same element tag name throws error.</li> <li><a href="http://dev.fckeditor.net/ticket/4514">#4514</a> : Fixed press 'Back' button breaks wysiwyg editing mode is Firefox.</li> <li><a href="http://dev.fckeditor.net/ticket/4542">#4542</a> : Fixed unable to access buttons using tab key in Safari and Opera.</li> <li><a href="http://dev.fckeditor.net/ticket/4577">#4577</a> : Fixed relative link url is broken after opening 'Link' dialog.</li> <li><a href="http://dev.fckeditor.net/ticket/4597">#4597</a> : Fixed custom style with same attribute name but different attribute value doesn't work.</li> <li><a href="http://dev.fckeditor.net/ticket/4651">#4651</a> : Fixed 'Deleted' and 'Inserted' text style is not rendering in wysiwyg mode and is wrong is source mode.</li> <li><a href="http://dev.fckeditor.net/ticket/4654">#4654</a> : Fixed 'CKEDITOR.config.font_defaultLabel(fontSize_defaultLabel)' is not working.</li> <li><a href="http://dev.fckeditor.net/ticket/3950">#3950</a> : Fixed table column insertion incorrect when selecting empty cell area.</li> <li><a href="http://dev.fckeditor.net/ticket/3912">#3912</a> : Fixed UIColor not working in IE when page has more than 30+ editors.</li> <li><a href="http://dev.fckeditor.net/ticket/4031">#4031</a> : Fixed mouse cursor on toolbar combo has more than 3 shapes.</li> <li><a href="http://dev.fckeditor.net/ticket/4041">#4041</a> : Fixed open context menu on multiple cells to remove them result in only one removed.</li> <li><a href="http://dev.fckeditor.net/ticket/4185">#4185</a> : Fixed resize handler effect doesn't affect flash object on output.</li> <li><a href="http://dev.fckeditor.net/ticket/4196">#4196</a> : Fixed 'Remove Numbered/Bulleted List' on nested list doesn't work well on nested list.</li> <li><a href="http://dev.fckeditor.net/ticket/4200">#4200</a> : Fixed unable to insert 'password' type filed with attributes.</li> <li><a href="http://dev.fckeditor.net/ticket/4530">#4530</a> : Fixed context menu couldn't open in Opera.</li> <li><a href="http://dev.fckeditor.net/ticket/4536">#4536</a> : Fixed keyboard navigation doesn't work at all in IE quirks mode.</li> <li><a href="http://dev.fckeditor.net/ticket/4584">#4584</a> : Fixed updated link Target field is not updating when updating to certain values.</li> <li><a href="http://dev.fckeditor.net/ticket/4603">#4603</a> : Fixed unable to disable submenu items in contextmenu.</li> <li><a href="http://dev.fckeditor.net/ticket/4672">#4672</a> : Fixed unable to redo the insertion of horizontal line.</li> <li><a href="http://dev.fckeditor.net/ticket/4677">#4677</a> : Fixed 'Tab' key is trapped by hidden dialog elements.</li> <li><a href="http://dev.fckeditor.net/ticket/4073">#4073</a> : Fixed insert template with replace option could result in empty document.</li> <li><a href="http://dev.fckeditor.net/ticket/4455">#4455</a> : Fixed unable to start editing when image inside document not loaded.</li> <li><a href="http://dev.fckeditor.net/ticket/4517">#4517</a> : Fixed 'dialog_backgroundCoverColor' doesn't work on IE6.</li> <li><a href="http://dev.fckeditor.net/ticket/3165">#3165</a> : Fixed enter key in empty list item before nested one result in collapsed line.</li> <li><a href="http://dev.fckeditor.net/ticket/4527">#4527</a> : Fixed checkbox generate invalid 'checked' attribute.</li> <li><a href="http://dev.fckeditor.net/ticket/1659">#1659</a> : Fixed unable to click below content to start editing in IE with 'config.docType' setting to standard compliant.</li> <li><a href="http://dev.fckeditor.net/ticket/3933">#3933</a> : Fixed extra &lt;br&gt; left at the end of document when the last element is a table.</li> <li><a href="http://dev.fckeditor.net/ticket/4736">#4736</a> : Fixed PAGE UP and PAGE DOWN keys in standards mode are not working.</li> <li><a href="http://dev.fckeditor.net/ticket/4725">#4725</a> : Fixed hitting 'enter' before html comment node produces a JavaScript error.</li> <li><a href="http://dev.fckeditor.net/ticket/4522">#4522</a> : Fixed unable to redo when typing after insert an image with relative url.</li> <li><a href="http://dev.fckeditor.net/ticket/4594">#4594</a> : Fixed context menu goes off-screen when mouse is at right had side of screen.</li> <li><a href="http://dev.fckeditor.net/ticket/4673">#4673</a> : Fixed undo not available straight away if shift key is used to enter first character.</li> <li><a href="http://dev.fckeditor.net/ticket/4690">#4690</a> : Fixed the parsing of nested inline elements.</li> <li><a href="http://dev.fckeditor.net/ticket/4450">#4450</a> : Fixed selecting multiple table cells before apply justify commands generates spurious paragraph in Firefox.</li> <li><a href="http://dev.fckeditor.net/ticket/4733">#4733</a> : Fixed dialog opening sometimes hang up Firefox and Safari.</li> <li><a href="http://dev.fckeditor.net/ticket/4498">#4498</a> : Fixed toolbar collapse button missing tooltip.</li> <li><a href="http://dev.fckeditor.net/ticket/4738">#4738</a> : Fixed inserting table inside bold/italic/underline generates error on ENTER_BR mode.</li> <li><a href="http://dev.fckeditor.net/ticket/4246">#4246</a> : Fixed avoid XHTML deprecated attributes for image styling.</li> <li><a href="http://dev.fckeditor.net/ticket/4543">#4543</a> : Fixed unable to move cursor between table and hr.</li> <li><a href="http://dev.fckeditor.net/ticket/4764">#4764</a> : Fixed wrong exception message when CKEDITOR.editor.append() to non-existing elements.</li> <li><a href="http://dev.fckeditor.net/ticket/4521">#4521</a> : Fixed dialog layout in IE6/7 may have scroll-bar and other weird effects.</li> <li><a href="http://dev.fckeditor.net/ticket/4709">#4709</a> : Fixed inconsistent scroll-bar behavior on IE.</li> <li><a href="http://dev.fckeditor.net/ticket/4776">#4776</a> : Fixed preview page failed to open when relative URl contains in document.</li> <li><a href="http://dev.fckeditor.net/ticket/4812">#4812</a> : Fixed 'Esc' key not working on dialogs in Opera.</li> <li>Updated the following language files:<ul> <li><a href="http://dev.fckeditor.net/ticket/4346">#4346</a> : Dutch;</li> <li><a href="http://dev.fckeditor.net/ticket/4837">#4837</a> : Finnish;</li> <li><a href="http://dev.fckeditor.net/ticket/4371">#4371</a> : Hebrew;</li> <li><a href="http://dev.fckeditor.net/ticket/4371">#4607</a> <a href="http://dev.fckeditor.net/ticket/4713">#4713</a> : Japanese;</li> <li><a href="http://dev.fckeditor.net/ticket/4660">#4660</a> : Norwegian.</li> </ul></li> </ul> <h3> CKEditor 3.0.1</h3> <p> New features:</p> <ul> <li><a href="http://dev.fckeditor.net/ticket/4219">#4219</a> : Added fallback mechanism for config.language.</li> <li><a href="http://dev.fckeditor.net/ticket/4194">#4194</a> : Added support for using multiple css style sheets within the editor.</li> </ul> <p> Fixed issues:</p> <ul> <li><a href="http://dev.fckeditor.net/ticket/3898">#3898</a> : Added validation for URL value in Image dialog.</li> <li><a href="http://dev.fckeditor.net/ticket/3528">#3528</a> : Fixed Context Menu issue when triggered using Shift+F10.</li> <li><a href="http://dev.fckeditor.net/ticket/4028">#4028</a> : Maximize control's tool tip was wrong once it is maximized.</li> <li><a href="http://dev.fckeditor.net/ticket/4237">#4237</a> : Toolbar is chopped off in Safari browser 3.x.</li> <li><a href="http://dev.fckeditor.net/ticket/4241">#4241</a> : Float panels are left on screen while editor is destroyed.</li> <li><a href="http://dev.fckeditor.net/ticket/4274">#4274</a> : Double click event is incorrect handled in 'divreplace' sample.</li> <li><a href="http://dev.fckeditor.net/ticket/4354">#4354</a> : Fixed TAB key on toolbar to not focus disabled buttons.</li> <li><a href="http://dev.fckeditor.net/ticket/3856">#3856</a> : Fixed focus and blur events in source view mode.</li> <li><a href="http://dev.fckeditor.net/ticket/3438">#3438</a> : Floating panels are off by (-1px, 0px) in RTL mode.</li> <li><a href="http://dev.fckeditor.net/ticket/3370">#3370</a> : Refactored use of CKEDITOR.env.isCustomDomain().</li> <li><a href="http://dev.fckeditor.net/ticket/4230">#4230</a> : HC detection caused js error.</li> <li><a href="http://dev.fckeditor.net/ticket/3978">#3978</a> : Fixed setStyle float on IE7 strict.</li> <li><a href="http://dev.fckeditor.net/ticket/4262">#4262</a> : Tab and Shift+Tab was not working to cycle through CTRL+SHIFT+F10 context menu in IE.</li> <li><a href="http://dev.fckeditor.net/ticket/3633">#3633</a> : Default context menu isn't disabled in toolbar, status bar, panels...</li> <li><a href="http://dev.fckeditor.net/ticket/3897">#3897</a> : Now there is no image previews when the URL is empty in image dialog.</li> <li><a href="http://dev.fckeditor.net/ticket/4048">#4048</a> : Context submenu was lacking uiColor.</li> <li><a href="http://dev.fckeditor.net/ticket/3568">#3568</a> : Dialogs now select all text when tabbing to text inputs.</li> <li><a href="http://dev.fckeditor.net/ticket/3727">#3727</a> : Cell Properties dialog was missing color selection option.</li> <li><a href="http://dev.fckeditor.net/ticket/3517">#3517</a> : Fixed "Match cyclic" field in Find & Replace dialog.</li> <li><a href="http://dev.fckeditor.net/ticket/4368">#4368</a> : borderColor table cell attribute haven't worked for none-IE</li> <li><a href="http://dev.fckeditor.net/ticket/4203">#4203</a> : In IE quirks mode + toolbar collapsed + source mode editing block height was incorrect.</li> <li><a href="http://dev.fckeditor.net/ticket/4387">#4387</a> : Fixed: right clicking in Kama skin can lead to a javascript error.</li> <li><a href="http://dev.fckeditor.net/ticket/4397">#4397</a> : Wysiwyg mode caused the host page scroll.</li> <li><a href="http://dev.fckeditor.net/ticket/4385">#4385</a> : Fixed editor's auto adjusting on DOM structure were confusing the dirty checking mechanism.</li> <li><a href="http://dev.fckeditor.net/ticket/4397">#4397</a> : Fixed regression of [3816] where turn on design mode was causing Firefox3 to scroll the host page.</li> <li><a href="http://dev.fckeditor.net/ticket/4254">#4254</a> : Added basic API sample.</li> <li><a href="http://dev.fckeditor.net/ticket/4107">#4107</a> : Normalize css font-family style text for correct comparision.</li> <li><a href="http://dev.fckeditor.net/ticket/3664">#3664</a> : Insert block element in empty editor document should not create new paragraph.</li> <li><a href="http://dev.fckeditor.net/ticket/4037">#4037</a> : 'id' attribute is missing with Flash dialog advanced page.</li> <li><a href="http://dev.fckeditor.net/ticket/4047">#4047</a> : Delete selected control type element when 'Backspace' is pressed on it.</li> <li><a href="http://dev.fckeditor.net/ticket/4191">#4191</a> : Fixed: dialog changes confirmation on image dialog appeared even when no changes have been made.</li> <li><a href="http://dev.fckeditor.net/ticket/4351">#4351</a> : Dash and dot could appear in attribute names.</li> <li><a href="http://dev.fckeditor.net/ticket/4355">#4355</a> : 'maximize' and 'showblock' commands shouldn't take editor focus.</li> <li><a href="http://dev.fckeditor.net/ticket/4504">#4504</a> : Fixed 'Enter'/'Esc' key is not working on dialog button.</li> <li><a href="http://dev.fckeditor.net/ticket/4245">#4245</a> : 'Strange Template' now come with a style attribute for width.</li> <li><a href="http://dev.fckeditor.net/ticket/4512">#4512</a> : Fixed styles plugin incorrectly adding semicolons to style text.</li> <li><a href="http://dev.fckeditor.net/ticket/3855">#3855</a> : Fixed loading unminified _source files when ckeditor_source.js is used.</li> <li><a href="http://dev.fckeditor.net/ticket/3717">#3717</a> : Dialog settings defaults can now be overridden in-page through the CKEDITOR.config object.</li> <li><a href="http://dev.fckeditor.net/ticket/4481">#4481</a> : The 'stylesCombo_stylesSet' configuration entry didn't work for full URLs.</li> <li><a href="http://dev.fckeditor.net/ticket/4480">#4480</a> : Fixed scope attribute in th.</li> <li><a href="http://dev.fckeditor.net/ticket/4467">#4467</a> : Fixed bug to use custom icon in context menus. Thanks to george.</li> <li><a href="http://dev.fckeditor.net/ticket/4190">#4190</a> : Fixed select field dialog layout in Safari.</li> <li><a href="http://dev.fckeditor.net/ticket/4518">#4518</a> : Fixed unable to open dialog without editor focus in IE.</li> <li><a href="http://dev.fckeditor.net/ticket/4519">#4519</a> : Fixed maximize without editor focus throw error in IE.</li> <li>Updated the following language files:<ul> <li><a href="http://dev.fckeditor.net/ticket/3947">#3947</a> : Arabic;</li> <li><a href="http://dev.fckeditor.net/ticket/4466">#4466</a> : Czech;</li> <li><a href="http://dev.fckeditor.net/ticket/4363">#4363</a> : Danish;</li> <li><a href="http://dev.fckeditor.net/ticket/4346">#4346</a> : Dutch;</li> <li><a href="http://dev.fckeditor.net/ticket/4371">#4371</a> <a href="http://dev.fckeditor.net/ticket/4456">#4456</a> : Hebrew;</li> <li><a href="http://dev.fckeditor.net/ticket/4382">#4382</a> : Polish.</li> </ul></li> </ul> <h3> CKEditor 3.0</h3> <p> New features:</p> <ul> <li><a href="http://dev.fckeditor.net/ticket/3188">#3188</a> : Introduce &lt;pre&gt; formatting feature when converting from other blocks.</li> <li><a href="http://dev.fckeditor.net/ticket/4445">#4445</a> : editor::setData now support an optional callback parameter.</li> </ul> <p> Fixed issues:</p> <ul> <li><a href="http://dev.fckeditor.net/ticket/2856">#2856</a> : Fixed problem with inches in Paste From Word plugin.</li> <li><a href="http://dev.fckeditor.net/ticket/3929">#3929</a> : Using Paste dialog, the text is pasted into current selection</li> <li><a href="http://dev.fckeditor.net/ticket/3920">#3920</a> : Mouse cursor over characters in Special Character dialog now is correct</li> <li><a href="http://dev.fckeditor.net/ticket/3882">#3882</a> : Fixed an issue with PasteFromWord dialog in which default values was ignored</li> <li><a href="http://dev.fckeditor.net/ticket/3859">#3859</a> : Fixed Flash dialog layout in Webkit</li> <li><a href="http://dev.fckeditor.net/ticket/3852">#3852</a> : Disabled textarea resizing in dialogs</li> <li><a href="http://dev.fckeditor.net/ticket/3831">#3831</a> : The attempt to remove the contextmenu plugin will not anymore break the editor</li> <li><a href="http://dev.fckeditor.net/ticket/3781">#3781</a> : Colorbutton is now disabled in 'source' mode</li> <li><a href="http://dev.fckeditor.net/ticket/3848">#3848</a> : Fixed an issue with Webkit in witch elements in the Image and Link dialogs had wrong dimensions.</li> <li><a href="http://dev.fckeditor.net/ticket/3808">#3808</a> : Fixed UI Color Picker dialog size in example page.</li> <li><a href="http://dev.fckeditor.net/ticket/3658">#3658</a> : Editor had horizontal scrollbar in IE6.</li> <li><a href="http://dev.fckeditor.net/ticket/3819">#3819</a> : The cursor was not visible when applying style to collapsed selections in Firefox 2.</li> <li><a href="http://dev.fckeditor.net/ticket/3809">#3809</a> : Fixed beam cursor when mouse cursor is over text-only buttons in IE.</li> <li><a href="http://dev.fckeditor.net/ticket/3815">#3815</a> : Fixed an issue with the form dialog in which the "enctype" attribute is outputted as "encoding".</li> <li><a href="http://dev.fckeditor.net/ticket/3785">#3785</a> : Fixed an issue in CKEDITOR.tools.htmlEncode() which incorrectly outputs &amp;nbsp; in IE8.</li> <li><a href="http://dev.fckeditor.net/ticket/3820">#3820</a> : Fixed an issue in bullet list command in which a list created at the bottom of another gets merged to the top. </li> <li><a href="http://dev.fckeditor.net/ticket/3830">#3830</a> : Table cell properties dialog doesn't apply to all selected cells.</li> <li><a href="http://dev.fckeditor.net/ticket/3835">#3835</a> : Element path is not refreshed after click on 'newpage'; and safari is not putting focus on document also. </li> <li><a href="http://dev.fckeditor.net/ticket/3821">#3821</a> : Fixed an issue with JAWS in which toolbar items are read inconsistently between virtual cursor modes.</li> <li><a href="http://dev.fckeditor.net/ticket/3789">#3789</a> : The &quot;src&quot; attribute was getting duplicated in some situations.</li> <li><a href="http://dev.fckeditor.net/ticket/3591">#3591</a> : Protecting flash related elements including '&lt;object&gt;', '&lt;embed&gt;' and '&lt;param&gt;'. </li> <li><a href="http://dev.fckeditor.net/ticket/3759">#3759</a> : Fixed CKEDITOR.dom.element::scrollIntoView logic bug which scroll even element is inside viewport. </li> <li><a href="http://dev.fckeditor.net/ticket/3773">#3773</a> : Fixed remove list will merge lines. </li> <li><a href="http://dev.fckeditor.net/ticket/3829">#3829</a> : Fixed remove empty link on output data.</li> <li><a href="http://dev.fckeditor.net/ticket/3730">#3730</a> : Indent is performing on the whole block instead of selected lines in enterMode = BR.</li> <li><a href="http://dev.fckeditor.net/ticket/3844">#3844</a> : Fixed UndoManager register keydown on obsoleted document</li> <li><a href="http://dev.fckeditor.net/ticket/3805">#3805</a> : Enabled SCAYT plugin for IE.</li> <li><a href="http://dev.fckeditor.net/ticket/3834">#3834</a> : Context menu on table caption was incorrect.</li> <li><a href="http://dev.fckeditor.net/ticket/3812">#3812</a> : Fixed an issue in which the editor may show up empty or uneditable in IE7, 8 and Firefox 3.</li> <li><a href="http://dev.fckeditor.net/ticket/3825">#3825</a> : Fixed JS error when opening spellingcheck.</li> <li><a href="http://dev.fckeditor.net/ticket/3862">#3862</a> : Fixed html parser infinite loop on certain malformed source code.</li> <li><a href="http://dev.fckeditor.net/ticket/3639">#3639</a> : Button size was inconsistent.</li> <li><a href="http://dev.fckeditor.net/ticket/3874">#3874</a> : Paste as plain text in Safari loosing lines.</li> <li><a href="http://dev.fckeditor.net/ticket/3849">#3849</a> : Fixed IE8 crashes when applying lists and indenting.</li> <li><a href="http://dev.fckeditor.net/ticket/3876">#3876</a> : Changed dialog checkbox and radio labels to explicit labels.</li> <li><a href="http://dev.fckeditor.net/ticket/3843">#3843</a> : Fixed context submenu position in IE 6 & 7 RTL.</li> <li><a href="http://dev.fckeditor.net/ticket/3864">#3864</a> : [FF]Document is not editable after inserting element on a fresh page.</li> <li><a href="http://dev.fckeditor.net/ticket/3883">#3883</a> : Fixed removing inline style logic incorrect on Firefox2.</li> <li><a href="http://dev.fckeditor.net/ticket/3884">#3884</a> : Empty "href" attribute was duplicated on output data.</li> <li><a href="http://dev.fckeditor.net/ticket/3858">#3858</a> : Fixed the issue where toolbars break up in IE6 and IE7 after the browser is resized.</li> <li><a href="http://dev.fckeditor.net/ticket/3868">#3868</a> : [chrome] SCAYT toolbar options was in reversed order.</li> <li><a href="http://dev.fckeditor.net/ticket/3875">#3875</a> : Fixed an issue in Safari where table row/column/cell menus are not useable when table cells are selected.</li> <li><a href="http://dev.fckeditor.net/ticket/3896">#3896</a> : The editing area was flashing when switching forth and back to source view.</li> <li><a href="http://dev.fckeditor.net/ticket/3894">#3894</a> : Fixed an issue where editor failed to initialize when using the on-demand loading way.</li> <li><a href="http://dev.fckeditor.net/ticket/3903">#3903</a> : Color button plugin doesn't read config entry from editor instance correctly.</li> <li><a href="http://dev.fckeditor.net/ticket/3801">#3801</a> : Comments at the start of the document was lost in IE.</li> <li><a href="http://dev.fckeditor.net/ticket/3871">#3871</a> : Unable to redo when undos to the front of snapshots stack.</li> <li><a href="http://dev.fckeditor.net/ticket/3909">#3909</a> : Move focus from editor into a text input control is broken.</li> <li><a href="http://dev.fckeditor.net/ticket/3870">#3870</a> : The empty paragraph desappears when hitting ENTER after &quot;New Page&quot;.</li> <li><a href="http://dev.fckeditor.net/ticket/3887">#3887</a> : Fixed an issue in which the create list command may leak outside of a selected table cell and into the rest of document.</li> <li><a href="http://dev.fckeditor.net/ticket/3916">#3916</a> : Fixed maximize does not enlarge editor width when width is set.</li> <li><a href="http://dev.fckeditor.net/ticket/3879">#3879</a> : [webkit] Color button panel had incorrect size on first open.</li> <li><a href="http://dev.fckeditor.net/ticket/3839">#3839</a> : Update Scayt plugin to reflect the latest change from SpellChecker.net.</li> <li><a href="http://dev.fckeditor.net/ticket/3742">#3742</a> : Fixed wrong dialog layout for dialogs without tab bar in IE RTL mode .</li> <li><a href="http://dev.fckeditor.net/ticket/3671">#3671</a> : Fixed body fixing should be applied to the real type under fake elements.</li> <li><a href="http://dev.fckeditor.net/ticket/3836">#3836</a> : Fixed remove list in enterMode=BR will merge sibling text to one line.</li> <li><a href="http://dev.fckeditor.net/ticket/3949">#3949</a> : Fixed enterKey within pre-formatted text introduce wrong line-break.</li> <li><a href="http://dev.fckeditor.net/ticket/3878">#3878</a> : Whenever possible, dialogs will not present scrollbars if the content is too big for its standard size.</li> <li><a href="http://dev.fckeditor.net/ticket/3782">#3782</a> : Remove empty list in table cell result in collapsed cell.</li> <li>Updated the following language files:<ul> <li><a href="http://dev.fckeditor.net/ticket/4183">#4183</a> : Basque;</li> <li><a href="http://dev.fckeditor.net/ticket/3837">#3837</a> : Brazilian Portuguese;</li> <li><a href="http://dev.fckeditor.net/ticket/4171">#4171</a> : Catalan;</li> <li><a href="http://dev.fckeditor.net/ticket/4115">#4115</a> : Chinese (Simplified);</li> <li><a href="http://dev.fckeditor.net/ticket/4179">#4179</a> : Chinese (Traditional);</li> <li><a href="http://dev.fckeditor.net/ticket/4102">#4102</a> : Croatian;</li> <li><a href="http://dev.fckeditor.net/ticket/4105">#4105</a> : French;</li> <li><a href="http://dev.fckeditor.net/ticket/4104">#4104</a> : German;</li> <li><a href="http://dev.fckeditor.net/ticket/4116">#4116</a> : Italian;</li> <li><a href="http://dev.fckeditor.net/ticket/4091">#4091</a> : Japanese;</li> <li><a href="http://dev.fckeditor.net/ticket/4120">#4120</a> : Polish;</li> <li><a href="http://dev.fckeditor.net/ticket/3987">#3987</a> : Spanish;</li> <li><a href="http://dev.fckeditor.net/ticket/4089">#4089</a> : Ukrainian;</li> <li><a href="http://dev.fckeditor.net/ticket/4166">#4166</a> : Vietnamese.</li> </ul></li> <li><a href="http://dev.fckeditor.net/ticket/3984">#3984</a> : [IE]The pre-formatted style is generating error.</li> <li><a href="http://dev.fckeditor.net/ticket/3946">#3946</a> : Fixed unable to hide contextmenu.</li> <li><a href="http://dev.fckeditor.net/ticket/3956">#3956</a> : Fixed About dialog in Source Mode for IE.</li> <li><a href="http://dev.fckeditor.net/ticket/3953">#3953</a> : Fixed keystroke for close Paste dialog.</li> <li><a href="http://dev.fckeditor.net/ticket/3951">#3951</a> : Reset size and lock ratio options were not accessible in Image dialog.</li> <li><a href="http://dev.fckeditor.net/ticket/3921">#3921</a> : Fixed Container scroll issue on IE7.</li> <li><a href="http://dev.fckeditor.net/ticket/3940">#3940</a> : Fixed list operation doesn't stop at table.</li> <li><a href="http://dev.fckeditor.net/ticket/3891">#3891</a> : [IE] Fixed 'automatic' font color doesn't work.</li> <li><a href="http://dev.fckeditor.net/ticket/3972">#3972</a> : Fixed unable to remove a single empty list in document in Firefox with enterMode=BR.</li> <li><a href="http://dev.fckeditor.net/ticket/3973">#3973</a> : Fixed list creation error at the end of document.</li> <li><a href="http://dev.fckeditor.net/ticket/3959">#3959</a> : Pasting styled text from word result in content lost.</li> <li><a href="http://dev.fckeditor.net/ticket/3793">#3793</a> : Combined images into sprites.</li> <li><a href="http://dev.fckeditor.net/ticket/3783">#3783</a> : Fixed indenting command in table cells create collapsed paragraph.</li> <li><a href="http://dev.fckeditor.net/ticket/3968">#3968</a> : About dialog layout was broken with IE+Standards+RTL.</li> <li><a href="http://dev.fckeditor.net/ticket/3991">#3991</a> : In IE quirks, text was not visible in v2 and office2003 skins.</li> <li><a href="http://dev.fckeditor.net/ticket/3983">#3983</a> : In IE, we&#39;ll now silently ignore wrong toolbar definition settings which have extra commas being left around.</li> <li>Fixed the following test cases:<ul> <li><a href="http://dev.fckeditor.net/ticket/3992">#3992</a> : core/ckeditor2.html</li> <li><a href="http://dev.fckeditor.net/ticket/4138">#4138</a> : core/plugins.html</li> <li><a href="http://dev.fckeditor.net/ticket/3801">#3801</a> : plugins/htmldataprocessor/htmldataprocessor.html</li> </ul></li> <li><a href="http://dev.fckeditor.net/ticket/3989">#3989</a> : Host page horizontal scrolling a lot when on having righ-to-left direction.</li> <li><a href="http://dev.fckeditor.net/ticket/4001">#4001</a> : Create link around existing image result incorrect.</li> <li><a href="http://dev.fckeditor.net/ticket/3988">#3988</a> : Destroy editor on form submit event cause error.</li> <li><a href="http://dev.fckeditor.net/ticket/3994">#3994</a> : Insert horizontal line at end of document cause error.</li> <li><a href="http://dev.fckeditor.net/ticket/4074">#4074</a> : Indent error with 'indentClasses' config specified.</li> <li><a href="http://dev.fckeditor.net/ticket/4057">#4057</a> : Fixed anchor is lost after switch between editing modes.</li> <li><a href="http://dev.fckeditor.net/ticket/3644">#3644</a> : Image dialog was missin radio lock.</li> <li><a href="http://dev.fckeditor.net/ticket/4014">#4014</a> : Firefox2 had no dialog button backgrounds.</li> <li><a href="http://dev.fckeditor.net/ticket/4018">#4018</a> : Firefox2 had no richcombo text visible.</li> <li><a href="http://dev.fckeditor.net/ticket/4035">#4035</a> : [IE6] Paste dialog size was too small.</li> <li><a href="http://dev.fckeditor.net/ticket/4049">#4049</a> : Kama skin was too wide with config.width.</li> <li>The following released files now doesn't require the _source folder<ul> <li><a href="http://dev.fckeditor.net/ticket/4086">#4086</a> : _samples/ui_languages.html</li> <li><a href="http://dev.fckeditor.net/ticket/4093">#4093</a> : _tests/core/dom/document.html</li> <li><a href="http://dev.fckeditor.net/ticket/4094">#4094</a> : Smiley plugin file</li> <li><a href="http://dev.fckeditor.net/ticket/4097">#4097</a> : No undo/redo support for fontColor and backgroundColor buttons.</li> </ul></li> <li><a href="http://dev.fckeditor.net/ticket/4085">#4085</a> : Paste and Paste from Word dialogs were not well styled in IE+RTL.</li> <li><a href="http://dev.fckeditor.net/ticket/3982">#3982</a> : Fixed enterKey on empty list item result in weird dom structure.</li> <li><a href="http://dev.fckeditor.net/ticket/4101">#4101</a> : Now it is possible to close dialog before gets focus.</li> <li><a href="http://dev.fckeditor.net/ticket/4075">#4075</a> : [IE6/7]Fixed apply custom inline style with "class" attribute failed.</li> <li><a href="http://dev.fckeditor.net/ticket/4087">#4087</a> : [Firefox]Fixed extra blocks created on create list when full document selected.</li> <li><a href="http://dev.fckeditor.net/ticket/4097">#4097</a> : No undo/redo support for fontColor and backgroundColor buttons.</li> <li><a href="http://dev.fckeditor.net/ticket/4111">#4111</a> : Fixed apply block style after inline style applied on full document error.</li> <li><a href="http://dev.fckeditor.net/ticket/3622">#3622</a> : Fixed shift enter with selection not deleting highlighted text.</li> <li><a href="http://dev.fckeditor.net/ticket/4092">#4092</a> : [IE6] Close button was missing for dialog without multiple tabs.</li> <li><a href="http://dev.fckeditor.net/ticket/4003">#4003</a> : Markup on the image dialog was disrupted when removing the border input.</li> <li><a href="http://dev.fckeditor.net/ticket/4096">#4096</a> : Editor content area was pushed down in IE RTL quirks.</li> <li><a href="http://dev.fckeditor.net/ticket/4112">#4112</a> : [FF] Paste dialog had scrollbars in quirks.</li> <li><a href="http://dev.fckeditor.net/ticket/4118">#4118</a> : Dialog dragging was occasionally behaving strangely .</li> <li><a href="http://dev.fckeditor.net/ticket/4077">#4077</a> : The toolbar combos were rendering incorrectly in some languages, like Chinese.</li> <li><a href="http://dev.fckeditor.net/ticket/3622">#3622</a> : The toolbar in the v2 skin was wrapping improperly in some languages.</li> <li><a href="http://dev.fckeditor.net/ticket/4119">#4119</a> : Unable to edit image link with image dialog.</li> <li><a href="http://dev.fckeditor.net/ticket/4117">#4117</a> : Fixed dialog error when transforming image into button.</li> <li><a href="http://dev.fckeditor.net/ticket/4058">#4058</a> : [FF] wysiwyg mode is sometimes not been activated.</li> <li><a href="http://dev.fckeditor.net/ticket/4114">#4114</a> : [IE] RTE + IE6/IE7 Quirks = dialog mispositoned.</li> <li><a href="http://dev.fckeditor.net/ticket/4123">#4123</a> : Some dialog buttons were broken in IE7 quirks.</li> <li><a href="http://dev.fckeditor.net/ticket/4122">#4122</a> : [IE] The image dialog was being rendered improperly when loading an image with long URL.</li> <li><a href="http://dev.fckeditor.net/ticket/4144">#4144</a> : Fixed the white-spaces at the end of &lt;pre&gt; is incorrectly removed.</li> <li><a href="http://dev.fckeditor.net/ticket/4143">#4143</a> : Fixed element id is lost when extracting contents from the range.</li> <li><a href="http://dev.fckeditor.net/ticket/4007">#4007</a> : [IE] Source area overflow from editor chrome.</li> <li><a href="http://dev.fckeditor.net/ticket/4145">#4145</a> : Fixed the on demand (&quot;basic&quot;) loading model of the editor.</li> <li><a href="http://dev.fckeditor.net/ticket/4139">#4139</a> : Fixed list plugin regression of [3903].</li> <li><a href="http://dev.fckeditor.net/ticket/4147">#4147</a> : Unify style text normalization logic when comparing styles.</li> <li><a href="http://dev.fckeditor.net/ticket/4150">#4150</a> : Fixed enlarge list result incorrect at the inner boundary of block.</li> <li><a href="http://dev.fckeditor.net/ticket/4164">#4164</a> : Now it is possible to paste text in Source mode even if forcePasteAsPlainText = true.</li> <li><a href="http://dev.fckeditor.net/ticket/4129">#4129</a> : [FF]Unable to remove list with Ctrl-A.</li> <li><a href="http://dev.fckeditor.net/ticket/4172">#4172</a> : [Safari] The trailing &lt;br&gt; was not been always added to blank lines ending with &amp;nbsp;.</li> <li><a href="http://dev.fckeditor.net/ticket/4178">#4178</a> : It&#39;s now possible to copy and paste Flash content among different editor instances.</li> <li><a href="http://dev.fckeditor.net/ticket/4193">#4193</a> : Automatic font color produced empty span on Firefox 3.5.</li> <li><a href="http://dev.fckeditor.net/ticket/4186">#4186</a> : [FF] Fixed First open float panel cause host page scrollbar blinking.</li> <li><a href="http://dev.fckeditor.net/ticket/4227">#4227</a> : Fixed destroy editor instance created on textarea which is not within form cause error.</li> <li><a href="http://dev.fckeditor.net/ticket/4240">#4240</a> : Fixed editor name containing hyphen break editor completely.</li> <li><a href="http://dev.fckeditor.net/ticket/3828">#3828</a> : Malformed nested list is now corrected by the parser.</li> </ul> <h3> CKEditor 3.0 RC</h3> <p> Changelog starts at this release.</p> <div id="footer"> <hr /> <p> CKEditor - The text editor for Internet - <a href="http://ckeditor.com/">http://ckeditor.com</a> </p> <p id="copy"> Copyright &copy; 2003-2010, <a href="http://cksource.com/">CKSource</a> - Frederico Knabben. All rights reserved. </p> </div> </body> </html>
100gd-compare
trunk/WebContent/components/ckeditor/CHANGES.html
HTML
epl
51,696
<?php /* * Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.html or http://ckeditor.com/license */ /** * \brief CKEditor class that can be used to create editor * instances in PHP pages on server side. * @see http://ckeditor.com * * Sample usage: * @code * $CKEditor = new CKEditor(); * $CKEditor->editor("editor1", "<p>Initial value.</p>"); * @endcode */ class CKEditor { /** * The version of %CKEditor. */ const version = '3.2'; /** * A constant string unique for each release of %CKEditor. */ const timestamp = 'A1QD'; /** * URL to the %CKEditor installation directory (absolute or relative to document root). * If not set, CKEditor will try to guess it's path. * * Example usage: * @code * $CKEditor->basePath = '/ckeditor/'; * @endcode */ public $basePath; /** * An array that holds the global %CKEditor configuration. * For the list of available options, see http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html * * Example usage: * @code * $CKEditor->config['height'] = 400; * // Use @@ at the beggining of a string to ouput it without surrounding quotes. * $CKEditor->config['width'] = '@@screen.width * 0.8'; * @endcode */ public $config = array(); /** * A boolean variable indicating whether CKEditor has been initialized. * Set it to true only if you have already included * &lt;script&gt; tag loading ckeditor.js in your website. */ public $initialized = false; /** * Boolean variable indicating whether created code should be printed out or returned by a function. * * Example 1: get the code creating %CKEditor instance and print it on a page with the "echo" function. * @code * $CKEditor = new CKEditor(); * $CKEditor->returnOutput = true; * $code = $CKEditor->editor("editor1", "<p>Initial value.</p>"); * echo "<p>Editor 1:</p>"; * echo $code; * @endcode */ public $returnOutput = false; /** * An array with textarea attributes. * * When %CKEditor is created with the editor() method, a HTML &lt;textarea&gt; element is created, * it will be displayed to anyone with JavaScript disabled or with incompatible browser. */ public $textareaAttributes = array( "rows" => 8, "cols" => 60 ); /** * A string indicating the creation date of %CKEditor. * Do not change it unless you want to force browsers to not use previously cached version of %CKEditor. */ public $timestamp = "A1QD"; /** * An array that holds event listeners. */ private $events = array(); /** * An array that holds global event listeners. */ private $globalEvents = array(); /** * Main Constructor. * * @param $basePath (string) URL to the %CKEditor installation directory (optional). */ function __construct($basePath = null) { if (!empty($basePath)) { $this->basePath = $basePath; } } /** * Creates a %CKEditor instance. * In incompatible browsers %CKEditor will downgrade to plain HTML &lt;textarea&gt; element. * * @param $name (string) Name of the %CKEditor instance (this will be also the "name" attribute of textarea element). * @param $value (string) Initial value (optional). * @param $config (array) The specific configurations to apply to this editor instance (optional). * @param $events (array) Event listeners for this editor instance (optional). * * Example usage: * @code * $CKEditor = new CKEditor(); * $CKEditor->editor("field1", "<p>Initial value.</p>"); * @endcode * * Advanced example: * @code * $CKEditor = new CKEditor(); * $config = array(); * $config['toolbar'] = array( * array( 'Source', '-', 'Bold', 'Italic', 'Underline', 'Strike' ), * array( 'Image', 'Link', 'Unlink', 'Anchor' ) * ); * $events['instanceReady'] = 'function (ev) { * alert("Loaded: " + ev.editor.name); * }'; * $CKEditor->editor("field1", "<p>Initial value.</p>", $config, $events); * @endcode */ public function editor($name, $value = "", $config = array(), $events = array()) { $attr = ""; foreach ($this->textareaAttributes as $key => $val) { $attr.= " " . $key . '="' . str_replace('"', '&quot;', $val) . '"'; } $out = "<textarea name=\"" . $name . "\"" . $attr . ">" . htmlspecialchars($value) . "</textarea>\n"; if (!$this->initialized) { $out .= $this->init(); } $_config = $this->configSettings($config, $events); $js = $this->returnGlobalEvents(); if (!empty($_config)) $js .= "CKEDITOR.replace('".$name."', ".$this->jsEncode($_config).");"; else $js .= "CKEDITOR.replace('".$name."');"; $out .= $this->script($js); if (!$this->returnOutput) { print $out; $out = ""; } return $out; } /** * Replaces a &lt;textarea&gt; with a %CKEditor instance. * * @param $id (string) The id or name of textarea element. * @param $config (array) The specific configurations to apply to this editor instance (optional). * @param $events (array) Event listeners for this editor instance (optional). * * Example 1: adding %CKEditor to &lt;textarea name="article"&gt;&lt;/textarea&gt; element: * @code * $CKEditor = new CKEditor(); * $CKEditor->replace("article"); * @endcode */ public function replace($id, $config = array(), $events = array()) { $out = ""; if (!$this->initialized) { $out .= $this->init(); } $_config = $this->configSettings($config, $events); $js = $this->returnGlobalEvents(); if (!empty($_config)) { $js .= "CKEDITOR.replace('".$id."', ".$this->jsEncode($_config).");"; } else { $js .= "CKEDITOR.replace('".$id."');"; } $out .= $this->script($js); if (!$this->returnOutput) { print $out; $out = ""; } return $out; } /** * Replace all &lt;textarea&gt; elements available in the document with editor instances. * * @param $className (string) If set, replace all textareas with class className in the page. * * Example 1: replace all &lt;textarea&gt; elements in the page. * @code * $CKEditor = new CKEditor(); * $CKEditor->replaceAll(); * @endcode * * Example 2: replace all &lt;textarea class="myClassName"&gt; elements in the page. * @code * $CKEditor = new CKEditor(); * $CKEditor->replaceAll( 'myClassName' ); * @endcode */ public function replaceAll($className = null) { $out = ""; if (!$this->initialized) { $out .= $this->init(); } $_config = $this->configSettings(); $js = $this->returnGlobalEvents(); if (empty($_config)) { if (empty($className)) { $js .= "CKEDITOR.replaceAll();"; } else { $js .= "CKEDITOR.replaceAll('".$className."');"; } } else { $classDetection = ""; $js .= "CKEDITOR.replaceAll( function(textarea, config) {\n"; if (!empty($className)) { $js .= " var classRegex = new RegExp('(?:^| )' + '". $className ."' + '(?:$| )');\n"; $js .= " if (!classRegex.test(textarea.className))\n"; $js .= " return false;\n"; } $js .= " CKEDITOR.tools.extend(config, ". $this->jsEncode($_config) .", true);"; $js .= "} );"; } $out .= $this->script($js); if (!$this->returnOutput) { print $out; $out = ""; } return $out; } /** * Adds event listener. * Events are fired by %CKEditor in various situations. * * @param $event (string) Event name. * @param $javascriptCode (string) Javascript anonymous function or function name. * * Example usage: * @code * $CKEditor->addEventHandler('instanceReady', 'function (ev) { * alert("Loaded: " + ev.editor.name); * }'); * @endcode */ public function addEventHandler($event, $javascriptCode) { if (!isset($this->events[$event])) { $this->events[$event] = array(); } // Avoid duplicates. if (!in_array($javascriptCode, $this->events[$event])) { $this->events[$event][] = $javascriptCode; } } /** * Clear registered event handlers. * Note: this function will have no effect on already created editor instances. * * @param $event (string) Event name, if not set all event handlers will be removed (optional). */ public function clearEventHandlers($event = null) { if (!empty($event)) { $this->events[$event] = array(); } else { $this->events = array(); } } /** * Adds global event listener. * * @param $event (string) Event name. * @param $javascriptCode (string) Javascript anonymous function or function name. * * Example usage: * @code * $CKEditor->addGlobalEventHandler('dialogDefinition', 'function (ev) { * alert("Loading dialog: " + ev.data.name); * }'); * @endcode */ public function addGlobalEventHandler($event, $javascriptCode) { if (!isset($this->globalEvents[$event])) { $this->globalEvents[$event] = array(); } // Avoid duplicates. if (!in_array($javascriptCode, $this->globalEvents[$event])) { $this->globalEvents[$event][] = $javascriptCode; } } /** * Clear registered global event handlers. * Note: this function will have no effect if the event handler has been already printed/returned. * * @param $event (string) Event name, if not set all event handlers will be removed (optional). */ public function clearGlobalEventHandlers($event = null) { if (!empty($event)) { $this->globalEvents[$event] = array(); } else { $this->globalEvents = array(); } } /** * Prints javascript code. * * @param string $js */ private function script($js) { $out = "<script type=\"text/javascript\">"; $out .= "//<![CDATA[\n"; $out .= $js; $out .= "\n//]]>"; $out .= "</script>\n"; return $out; } /** * Returns the configuration array (global and instance specific settings are merged into one array). * * @param $config (array) The specific configurations to apply to editor instance. * @param $events (array) Event listeners for editor instance. */ private function configSettings($config = array(), $events = array()) { $_config = $this->config; $_events = $this->events; if (is_array($config) && !empty($config)) { $_config = array_merge($_config, $config); } if (is_array($events) && !empty($events)) { foreach ($events as $eventName => $code) { if (!isset($_events[$eventName])) { $_events[$eventName] = array(); } if (!in_array($code, $_events[$eventName])) { $_events[$eventName][] = $code; } } } if (!empty($_events)) { foreach($_events as $eventName => $handlers) { if (empty($handlers)) { continue; } else if (count($handlers) == 1) { $_config['on'][$eventName] = '@@'.$handlers[0]; } else { $_config['on'][$eventName] = '@@function (ev){'; foreach ($handlers as $handler => $code) { $_config['on'][$eventName] .= '('.$code.')(ev);'; } $_config['on'][$eventName] .= '}'; } } } return $_config; } /** * Return global event handlers. */ private function returnGlobalEvents() { static $returnedEvents; $out = ""; if (!isset($returnedEvents)) { $returnedEvents = array(); } if (!empty($this->globalEvents)) { foreach ($this->globalEvents as $eventName => $handlers) { foreach ($handlers as $handler => $code) { if (!isset($returnedEvents[$eventName])) { $returnedEvents[$eventName] = array(); } // Return only new events if (!in_array($code, $returnedEvents[$eventName])) { $out .= ($code ? "\n" : "") . "CKEDITOR.on('". $eventName ."', $code);"; $returnedEvents[$eventName][] = $code; } } } } return $out; } /** * Initializes CKEditor (executed only once). */ private function init() { static $initComplete; $out = ""; if (!empty($initComplete)) { return ""; } if ($this->initialized) { $initComplete = true; return ""; } $args = ""; $ckeditorPath = $this->ckeditorPath(); if (!empty($this->timestamp) && $this->timestamp != "%"."TIMESTAMP%") { $args = '?t=' . $this->timestamp; } // Skip relative paths... if (strpos($ckeditorPath, '..') !== 0) { $out .= $this->script("window.CKEDITOR_BASEPATH='". $ckeditorPath ."';"); } $out .= "<script type=\"text/javascript\" src=\"" . $ckeditorPath . 'ckeditor.js' . $args . "\"></script>\n"; $extraCode = ""; if ($this->timestamp != self::timestamp) { $extraCode .= ($extraCode ? "\n" : "") . "CKEDITOR.timestamp = '". $this->timestamp ."';"; } if ($extraCode) { $out .= $this->script($extraCode); } $initComplete = $this->initialized = true; return $out; } /** * Return path to ckeditor.js. */ private function ckeditorPath() { if (!empty($this->basePath)) { return $this->basePath; } /** * The absolute pathname of the currently executing script. * Note: If a script is executed with the CLI, as a relative path, such as file.php or ../file.php, * $_SERVER['SCRIPT_FILENAME'] will contain the relative path specified by the user. */ if (isset($_SERVER['SCRIPT_FILENAME'])) { $realPath = dirname($_SERVER['SCRIPT_FILENAME']); } else { /** * realpath — Returns canonicalized absolute pathname */ $realPath = realpath( './' ) ; } /** * The filename of the currently executing script, relative to the document root. * For instance, $_SERVER['PHP_SELF'] in a script at the address http://example.com/test.php/foo.bar * would be /test.php/foo.bar. */ $selfPath = dirname($_SERVER['PHP_SELF']); $file = str_replace("\\", "/", __FILE__); if (!$selfPath || !$realPath || !$file) { return "/ckeditor/"; } $documentRoot = substr($realPath, 0, strlen($realPath) - strlen($selfPath)); $fileUrl = substr($file, strlen($documentRoot)); $ckeditorUrl = str_replace("ckeditor_php5.php", "", $fileUrl); return $ckeditorUrl; } /** * This little function provides a basic JSON support. * http://php.net/manual/en/function.json-encode.php * * @param mixed $val * @return string */ private function jsEncode($val) { if (is_null($val)) { return 'null'; } if ($val === false) { return 'false'; } if ($val === true) { return 'true'; } if (is_scalar($val)) { if (is_float($val)) { // Always use "." for floats. $val = str_replace(",", ".", strval($val)); } // Use @@ to not use quotes when outputting string value if (strpos($val, '@@') === 0) { return substr($val, 2); } else { // All scalars are converted to strings to avoid indeterminism. // PHP's "1" and 1 are equal for all PHP operators, but // JS's "1" and 1 are not. So if we pass "1" or 1 from the PHP backend, // we should get the same result in the JS frontend (string). // Character replacements for JSON. static $jsonReplaces = array(array("\\", "/", "\n", "\t", "\r", "\b", "\f", '"'), array('\\\\', '\\/', '\\n', '\\t', '\\r', '\\b', '\\f', '\"')); $val = str_replace($jsonReplaces[0], $jsonReplaces[1], $val); return '"' . $val . '"'; } } $isList = true; for ($i = 0, reset($val); $i < count($val); $i++, next($val)) { if (key($val) !== $i) { $isList = false; break; } } $result = array(); if ($isList) { foreach ($val as $v) $result[] = $this->jsEncode($v); return '[ ' . join(', ', $result) . ' ]'; } else { foreach ($val as $k => $v) $result[] = $this->jsEncode($k).': '.$this->jsEncode($v); return '{ ' . join(', ', $result) . ' }'; } } }
100gd-compare
trunk/WebContent/components/ckeditor/ckeditor_php5.php
PHP
epl
15,948
<?php /* * Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.html or http://ckeditor.com/license */ /*! \mainpage CKEditor - PHP server side intergation * \section intro_sec CKEditor * Visit <a href="http://ckeditor.com">CKEditor web site</a> to find more information about the editor. * \section install_sec Installation * \subsection step1 Include ckeditor.php in your PHP web site. * @code * <?php * include("ckeditor/ckeditor.php"); * ?> * @endcode * \subsection step2 Create CKEditor class instance and use one of available methods to insert CKEditor. * @code * <?php * $CKEditor = new CKEditor(); * echo $CKEditor->textarea("field1", "<p>Initial value.</p>"); * ?> * @endcode */ if ( !function_exists('version_compare') || version_compare( phpversion(), '5', '<' ) ) include_once( 'ckeditor_php4.php' ) ; else include_once( 'ckeditor_php5.php' ) ;
100gd-compare
trunk/WebContent/components/ckeditor/ckeditor.php
PHP
epl
962
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- == BEGIN TEXT ONLY VERSION == Software License Agreement ========================== CKEditor - The text editor for Internet - http://ckeditor.com Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. Licensed under the terms of any of the following licenses at your choice: - GNU General Public License Version 2 or later (the "GPL") http://www.gnu.org/licenses/gpl.html (See Appendix A) - GNU Lesser General Public License Version 2.1 or later (the "LGPL") http://www.gnu.org/licenses/lgpl.html (See Appendix B) - Mozilla Public License Version 1.1 or later (the "MPL") http://www.mozilla.org/MPL/MPL-1.1.html (See Appendix C) You are not required to, but if you want to explicitly declare the license you have chosen to be bound to when using, reproducing, modifying and distributing this software, just include a text file titled "legal.txt" in your version of this software, indicating your license choice. In any case, your choice will not restrict any recipient of your version of this software to use, reproduce, modify and distribute this software under any of the above licenses. Sources of Intellectual Property Included in CKEditor ===================================================== Where not otherwise indicated, all CKEditor content is authored by CKSource engineers and consists of CKSource-owned intellectual property. In some specific instances, CKEditor will incorporate work done by developers outside of CKSource with their express permission. YUI Test: At _source/tests/yuitest.js can be found part of the source code of YUI, which is licensed under the terms of the BSD License (http://developer.yahoo.com/yui/license.txt). YUI is Copyright (C) 2008, Yahoo! Inc. Trademarks ========== CKEditor is a trademark of CKSource - Frederico Knabben. All other brand and product names are trademarks, registered trademarks or service marks of their respective holders. Appendix A: The GPL License =========================== GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software-to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix B: The LGPL License ============================ GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software-to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages-typically libraries-of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix C: The MPL License =========================== MOZILLA PUBLIC LICENSE Version 1.1 =============== 1. Definitions. 1.0.1. "Commercial Use" means distribution or otherwise making the Covered Code available to a third party. 1.1. "Contributor" means each entity that creates or contributes to the creation of Modifications. 1.2. "Contributor Version" means the combination of the Original Code, prior Modifications used by a Contributor, and the Modifications made by that particular Contributor. 1.3. "Covered Code" means the Original Code or Modifications or the combination of the Original Code and Modifications, in each case including portions thereof. 1.4. "Electronic Distribution Mechanism" means a mechanism generally accepted in the software development community for the electronic transfer of data. 1.5. "Executable" means Covered Code in any form other than Source Code. 1.6. "Initial Developer" means the individual or entity identified as the Initial Developer in the Source Code notice required by Exhibit A. 1.7. "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License. 1.8. "License" means this document. 1.8.1. "Licensable" means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein. 1.9. "Modifications" means any addition to or deletion from the substance or structure of either the Original Code or any previous Modifications. When Covered Code is released as a series of files, a Modification is: A. Any addition to or deletion from the contents of a file containing Original Code or previous Modifications. B. Any new file that contains any part of the Original Code or previous Modifications. 1.10. "Original Code" means Source Code of computer software code which is described in the Source Code notice required by Exhibit A as Original Code, and which, at the time of its release under this License is not already Covered Code governed by this License. 1.10.1. "Patent Claims" means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent Licensable by grantor. 1.11. "Source Code" means the preferred form of the Covered Code for making modifications to it, including all modules it contains, plus any associated interface definition files, scripts used to control compilation and installation of an Executable, or source code differential comparisons against either the Original Code or another well known, available Covered Code of the Contributor's choice. The Source Code can be in a compressed or archival form, provided the appropriate decompression or de-archiving software is widely available for no charge. 1.12. "You" (or "Your") means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License or a future version of this License issued under Section 6.1. For legal entities, "You" includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. 2. Source Code License. 2.1. The Initial Developer Grant. The Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license, subject to third party intellectual property claims: (a) under intellectual property rights (other than patent or trademark) Licensable by Initial Developer to use, reproduce, modify, display, perform, sublicense and distribute the Original Code (or portions thereof) with or without Modifications, and/or as part of a Larger Work; and (b) under Patents Claims infringed by the making, using or selling of Original Code, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Code (or portions thereof). (c) the licenses granted in this Section 2.1(a) and (b) are effective on the date Initial Developer first distributes Original Code under the terms of this License. (d) Notwithstanding Section 2.1(b) above, no patent license is granted: 1) for code that You delete from the Original Code; 2) separate from the Original Code; or 3) for infringements caused by: i) the modification of the Original Code or ii) the combination of the Original Code with other software or devices. 2.2. Contributor Grant. Subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license (a) under intellectual property rights (other than patent or trademark) Licensable by Contributor, to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof) either on an unmodified basis, with other Modifications, as Covered Code and/or as part of a Larger Work; and (b) under Patent Claims infringed by the making, using, or selling of Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: 1) Modifications made by that Contributor (or portions thereof); and 2) the combination of Modifications made by that Contributor with its Contributor Version (or portions of such combination). (c) the licenses granted in Sections 2.2(a) and 2.2(b) are effective on the date Contributor first makes Commercial Use of the Covered Code. (d) Notwithstanding Section 2.2(b) above, no patent license is granted: 1) for any code that Contributor has deleted from the Contributor Version; 2) separate from the Contributor Version; 3) for infringements caused by: i) third party modifications of Contributor Version or ii) the combination of Modifications made by that Contributor with other software (except as part of the Contributor Version) or other devices; or 4) under Patent Claims infringed by Covered Code in the absence of Modifications made by that Contributor. 3. Distribution Obligations. 3.1. Application of License. The Modifications which You create or to which You contribute are governed by the terms of this License, including without limitation Section 2.2. The Source Code version of Covered Code may be distributed only under the terms of this License or a future version of this License released under Section 6.1, and You must include a copy of this License with every copy of the Source Code You distribute. You may not offer or impose any terms on any Source Code version that alters or restricts the applicable version of this License or the recipients' rights hereunder. However, You may include an additional document offering the additional rights described in Section 3.5. 3.2. Availability of Source Code. Any Modification which You create or to which You contribute must be made available in Source Code form under the terms of this License either on the same media as an Executable version or via an accepted Electronic Distribution Mechanism to anyone to whom you made an Executable version available; and if made available via Electronic Distribution Mechanism, must remain available for at least twelve (12) months after the date it initially became available, or at least six (6) months after a subsequent version of that particular Modification has been made available to such recipients. You are responsible for ensuring that the Source Code version remains available even if the Electronic Distribution Mechanism is maintained by a third party. 3.3. Description of Modifications. You must cause all Covered Code to which You contribute to contain a file documenting the changes You made to create that Covered Code and the date of any change. You must include a prominent statement that the Modification is derived, directly or indirectly, from Original Code provided by the Initial Developer and including the name of the Initial Developer in (a) the Source Code, and (b) in any notice in an Executable version or related documentation in which You describe the origin or ownership of the Covered Code. 3.4. Intellectual Property Matters (a) Third Party Claims. If Contributor has knowledge that a license under a third party's intellectual property rights is required to exercise the rights granted by such Contributor under Sections 2.1 or 2.2, Contributor must include a text file with the Source Code distribution titled "LEGAL" which describes the claim and the party making the claim in sufficient detail that a recipient will know whom to contact. If Contributor obtains such knowledge after the Modification is made available as described in Section 3.2, Contributor shall promptly modify the LEGAL file in all copies Contributor makes available thereafter and shall take other steps (such as notifying appropriate mailing lists or newsgroups) reasonably calculated to inform those who received the Covered Code that new knowledge has been obtained. (b) Contributor APIs. If Contributor's Modifications include an application programming interface and Contributor has knowledge of patent licenses which are reasonably necessary to implement that API, Contributor must also include this information in the LEGAL file. (c) Representations. Contributor represents that, except as disclosed pursuant to Section 3.4(a) above, Contributor believes that Contributor's Modifications are Contributor's original creation(s) and/or Contributor has sufficient rights to grant the rights conveyed by this License. 3.5. Required Notices. You must duplicate the notice in Exhibit A in each file of the Source Code. If it is not possible to put such notice in a particular Source Code file due to its structure, then You must include such notice in a location (such as a relevant directory) where a user would be likely to look for such a notice. If You created one or more Modification(s) You may add your name as a Contributor to the notice described in Exhibit A. You must also duplicate this License in any documentation for the Source Code where You describe recipients' rights or ownership rights relating to Covered Code. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Code. However, You may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear than any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer. 3.6. Distribution of Executable Versions. You may distribute Covered Code in Executable form only if the requirements of Section 3.1-3.5 have been met for that Covered Code, and if You include a notice stating that the Source Code version of the Covered Code is available under the terms of this License, including a description of how and where You have fulfilled the obligations of Section 3.2. The notice must be conspicuously included in any notice in an Executable version, related documentation or collateral in which You describe recipients' rights relating to the Covered Code. You may distribute the Executable version of Covered Code or ownership rights under a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable version does not attempt to limit or alter the recipient's rights in the Source Code version from the rights set forth in this License. If You distribute the Executable version under a different license You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or any Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of any such terms You offer. 3.7. Larger Works. You may create a Larger Work by combining Covered Code with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Code. 4. Inability to Comply Due to Statute or Regulation. If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Code due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be included in the LEGAL file described in Section 3.4 and must be included with all distributions of the Source Code. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it. 5. Application of this License. This License applies to code to which the Initial Developer has attached the notice in Exhibit A and to related Covered Code. 6. Versions of the License. 6.1. New Versions. Netscape Communications Corporation ("Netscape") may publish revised and/or new versions of the License from time to time. Each version will be given a distinguishing version number. 6.2. Effect of New Versions. Once Covered Code has been published under a particular version of the License, You may always continue to use it under the terms of that version. You may also choose to use such Covered Code under the terms of any subsequent version of the License published by Netscape. No one other than Netscape has the right to modify the terms applicable to Covered Code created under this License. 6.3. Derivative Works. If You create or use a modified version of this License (which you may only do in order to apply it to code which is not already Covered Code governed by this License), You must (a) rename Your license so that the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape", "MPL", "NPL" or any confusingly similar phrase do not appear in your license (except to note that your license differs from this License) and (b) otherwise make it clear that Your version of the license contains terms which differ from the Mozilla Public License and Netscape Public License. (Filling in the name of the Initial Developer, Original Code or Contributor in the notice described in Exhibit A shall not of themselves be deemed to be modifications of this License.) 7. DISCLAIMER OF WARRANTY. COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. 8. TERMINATION. 8.1. This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. All sublicenses to the Covered Code which are properly granted shall survive any termination of this License. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive. 8.2. If You initiate litigation by asserting a patent infringement claim (excluding declatory judgment actions) against Initial Developer or a Contributor (the Initial Developer or Contributor against whom You file such action is referred to as "Participant") alleging that: (a) such Participant's Contributor Version directly or indirectly infringes any patent, then any and all rights granted by such Participant to You under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively, unless if within 60 days after receipt of notice You either: (i) agree in writing to pay Participant a mutually agreeable reasonable royalty for Your past and future use of Modifications made by such Participant, or (ii) withdraw Your litigation claim with respect to the Contributor Version against such Participant. If within 60 days of notice, a reasonable royalty and payment arrangement are not mutually agreed upon in writing by the parties or the litigation claim is not withdrawn, the rights granted by Participant to You under Sections 2.1 and/or 2.2 automatically terminate at the expiration of the 60 day notice period specified above. (b) any software, hardware, or device, other than such Participant's Contributor Version, directly or indirectly infringes any patent, then any rights granted to You by such Participant under Sections 2.1(b) and 2.2(b) are revoked effective as of the date You first made, used, sold, distributed, or had made, Modifications made by that Participant. 8.3. If You assert a patent infringement claim against Participant alleging that such Participant's Contributor Version directly or indirectly infringes any patent where such claim is resolved (such as by license or settlement) prior to the initiation of patent infringement litigation, then the reasonable value of the licenses granted by such Participant under Sections 2.1 or 2.2 shall be taken into account in determining the amount or value of any payment or license. 8.4. In the event of termination under Sections 8.1 or 8.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or any distributor hereunder prior to termination shall survive termination. 9. LIMITATION OF LIABILITY. UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. 10. U.S. GOVERNMENT END USERS. The Covered Code is a "commercial item," as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer software" and "commercial computer software documentation," as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Code with only those rights set forth herein. 11. MISCELLANEOUS. This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by California law provisions (except to the extent applicable law, if any, provides otherwise), excluding its conflict-of-law provisions. With respect to disputes in which at least one party is a citizen of, or an entity chartered or registered to do business in the United States of America, any litigation relating to this License shall be subject to the jurisdiction of the Federal Courts of the Northern District of California, with venue lying in Santa Clara County, California, with the losing party responsible for costs, including without limitation, court costs and reasonable attorneys' fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License. 12. RESPONSIBILITY FOR CLAIMS. As between Initial Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability. 13. MULTIPLE-LICENSED CODE. Initial Developer may designate portions of the Covered Code as "Multiple-Licensed". "Multiple-Licensed" means that the Initial Developer permits you to utilize portions of the Covered Code under Your choice of the NPL or the alternative licenses, if any, specified by the Initial Developer in the file described in Exhibit A. EXHIBIT A -Mozilla Public License. ``The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/ Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. The Original Code is ______________________________________. The Initial Developer of the Original Code is ________________________. Portions created by ______________________ are Copyright (C) ______ _______________________. All Rights Reserved. Contributor(s): ______________________________________. Alternatively, the contents of this file may be used under the terms of the _____ license (the "[___] License"), in which case the provisions of [______] License are applicable instead of those above. If you wish to allow use of your version of this file only under the terms of the [____] License and not to allow others to use your version of this file under the MPL, indicate your decision by deleting the provisions above and replace them with the notice and other provisions required by the [___] License. If you do not delete the provisions above, a recipient may use your version of this file under either the MPL or the [___] License." [NOTE: The text of this Exhibit A may differ slightly from the text of the notices in the Source Code files of the Original Code. You should use the text of this Exhibit A rather than the text found in the Original Code Source Code for Your Modifications.] == END TEXT ONLY VERSION == --> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>License - CKEditor</title> </head> <body> <h1> Software License Agreement </h1> <p> <strong>CKEditor&trade;</strong> - The text editor for Internet&trade; - <a href="http://ckeditor.com"> http://ckeditor.com</a><br /> Copyright &copy; 2003-2010, <a href="http://cksource.com/">CKSource</a> - Frederico Knabben. All rights reserved. </p> <p> Licensed under the terms of any of the following licenses at your choice: </p> <ul> <li><a href="http://www.gnu.org/licenses/gpl.html">GNU General Public License</a> Version 2 or later (the "GPL");</li> <li><a href="http://www.gnu.org/licenses/lgpl.html">GNU Lesser General Public License</a> Version 2.1 or later (the "LGPL");</li> <li><a href="http://www.mozilla.org/MPL/MPL-1.1.html">Mozilla Public License</a> Version 1.1 or later (the "MPL").</li> </ul> <p> You are not required to, but if you want to explicitly declare the license you have chosen to be bound to when using, reproducing, modifying and distributing this software, just include a text file titled "LEGAL" in your version of this software, indicating your license choice. In any case, your choice will not restrict any recipient of your version of this software to use, reproduce, modify and distribute this software under any of the above licenses. </p> <h2> Sources of Intellectual Property Included in CKEditor </h2> <p> Where not otherwise indicated, all CKEditor content is authored by CKSource engineers and consists of CKSource-owned intellectual property. In some specific instances, CKEditor will incorporate work done by developers outside of CKSource with their express permission. </p> <p> <a href="http://developer.yahoo.com/yui/yuitest/">YUI Test</a>: At _source/tests/yuitest.js can be found part of the source code of YUI, which is licensed under the terms of the <a href="http://developer.yahoo.com/yui/license.txt">BSD License</a>. YUI is Copyright &copy; 2008, Yahoo! Inc. </p> <h2> Trademarks </h2> <p> CKEditor is a trademark of CKSource - Frederico Knabben. All other brand and product names are trademarks, registered trademarks or service marks of their respective holders. </p> </body> </html>
100gd-compare
trunk/WebContent/components/ckeditor/LICENSE.html
HTML
epl
71,136
<%@ page contentType="text/html;charset=GBK"%> <SCRIPT LANGUAGE="JavaScript"> <!-- var contextPath = "${ctx}"; //--> </SCRIPT> <link type="text/css" rel="stylesheet" href="${ctx}/components/xtree/css/xtree2.css"> <script type="text/javascript" src="${ctx}/components/xtree/js/xtree2.js"></script> <script type="text/javascript" src="${ctx}/components/xtree/js/xloadtree2.js"></script>
100gd-compare
trunk/WebContent/components/xtree/index.jsp
Java Server Pages
epl
397
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>xTree API 2 (WebFX)</title> <!-- WebFX Layout Include --> <script type="text/javascript" src="../../webfxlayout.js"></script> <script type="text/javascript" src="../../webfxapi.js"></script> <!-- end WebFX Layout Includes --> <style type="text/css"> table { width: 500px; } td { vertical-align: top; } </style> </head> <body> <!-- WebFX Layout Include --> <script type="text/javascript"> /* var articleMenu= new WebFXMenu; articleMenu.left = 384; articleMenu.top = 86; articleMenu.width = 140; articleMenu.add(new WebFXMenuItem("History & Introduction", "index.html")); articleMenu.add(new WebFXMenuItem("Usage", "usage.html")); articleMenu.add(new WebFXMenuItem("API", "api.html")); articleMenu.add(new WebFXMenuItem("Implementation", "implementation.html")); articleMenu.add(new WebFXMenuItem("Demo", "javascript:window.open('demo.html','demo','scrollbars=yes,status=no,width=500,height=400,resizable=yes'); void(0);")); articleMenu.add(new WebFXMenuSeparator); articleMenu.add(new WebFXMenuItem("Download", "http://webfx.eae.net/download/xtree117.zip")); webfxMenuBar.add(new WebFXMenuButton("Article Menu", null, null, articleMenu)); */ webfxLayout.writeTitle("xTree2 API"); webfxLayout.writeMenu(); webfxLayout.writeDesignedByEdger(); </script> <div class="webfx-main-body"> <!-- end WebFX Layout Includes --> <h2 id="arrayHelper">arrayHelper</h2><p> This object provides some useful methods for working with arrays. </p><h3>Syntax</h3><pre>arrayHelper</pre><h3>Parameters</h3><h3>Static Methods</h3><table><thead><tr><td>Name</td><td>Description</td></tr></thead><tbody><tr><td colspan="2">None.</td></tr></tbody></table><h3>Static Fields</h3><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td colspan="3">None.</td></tr></tbody></table><h3>Methods</h3><table><thead><tr><td>Name</td><td>Description</td></tr></thead><tbody><tr><td><a name="indexOf"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">indexOf</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.indexOf(<span class="methodArgument">a</span>, <span class="methodArgument">o</span>)</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td><code>a</code></td><td><code></code></td><td>The array where the object is a member of</td></tr><tr><td><code>o</code></td><td><code></code></td><td>The object to get the index for</td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> Returns the index of an object in an array. If the object is not present in the array this returns <code>-1</code> </td></tr><tr><td><a name="insertBefore"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">insertBefore</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.insertBefore(<span class="methodArgument">a</span>, <span class="methodArgument">o</span>, <span class="methodArgument">o2</span>)</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td><code>a</code></td><td><code></code></td><td>The array to modify.</td></tr><tr><td><code>o</code></td><td><code></code></td><td>The object to insert</td></tr><tr><td><code>o2</code></td><td><code></code></td><td>The object to insert before</td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> Inserts an object before another object in an array. (The length increases by 1). </td></tr><tr><td><a name="remove"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">remove</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.remove(<span class="methodArgument">a</span>, <span class="methodArgument">o</span>)</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td><code>a</code></td><td><code></code></td><td>The array to remove the object from</td></tr><tr><td><code>o</code></td><td><code></code></td><td>The object to remove</td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> This removes the first instance of an object from an array (the length decreases with 1). </td></tr></tbody></table><h3>Fields</h3><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td colspan="3">None.</td></tr></tbody></table><h3>Events</h3><table><thead><tr><td>Name</td><td>Descripton</td></tr></thead><tbody><tr><td colspan="2">None.</td></tr></tbody></table><h3>Remarks</h3><p> None. </p><h2 id="WebFXTree">WebFXTree</h2><p>This class extends <code><a href="#WebFXTreeAbstractNode">WebFXTreeAbstractNode</a></code> and therefore all methods and field available for <code><a href="#WebFXTreeAbstractNode">WebFXTreeAbstractNode</a></code> are also available for <code>WebFXTree</code>.</p><p> This is the root object of xTree and it is where everything begins. Create a <code><a href="#WebFXTree">WebFXTree</a></code> object and then use <code><a href="#add">add</a></code> to add <code><a href="#WebFXTreeItem">WebFXTreeItem</a></code> objects to it. </p><h3>Syntax</h3><p><code> new WebFXTree(<span class="methodArgument">sText</span>, <span class="methodArgument">oAction</span>, <span class="methodArgument">sBehavior</span>, <span class="methodArgument">sIcon</span>, <span class="methodArgument">sOpenIcon</span>)</code></p><h3>Parameters</h3><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td><code>sText</code></td><td><code></code></td><td> The text (HTML) to show as a label for the tree item </td></tr><tr><td><code>oAction</code></td><td><code></code></td><td> The action to do when the node is activated. If this is String then it is treated as an URL but you can also pass a Function object which will be called when activated. </td></tr><tr><td><code>sBehavior</code></td><td><code></code></td><td> This is used to decide when to show the open icon for folders. Supported values are "classic" and "explorer". When this is "explorer" selected folders show the open icon. For "classic" the open icon is shown for expanded folders. </td></tr><tr><td><code>sIcon</code></td><td><code></code></td><td>The image to use as icon</td></tr><tr><td><code>sOpenIcon</code></td><td><code></code></td><td>The image to use as open icon</td></tr></tbody></table><h3>Static Methods</h3><table><thead><tr><td>Name</td><td>Description</td></tr></thead><tbody><tr><td colspan="2">None.</td></tr></tbody></table><h3>Static Fields</h3><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td colspan="3">None.</td></tr></tbody></table><h3>Methods</h3><table><thead><tr><td>Name</td><td>Description</td></tr></thead><tbody><tr><td><a name="getBehavior"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">getBehavior</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.getBehavior()</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td></td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> Returns the behavtion (classic or explorer) that is currently describing the open folder strategy. </td></tr><tr><td><a name="getSelected"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">getSelected</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.getSelected()</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td></td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td>The currently selected tree node in the tree.</td></tr><tr><td><a name="getShowExpandIcons"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">getShowExpandIcons</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.getShowExpandIcons()</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td></td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> Whether to show the expand (plus/minus) icons </td></tr><tr><td><a name="getShowLines"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">getShowLines</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.getShowLines()</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td></td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td>Whether to show the lines in the tree</td></tr><tr><td><a name="getShowRootLines"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">getShowRootLines</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.getShowRootLines()</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td></td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> Whether to show the lines for the tree on the root level </td></tr><tr><td><a name="getShowRootNode"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">getShowRootNode</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.getShowRootNode()</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td></td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> Whether to show the root node or not. Hiding the root node allows you to create a tree that looks like it has multiple roots. </td></tr><tr><td><a name="getSuspendRedraw"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">getSuspendRedraw</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.getSuspendRedraw()</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td></td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> Whether redraws of the tree is suspended. Suspending redraws can be useful if a lot of changes are done to it which would each require a redraw. </td></tr><tr><td><a name="onchange"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">onchange</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.onchange()</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td></td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> This method is called when the selected item is changed. Override this to provide custom handling for onchange. </td></tr><tr><td><a name="setBehavior"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">setBehavior</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.setBehavior(<span class="methodArgument"></span>)</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td><code></code></td><td><code></code></td><td>The desired icon behavior</td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> Sets the behavior for the tree. The behavior describes when to use the open icon for tree items. </td></tr><tr><td><a name="setSelected"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">setSelected</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.setSelected(<span class="methodArgument">o</span>)</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td><code>o</code></td><td><code></code></td><td>The tree node to select</td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td>Sets the selected node in the tree</td></tr><tr><td><a name="setShowExpandIcons"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">setShowExpandIcons</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.setShowExpandIcons(<span class="methodArgument">b</span>)</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td><code>b</code></td><td><code></code></td><td>Whether to show or hide the expand icons</td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> Sets whether to show the expand (plus/minus) icons </td></tr><tr><td><a name="setShowLines"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">setShowLines</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.setShowLines(<span class="methodArgument"></span>)</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td><code></code></td><td><code></code></td><td>Whether to show or hide</td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> Sets whether to show or hide the lines in the tree </td></tr><tr><td><a name="setShowRoootNode"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">setShowRoootNode</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.setShowRoootNode(<span class="methodArgument">b</span>)</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td><code>b</code></td><td><code></code></td><td> Whether to show or hide the root node. </td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> Sets whether to show or hide the root node. </td></tr><tr><td><a name="setShowRootLines"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">setShowRootLines</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.setShowRootLines(<span class="methodArgument">b</span>)</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td><code>b</code></td><td><code></code></td><td>Whether to show or hide the lines</td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> Sets whether the root level lines should be drawn for the tree. </td></tr><tr><td><a name="setSuspendRedraw"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">setSuspendRedraw</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.setSuspendRedraw(<span class="methodArgument">b</span>)</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td><code>b</code></td><td><code></code></td><td> Whether to suspend redraws of the tree. </td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> Whether to suspend redraws of the tree. </td></tr><tr><td><a name="write"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">write</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.write()</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td></td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> Does a <code>document.write()</code> of the HTML needed to draw the tree. </td></tr></tbody></table><h3>Fields</h3><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td colspan="3">None.</td></tr></tbody></table><h3>Events</h3><table><thead><tr><td>Name</td><td>Descripton</td></tr></thead><tbody><tr><td colspan="2">None.</td></tr></tbody></table><h3>Remarks</h3><p> </p> <h2 id="WebFXTreeAbstractNode">WebFXTreeAbstractNode</h2><p> This is the abstract base class for the nodes building up the tree. </p><h3>Syntax</h3><p><code> new WebFXTreeAbstractNode(<span class="methodArgument">sText</span>, <span class="methodArgument">oAction</span>)</code></p><h3>Parameters</h3><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td><code>sText</code></td><td><code></code></td><td> The HTML text to show as the label of the node </td></tr><tr><td><code>oAction</code></td><td><code></code></td><td> The action to do when the node is activated. If this is String then it is treated as an URL but you can also pass a Function object which will be called when activated. </td></tr></tbody></table><h3>Static Methods</h3><table><thead><tr><td>Name</td><td>Description</td></tr></thead><tbody> </tbody></table><h3>Static Fields</h3><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td colspan="3">None.</td></tr></tbody></table><h3>Methods</h3><table><thead><tr><td>Name</td><td>Description</td></tr></thead><tbody><tr><td><a name="add"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">add</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.add(<span class="methodArgument">oChild</span>&nbsp;[, <span class="methodArgument">oBefore</span>])</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td><code>oChild</code></td><td><code></code></td><td>The child to add</td></tr><tr><td><code>oBefore</code></td><td><code></code></td><td><span class="optional">Optional.</span> If provided then the new node is added before this one.</td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> Adds a node as a child to the current node. </td></tr><tr><td><a name="collapse"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">collapse</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.collapse()</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td></td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td>Collapses the node</td></tr><tr><td><a name="collapseAll"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">collapseAll</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.collapseAll()</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td></td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td>Collapses the node and all its descendants</td></tr><tr><td><a name="collapseChildren"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">collapseChildren</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.collapseChildren()</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td></td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td>Collapse all the descendants of the node</td></tr><tr><td><a name="contains"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">contains</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.contains(<span class="methodArgument">oDescendant</span>)</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td><code>oDescendant</code></td><td><code></code></td><td>The node to check if it is contained</td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> Whether this node contains another node. A node contains itself so if the argument is the same node this will return true. </td></tr><tr><td><a name="create"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">create</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.create()</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td></td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> Creates the DOM element representing the node. This element can then be inserted into the document. </td></tr><tr><td><a name="deselect"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">deselect</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.deselect()</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td></td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td>Deselect the node</td></tr><tr><td><a name="dispose"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">dispose</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.dispose()</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td></td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> This cleans up the objects. After the node has been disposed it cannot be used any more. </td></tr><tr><td><a name="expand"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">expand</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.expand()</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td></td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td>Expands the node</td></tr><tr><td><a name="expandAll"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">expandAll</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.expandAll()</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td></td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td>Expands the node and all its descendants</td></tr><tr><td><a name="expandChildren"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">expandChildren</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.expandChildren()</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td></td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td>Expands all the descendants of the node</td></tr><tr><td><a name="findChildByText"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">findChildByText</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.findChildByText(<span class="methodArgument">s</span>&nbsp;[, <span class="methodArgument">n</span>])</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td><code>s</code></td><td><code></code></td><td> The text to look for. This can be either a string or a regular expression object. </td></tr><tr><td><code>n</code></td><td><code></code></td><td><span class="optional">Optional.</span> The nth matching child to return. This is zero base so using 0 will return the first matching child. If this argument is not included the first matching child is returned. </td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> Returns the child with the given text. The second argument, which is optional tells which match to return. This allows you to return the second item that matches the text. You can also pass a regular expression as the first argument. If no child with a text matches then null is returned. </td></tr><tr><td><a name="findNodeByText"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">findNodeByText</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.findNodeByText(<span class="methodArgument">s</span>&nbsp;[, <span class="methodArgument">n</span>])</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td><code>s</code></td><td><code></code></td><td> The text to look for. This can be either a string or a regular expression object. </td></tr><tr><td><code>n</code></td><td><code></code></td><td><span class="optional">Optional.</span> The nth matching node to return. This is zero base so using 0 will return the first matching node. If this argument is not included the first matching node is returned. </td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> Returns the node with the given text. The second argument, which is optional tells which match to return. This allows you to return the second item that matches the text. You can also pass a regular expression as the first argument. If no node with a text matches then null is returned. This searches the current node and all its descendants using inorder traversal. </td></tr><tr><td><a name="focus"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">focus</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.focus()</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td></td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td>Focus the ndoe</td></tr><tr><td><a name="getAction"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">getAction</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.getAction()</code></p><h4>Arguments</h4><p>No Arguments.</p><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> The action that should be invoked when clicking the item. This can be either a string or a function and if a string the browser will navigate to this page. </td></tr><tr><td><a name="getChildrenElement"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">getChildrenElement</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.getChildrenElement()</code></p><h4>Arguments</h4><p>No Arguments.</p><h4>Return Type</h4><p><code>void</code></p></div></div></td><td>Returns the element which contains all the children</td></tr><tr><td><a name="getCreated"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">getCreated</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.getCreated()</code></p><h4>Arguments</h4><p>No Arguments.</p><h4>Return Type</h4><p><code>void</code></p></div></div></td><td>Whether the node has been rendered in the document</td></tr><tr><td><a name="getDepth"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">getDepth</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.getDepth()</code></p><h4>Arguments</h4><p>No Arguments.</p><h4>Return Type</h4><p><code>void</code></p></div></div></td><td>The depth of the tree node</td></tr><tr><td><a name="getElement"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">getElement</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.getElement()</code></p><h4>Arguments</h4><p>No Arguments.</p><h4>Return Type</h4><p><code>void</code></p></div></div></td><td>Returns the element for the node.</td></tr><tr><td><a name="getEventHandlersHtml"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">getEventHandlersHtml</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.getEventHandlersHtml()</code></p><h4>Arguments</h4><p>No Arguments.</p><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> Returns the HTML needed to write the inline attribute event handlers. For example " onclick=\"something()\"" </td></tr><tr><td><a name="getExpanded"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">getExpanded</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.getExpanded()</code></p><h4>Arguments</h4><p>No Arguments.</p><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> Returns whether the node is expanded or not </td></tr><tr><td><a name="getExpandIconElement"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">getExpandIconElement</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.getExpandIconElement()</code></p><h4>Arguments</h4><p>No Arguments.</p><h4>Return Type</h4><p><code>void</code></p></div></div></td><td>Returns the element used for the expand icon of the node</td></tr><tr><td><a name="getExpandIconHtml"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">getExpandIconHtml</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.getExpandIconHtml()</code></p><h4>Arguments</h4><p>No Arguments.</p><h4>Return Type</h4><p><code>void</code></p></div></div></td><td>The HTML code used to draw the expand (plus/minus) icon</td></tr><tr><td><a name="getExpandIconSrc"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">getExpandIconSrc</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.getExpandIconSrc()</code></p><h4>Arguments</h4><p>No Arguments.</p><h4>Return Type</h4><p><code>void</code></p></div></div></td><td>Returns the src for the image used as the expand icon.</td></tr><tr><td><a name="getFirstChild"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">getFirstChild</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.getFirstChild()</code></p><h4>Arguments</h4><p>No Arguments.</p><h4>Return Type</h4><p><code>void</code></p></div></div></td><td>Returns the first child node</td></tr><tr><td><a name="getFocused"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">getFocused</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.getFocused()</code></p><h4>Arguments</h4><p>No Arguments.</p><h4>Return Type</h4><p><code>void</code></p></div></div></td><td>Returns whether the node is currently focused.</td></tr><tr><td><a name="getHtml"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">getHtml</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.getHtml()</code></p><h4>Arguments</h4><p>No Arguments.</p><h4>Return Type</h4><p><code>void</code></p></div></div></td><td>The HTML text shown on the label</td></tr><tr><td><a name="getIcon"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">getIcon</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.getIcon()</code></p><h4>Arguments</h4><p>No Arguments.</p><h4>Return Type</h4><p><code>void</code></p></div></div></td><td>Returns the src for the icon</td></tr><tr><td><a name="getIconElement"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">getIconElement</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.getIconElement()</code></p><h4>Arguments</h4><p>No Arguments.</p><h4>Return Type</h4><p><code>void</code></p></div></div></td><td>Returns the element used for the icon of the node</td></tr><tr><td><a name="getIconHtml"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">getIconHtml</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.getIconHtml()</code></p><h4>Arguments</h4><p>No Arguments.</p><h4>Return Type</h4><p><code>void</code></p></div></div></td><td>The HTML code for the icon part of the node.</td></tr><tr><td><a name="getIconSrc"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">getIconSrc</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.getIconSrc()</code></p><h4>Arguments</h4><p>No Arguments.</p><h4>Return Type</h4><p><code>void</code></p></div></div></td><td>Returns the src for the image used for the icon.</td></tr><tr><td><a name="getId"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">getId</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.getId()</code></p><h4>Arguments</h4><p>No Arguments.</p><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> The id is used to identify the node and it needs to be unique. </td></tr><tr><td><a name="getLabelElement"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">getLabelElement</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.getLabelElement()</code></p><h4>Arguments</h4><p>No Arguments.</p><h4>Return Type</h4><p><code>void</code></p></div></div></td><td>Returns the element used for the label part of the node</td></tr><tr><td><a name="getLabelHtml"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">getLabelHtml</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.getLabelHtml()</code></p><h4>Arguments</h4><p>No Arguments.</p><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> Returns the HTML for the label part of the node. </td></tr><tr><td><a name="getLastChild"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">getLastChild</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.getLastChild()</code></p><h4>Arguments</h4><p>No Arguments.</p><h4>Return Type</h4><p><code>void</code></p></div></div></td><td>Returns the last child node</td></tr><tr><td><a name="getLastShownDescendant"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">getLastShownDescendant</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.getLastShownDescendant()</code></p><h4>Arguments</h4><p>No Arguments.</p><h4>Return Type</h4><p><code>void</code></p></div></div></td><td>Returns the last shown descendant in the subtree.</td></tr><tr><td><a name="getLineStyle"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">getLineStyle</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.getLineStyle()</code></p><h4>Arguments</h4><p>No Arguments.</p><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> Returns a fragment of style attribute value which is used to draw the line for the tree. </td></tr><tr><td><a name="getLineStyle2"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">getLineStyle2</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.getLineStyle2()</code></p><h4>Arguments</h4><p>No Arguments.</p><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> Return the background position style value used with getLineStyle </td></tr><tr><td><a name="getNextShownNode"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">getNextShownNode</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.getNextShownNode()</code></p><h4>Arguments</h4><p>No Arguments.</p><h4>Return Type</h4><p><code>void</code></p></div></div></td><td>Returns the next shown node in the tree</td></tr><tr><td><a name="getNextSibling"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">getNextSibling</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.getNextSibling()</code></p><h4>Arguments</h4><p>No Arguments.</p><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> Returns the sibling after this or undefined if this is the last child. </td></tr><tr><td><a name="getOpenIcon"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">getOpenIcon</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.getOpenIcon()</code></p><h4>Arguments</h4><p>No Arguments.</p><h4>Return Type</h4><p><code>void</code></p></div></div></td><td>Returns the src for the open icon.</td></tr><tr><td><a name="getParent"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">getParent</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.getParent()</code></p><h4>Arguments</h4><p>No Arguments.</p><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> This returns the parent node. For the root node this returns null. </td></tr><tr><td><a name="getPreviousShownNode"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">getPreviousShownNode</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.getPreviousShownNode()</code></p><h4>Arguments</h4><p>No Arguments.</p><h4>Return Type</h4><p><code>void</code></p></div></div></td><td>Returns the previous shown node in the tree</td></tr><tr><td><a name="getPreviousSibling"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">getPreviousSibling</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.getPreviousSibling()</code></p><h4>Arguments</h4><p>No Arguments.</p><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> Returns the node before this or undefined if there is no previous sibling </td></tr><tr><td><a name="getRowClassName"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">getRowClassName</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.getRowClassName()</code></p><h4>Arguments</h4><p>No Arguments.</p><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> Returns the class name for the row element </td></tr><tr><td><a name="getRowElement"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">getRowElement</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.getRowElement()</code></p><h4>Arguments</h4><p>No Arguments.</p><h4>Return Type</h4><p><code>void</code></p></div></div></td><td>Returns the element for the row part of the node.</td></tr><tr><td><a name="getRowHtml"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">getRowHtml</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.getRowHtml()</code></p><h4>Arguments</h4><p>No Arguments.</p><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> Returns the HTML needed to draw the row part of the node. </td></tr><tr><td><a name="getTarget"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">getTarget</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.getTarget()</code></p><h4>Arguments</h4><p>No Arguments.</p><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> Returns the target window/frame that the item should be opened in when this item is clicked. </td></tr><tr><td><a name="getText"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">getText</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.getText()</code></p><h4>Arguments</h4><p>No Arguments.</p><h4>Return Type</h4><p><code>void</code></p></div></div></td><td>Returns the text of the label (this is the plain text version)</td></tr><tr><td><a name="getToolTip"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">getToolTip</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.getToolTip()</code></p><h4>Arguments</h4><p>No Arguments.</p><h4>Return Type</h4><p><code>void</code></p></div></div></td><td>The tool tip that should be shown for the item.</td></tr><tr><td><a name="getTree"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">getTree</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.getTree()</code></p><h4>Arguments</h4><p>No Arguments.</p><h4>Return Type</h4><p><code>void</code></p></div></div></td><td>Returns the root node of the tree</td></tr><tr><td><a name="hasChildren"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">hasChildren</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.hasChildren()</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td></td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> Whether this node contains any children </td></tr><tr><td><a name="isLastSibling"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">isLastSibling</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.isLastSibling()</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td></td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td>Whether this is the last child of the parent node</td></tr><tr><td><a name="isSelected"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">isSelected</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.isSelected()</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td></td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> Whether the node is selected. </td></tr><tr><td><a name="openPath"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">openPath</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.openPath(<span class="methodArgument">sPath</span>&nbsp;[, <span class="methodArgument">bSelect</span>&nbsp;[, <span class="methodArgument">bFocus</span>]])</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td><code>sPath</code></td><td><code></code></td><td> The path to open. For example:<br></br> <br></br> "/dhtml/xtree2/js" </td></tr><tr><td><code>bSelect</code></td><td><code></code></td><td><span class="optional">Optional.</span> If true then the final node in the path is selected after it has been revealed </td></tr><tr><td><code>bFocus</code></td><td><code></code></td><td><span class="optional">Optional.</span> If true then the final node in the path is focused after it has been revealed </td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> This takes a String representing the path of nodes and opens them all. The second and third argument are optional and the allow you to select and focus the last node in the path. The path consists of the text of the nodes separated with '/'. If the path starts with '/' then the path is relative to the root. </td></tr><tr><td><a name="remove"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">remove</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.remove([<span class="methodArgument">oChild</span>])</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td><code>oChild</code></td><td><code></code></td><td><span class="optional">Optional.</span> The child node to remove </td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td>Removes a child node (or the node itself if no argument is provided)</td></tr><tr><td><a name="reveal"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">reveal</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.reveal()</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td></td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td>Expands all the parent nodes so that the node is revealed</td></tr><tr><td><a name="select"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">select</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.select()</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td></td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td>Select the node.</td></tr><tr><td><a name="setAction"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">setAction</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.setAction(<span class="methodArgument">oAction</span>)</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td><code>oAction</code></td><td><code></code></td><td> The action to do when the user activates the item. </td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> Sets the action that should be invoked when clicking the item. This can be either a string or a function and if a string the browser will navigate to this page. </td></tr><tr><td><a name="setExpanded"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">setExpanded</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.setExpanded(<span class="methodArgument">b</span>)</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td><code>b</code></td><td><code></code></td><td>Whether to expand or collapse the node</td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> Sets the expanded state </td></tr><tr><td><a name="setHtml"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">setHtml</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.setHtml(<span class="methodArgument">s</span>)</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td><code>s</code></td><td><code></code></td><td>The HTML text to set on the label</td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td>Sets the HTML text shown on the label. Be careful here so that you do not set this to invalid HTML because it might break the rendering </td></tr><tr><td><a name="setIcon"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">setIcon</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.setIcon(<span class="methodArgument">s</span>)</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td><code>s</code></td><td><code></code></td><td>The URI (absolute or relative) to the icon image</td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td>Sets the src for the icon image</td></tr><tr><td><a name="setId"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">setId</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.setId(<span class="methodArgument">sId</span>)</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td><code>sId</code></td><td><code></code></td><td>The new id</td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td>Changes the id of the node</td></tr><tr><td><a name="setOpenIcon"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">setOpenIcon</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.setOpenIcon(<span class="methodArgument">s</span>)</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td><code>s</code></td><td><code></code></td><td>The URI (absolute or relative) to the open icon image</td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td>Sets the src for the open icon image</td></tr><tr><td><a name="setTarget"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">setTarget</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.setTarget(<span class="methodArgument">s</span>)</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td><code>s</code></td><td><code></code></td><td>The window/frame name</td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> Sets the target window/frame that the item should be opened in when this item is clicked. </td></tr><tr><td><a name="setText"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">setText</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.setText(<span class="methodArgument">s</span>)</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td><code>s</code></td><td><code></code></td><td>The plain text to set on the label</td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> Sets the text of the label. If this contains HTML code it will be encoded using entity references. </td></tr><tr><td><a name="setToolTip"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">setToolTip</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.setToolTip(<span class="methodArgument">s</span>)</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td><code>s</code></td><td><code></code></td><td>The tool tip text</td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td>Sets the tool tip that should be shown for the item.</td></tr><tr><td><a name="toggle"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">toggle</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.toggle()</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td></td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td>Toggles the expand state of the node</td></tr><tr><td><a name="toHtml"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">toHtml</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.toHtml()</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td></td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> This generates the HTML needed to write the tree node and all its descendants </td></tr><tr><td><a name="update"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">update</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.update()</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td></td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> Recreates the entire DOM tree for the node and replaces the old DOM tree with the new tree. </td></tr><tr><td><a name="updateExpandIcon"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">updateExpandIcon</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.updateExpandIcon()</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td></td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> This updates the expand (plus and minus) icon. </td></tr><tr><td><a name="updateIcon"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">updateIcon</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.updateIcon()</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td></td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> This updates the icon of the node. </td></tr></tbody></table><h3>Fields</h3><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td colspan="3">None.</td></tr></tbody></table><h3>Events</h3><table><thead><tr><td>Name</td><td>Descripton</td></tr></thead><tbody><tr><td colspan="2">None.</td></tr></tbody></table><h3>Remarks</h3><p> None. </p><h2 id="webFXTreeConfig">webFXTreeConfig</h2><p> This object is used for some configuration options like the default icons and more. <br></br> Don't change these properties after your tree has been created. </p><h3>Syntax</h3><pre>webFXTreeConfig</pre><h3>Parameters</h3><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td>No parameters.</td></tr></tbody></table><h3>Static Methods</h3><table><thead><tr><td>Name</td><td>Description</td></tr></thead><tbody><tr><td colspan="2">None.</td></tr></tbody></table><h3>Static Fields</h3><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td colspan="3">None.</td></tr></tbody></table><h3>Methods</h3><table><thead><tr><td>Name</td><td>Description</td></tr></thead><tbody><tr><td colspan="2">None.</td></tr></tbody></table><h3>Fields</h3><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td><a name="blankIcon"></a><code>blankIcon</code></td><td><code>String</code></td><td>Path to the image to use for an empty icon</td></tr><tr><td><a name="defaultAction"></a><code>defaultAction</code></td><td><code>String</code></td><td> The default action (address) to use for a node. Default is <code>null</code> </td></tr><tr><td><a name="defaultBehavior"></a><code>defaultBehavior</code></td><td><code>String</code></td><td>Whether to use 'classic' or 'explorer' behavior for the open icons</td></tr><tr><td><a name="defaultText"></a><code>defaultText</code></td><td><code>String</code></td><td>The text to show if no text is set on the node</td></tr><tr><td><a name="fileIcon"></a><code>fileIcon</code></td><td><code>String</code></td><td>Path to the image to use for the file icon</td></tr><tr><td><a name="folderIcon"></a><code>folderIcon</code></td><td><code>String</code></td><td>Path to the image to use for the folder icon</td></tr><tr><td><a name="iIcon"></a><code>iIcon</code></td><td><code>String</code></td><td>Path to the image to use for the I shaped line</td></tr><tr><td><a name="lIcon"></a><code>lIcon</code></td><td><code>String</code></td><td>Path to the image to use for the L shaped line</td></tr><tr><td><a name="lMinusIcon"></a><code>lMinusIcon</code></td><td><code>String</code></td><td>Path to the image to use for the collapse icon in front of an L shaped line</td></tr><tr><td><a name="lPlusIcon"></a><code>lPlusIcon</code></td><td><code>String</code></td><td>Path to the image to use for the expand icon in front of an L shaped line</td></tr><tr><td><a name="minusIcon"></a><code>minusIcon</code></td><td><code>String</code></td><td>Path to the image to use for the collapse icon (no line behind)</td></tr><tr><td><a name="openFolderIcon"></a><code>openFolderIcon</code></td><td><code>String</code></td><td>Path to the image to use for the open folder icon</td></tr><tr><td><a name="openRootIcon"></a><code>openRootIcon</code></td><td><code>String</code></td><td>Path to the image to use for the open root icon</td></tr><tr><td><a name="plusIcon"></a><code>plusIcon</code></td><td><code>String</code></td><td>Path to the image to use for the expand icon (no line behind)</td></tr><tr><td><a name="rootIcon"></a><code>rootIcon</code></td><td><code>String</code></td><td>Path to the image to use for the root icon</td></tr><tr><td><a name="tIcon"></a><code>tIcon</code></td><td><code>String</code></td><td>Path to the image to use for the T shaped line</td></tr><tr><td><a name="tMinusIcon"></a><code>tMinusIcon</code></td><td><code>String</code></td><td>Path to the image to use for the collapse icon in front of an T shaped line</td></tr><tr><td><a name="tPlusIcon"></a><code>tPlusIcon</code></td><td><code>String</code></td><td>Path to the image to use for the expand icon in front of an T shaped line</td></tr><tr><td><a name="usePersistence"></a><code>usePersistence</code></td><td><code>Boolean</code></td><td>Whether persistance should be used or not.</td></tr></tbody></table><h3>Events</h3><table><thead><tr><td>Name</td><td>Descripton</td></tr></thead><tbody><tr><td colspan="2">None.</td></tr></tbody></table><h3>Remarks</h3><p> None. </p><h2 id="WebFXTreeCookiePersistence">WebFXTreeCookiePersistence</h2><p>This class extends <code><a href="#WebFXTreePersistence">WebFXTreePersistence</a></code> and therefore all methods and field available for <code><a href="#WebFXTreePersistence">WebFXTreePersistence</a></code> are also available for <code>WebFXTreeCookiePersistence</code>.</p><p> This class is used to handle persistence of the expanded state of the tree nodes. It uses one cookie to store the id of all expanded nodes. The value of the cookie is the ids joined with a '+' character. For example:<br></br> <br></br> "wfxt-3+wfxt-12+wfxt-22" </p><h3>Syntax</h3><p><code> new WebFXTreeCookiePersistence()</code></p><h3>Parameters</h3><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td>No parameters.</td></tr></tbody></table><h3>Static Methods</h3><table><thead><tr><td>Name</td><td>Description</td></tr></thead><tbody /></table><h3>Static Fields</h3><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td colspan="3">None.</td></tr></tbody></table><h3>Methods</h3><table><thead><tr><td>Name</td><td>Description</td></tr></thead><tbody><tr><td colspan="2">None.</td></tr></tbody></table><h3>Fields</h3><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td><a name="cookieName"></a><code>cookieName</code></td><td> This is the name of the cookie where the expand state is stored. </td></tr></tbody></table><h3>Events</h3><table><thead><tr><td>Name</td><td>Descripton</td></tr></thead><tbody><tr><td colspan="2">None.</td></tr></tbody></table><h3>Remarks</h3><p></p><h2 id="webFXTreeHandler">webFXTreeHandler</h2><p> This object is used to keep track of tree nodes. </p><h3>Syntax</h3><pre>webFXTreeHandler</pre><h3>Parameters</h3><h3>Static Methods</h3><table><thead><tr><td>Name</td><td>Description</td></tr></thead><tbody><tr><td colspan="2">None.</td></tr></tbody></table><h3>Static Fields</h3><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td colspan="3">None.</td></tr></tbody></table><h3>Methods</h3><table><thead><tr><td>Name</td><td>Description</td></tr></thead><tbody><tr><td><a name="addNode"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">addNode</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.addNode(<span class="methodArgument">oNode</span>)</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td><code>oNode</code></td><td><code></code></td><td>The node to add</td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> Adds a node to the handler so that the handler can find it later. This is used internally and there is usually no need to call this method. </td></tr><tr><td><a name="dispose"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">dispose</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.dispose()</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td></td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> Cleans up the tree handler and all the nodes it is currently handling. </td></tr><tr><td><a name="getNodeById"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">getNodeById</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.getNodeById(<span class="methodArgument">sId</span>)</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td><code>sId</code></td><td><code></code></td><td>The id of the tree node to return</td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> Returns the a node by a given id. </td></tr><tr><td><a name="getUniqueId"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">getUniqueId</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.getUniqueId()</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td></td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> Returns an id that is not previously used. </td></tr><tr><td><a name="handleEvent"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">handleEvent</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.handleEvent(<span class="methodArgument">e</span>)</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td><code>e</code></td><td><code></code></td><td>The event object used in the user initated event</td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> This is called internally when an UI even occured in a tree. </td></tr><tr><td><a name="htmlToText"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">htmlToText</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.htmlToText(<span class="methodArgument">s</span>)</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td><code>s</code></td><td><code></code></td><td>The HTML string to convert</td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> This takes an HTML formatted string and returns a plain text string. </td></tr><tr><td><a name="removeNode"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">removeNode</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.removeNode(<span class="methodArgument">oNode</span>)</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td><code>oNode</code></td><td><code></code></td><td>The node to add</td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> Removes a node from the handler. This is used internally and there is usually no need to call this method. </td></tr><tr><td><a name="textToHtml"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">textToHtml</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.textToHtml(<span class="methodArgument">s</span>)</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td><code>s</code></td><td><code></code></td><td>The plain text string to convert</td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> This takes a plain text string and returns an HTML formatted string. </td></tr></tbody></table><h3>Fields</h3><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td><a name="ie"></a><code>ie</code></td><td><code>Boolean</code></td><td><span class="readOnly">Read only.</span> Whether the user agent is Internet Explorer or not</td></tr><tr><td><a name="opera"></a><code>opera</code></td><td><code>Boolean</code></td><td><span class="readOnly">Read only.</span> Whether the user agent is Opera or not</td></tr><tr><td><a name="persistenceManager"></a><code>persistenceManager</code></td><td><code>WebFXTreePersistence</code></td><td>The object handling the persistance of the expanded state for tree nodes</td></tr></tbody></table><h3>Events</h3><table><thead><tr><td>Name</td><td>Descripton</td></tr></thead><tbody><tr><td colspan="2">None.</td></tr></tbody></table><h3>Remarks</h3><p> None. </p><h2 id="WebFXTreeItem">WebFXTreeItem</h2><p>This class extends <code><a href="#WebFXTreeAbstractNode">WebFXTreeAbstractNode</a></code> and therefore all methods and field available for <code><a href="#WebFXTreeAbstractNode">WebFXTreeAbstractNode</a></code> are also available for <code>WebFXTreeItem</code>.</p><p> This is the basic tree item that the tree is built up from. </p><h3>Syntax</h3><p><code> new WebFXTreeItem(<span class="methodArgument">sText</span>, <span class="methodArgument">oAction</span>, <span class="methodArgument">eParent</span>, <span class="methodArgument">sIcon</span>, <span class="methodArgument">sOpenIcon</span>)</code></p><h3>Parameters</h3><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td><code>sText</code></td><td><code></code></td><td> The text (HTML) to show as a label for the tree item </td></tr><tr><td><code>oAction</code></td><td><code></code></td><td> The action to do when the node is activated. If this is String then it is treated as an URL but you can also pass a Function object which will be called when activated. </td></tr><tr><td><code>eParent</code></td><td><code></code></td><td> Optional parent tree item. If provided then the item will be added as a child to eParent </td></tr><tr><td><code>sIcon</code></td><td><code></code></td><td>The image to use as icon</td></tr><tr><td><code>sOpenIcon</code></td><td><code></code></td><td>The image to use as open icon</td></tr></tbody></table><h3>Static Methods</h3><table><thead><tr><td>Name</td><td>Description</td></tr></thead><tbody><tr><td colspan="2">None.</td></tr></tbody></table><h3>Static Fields</h3><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td colspan="3">None.</td></tr></tbody></table><h3>Methods</h3><table><thead><tr><td>Name</td><td>Description</td></tr></thead><tbody><tr><td colspan="2">None.</td></tr></tbody></table><h3>Fields</h3><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td colspan="3">None.</td></tr></tbody></table><h3>Events</h3><table><thead><tr><td>Name</td><td>Descripton</td></tr></thead><tbody><tr><td colspan="2">None.</td></tr></tbody></table><h3>Remarks</h3><p> None. </p><h2 id="WebFXTreePersistence">WebFXTreePersistence</h2><p> This class is used to handle persistence of the expanded state of tree items. This class is just a dummy implementation that does not persist the state. Use WebFXTreeCookiePersistence for a cookie based implementation. </p><h3>Syntax</h3><p><code> new WebFXTreePersistence()</code></p><h3>Parameters</h3><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td>No parameters.</td></tr></tbody></table><h3>Static Methods</h3><table><thead><tr><td>Name</td><td>Description</td></tr></thead><tbody /></table><h3>Static Fields</h3><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td colspan="3">None.</td></tr></tbody></table><h3>Methods</h3><table><thead><tr><td>Name</td><td>Description</td></tr></thead><tbody><tr><td><a name="getExpanded"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">getExpanded</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.getExpanded(<span class="methodArgument">oNode</span>)</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td><code>oNode</code></td><td><code></code></td><td> The node to test the expanded state for </td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> Whether the given node is expanded or not. </td></tr><tr><td><a name="setExpanded"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">setExpanded</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.setExpanded(<span class="methodArgument">oNode</span>, <span class="methodArgument">bOpen</span>)</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td><code>oNode</code></td><td><code></code></td><td>The node to persist the expanded state for</td></tr><tr><td><code>bOpen</code></td><td><code></code></td><td>Whether the node is expanded or not</td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> Persists the expanded state for a node. </td></tr></tbody></table><h3>Fields</h3><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td colspan="3">None.</td></tr></tbody></table><h3>Events</h3><table><thead><tr><td>Name</td><td>Descripton</td></tr></thead><tbody><tr><td colspan="2">None.</td></tr></tbody></table><h3>Remarks</h3><p></p><h2>Globals</h2><h3>Functions</h3><table><thead><tr><td>Name</td><td>Description</td></tr></thead><tbody><tr><td colspan="2">None.</td></tr></tbody></table><h3>Objects</h3><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td><a name="arrayHelper"></a><code>arrayHelper</code></td><td><code>Object</code></td><td>This object provides some useful methods when working with arrays</td></tr><tr><td><a name="webFXTreeConfig"></a><code>webFXTreeConfig</code></td><td><code>Object</code></td><td>This object contains some configuration settings for the trees</td></tr><tr><td><a name="webFXTreeHandler"></a><code>webFXTreeHandler</code></td><td><code>Object</code></td><td>This object keeps track of tree nodes</td></tr></tbody></table><!-- end main output --></html> <!-- end webfx-main-body --> </div> </body> </html>
100gd-compare
trunk/WebContent/components/xtree/api.html
HTML
epl
78,430
#!/usr/bin/perl # # This file uses ETP which can be found at # http://perl.eae.net/etp/ # use lib "../../.."; use Etp; PrintOutput(); sub PrintOutput() { my $etp = new Etp(); print("Content-Type: text/xml; charset=UTF-8\n"); print("Cache-Control: no-cache\n"); print("Last-Modified: " . $etp->getDate(0, 3) . "\n"); print("\n"); print("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"); print("<tree><tree text=\"" . $etp->getDate(0, 3) . "\"/></tree>\n"); }
100gd-compare
trunk/WebContent/components/xtree/.svn/text-base/date.xml.pl.svn-base
Perl
epl
466
#!/usr/bin/perl # # This file uses ETP which can be found at # http://perl.eae.net/etp/ # use lib "../../.."; use Etp; PrintOutput(); sub PrintOutput() { my $etp = new Etp(); $etp->parseInput(); my $counter = $etp->getInput('counter') || 0; print("Content-Type: text/xml; charset=UTF-8\n"); print("Cache-Control: no-cache\n"); print("Last-Modified: " . $etp->getDate(0, 3) . "\n"); print("\n"); print("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"); print("<tree><tree text=\"" . $counter . "\" src=\"nest.xml.pl?counter=" . ($counter + 1) . "\"/></tree>\n"); }
100gd-compare
trunk/WebContent/components/xtree/.svn/text-base/nest.xml.pl.svn-base
Perl
epl
578
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>XTree 2 Demo</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <link type="text/css" rel="stylesheet" href="css/xtree2.css"> <script type="text/javascript" src="js/xtree2.js"></script> </head> <body> <script type="text/javascript"> var t = new WebFXTree("Hello World"); var ti0 = new WebFXTreeItem("Item 0"); var ti1 = new WebFXTreeItem("Time"); var ti2 = new WebFXTreeItem("Item 2"); ti2.setId("ti2"); var ti3 = new WebFXTreeItem; ti3.setText("<Item 3>"); var ti4 = new WebFXTreeItem("<strong>Item 4</strong>"); t.add(ti0); t.add(ti1); t.add(ti2); t.add(ti3, ti0); t.add(ti4); t.onchange = function () { if (t.getSelected()) { changedItems.add(new WebFXTreeItem(webFXTreeHandler.textToHtml( t.getSelected().getText() + " - " + new Date))); updateChangeItem(); } }; var changedItems = new WebFXTreeItem("Changed", null, t ); function removeChangeItem() { var fc = this.getFirstChild(); if (fc) this.remove(fc); updateChangeItem(); } function updateChangeItem() { var cs = changedItems.getChildNodes(); changedItems.setText("Change Events [" + cs.length + "]"); if (cs.length > 0 ) { changedItems.setToolTip("Click to remove first item"); changedItems.setAction( removeChangeItem ); } else { changedItems.setToolTip("This lists the change events"); changedItems.setAction( null ); } } window.setInterval(function() { ti1.setText( (new Date).toLocaleTimeString() ); }, 1000); function add50() { var d = new Date; for (var i = 0; i < 50; i++) ti1.add( new WebFXTreeItem("Item " + i) ); alert("Took " + (new Date - d)); } function add50_2() { var d = new Date; t.setSuspendRedraw(true); for (var i = 0; i < 50; i++) ti1.add( new WebFXTreeItem("Item " + i) ); t.setSuspendRedraw(false); ti1.update(); alert("Took " + (new Date - d)); } function remove50() { var d = new Date; var cs = ti1.childNodes; for (var i = Math.min(cs.length - 1, 99); i >= 0 && ti1.hasChildren(); i--) ti1.remove( cs[i] ); alert("Took " + (new Date - d)); } function remove50_2() { var d = new Date; t.setSuspendRedraw(true); var cs = ti1.childNodes; for (var i = Math.min(cs.length - 1, 99); i >= 0 && ti1.hasChildren(); i--) ti1.remove( cs[i] ); t.setSuspendRedraw(false); ti1.update(); alert("Took " + (new Date - d)); } function add50deep() { var d = new Date; var tmp = ti1; for (var i = 0; i < 50; i++) tmp.add( tmp = new WebFXTreeItem("Item " + i) ); alert("Took " + (new Date - d)); } function add50deep_2() { var d = new Date; t.setSuspendRedraw(true); var tmp = ti1; for (var i = 0; i < 50; i++) tmp.add( tmp = new WebFXTreeItem("Item " + i) ); t.setSuspendRedraw(false); ti1.update(); alert("Took " + (new Date - d)); } </script> <button onclick="ti0.add( new WebFXTreeItem( String(new Date), function () { this.remove(); } ) );">Add new to Item 0</button> <button onclick="ti2.add( new WebFXTreeItem( String(new Date), function () { this.remove(); } ) );">Add new to Item 2</button> <button onclick="t.add( new WebFXTreeItem( String(new Date), function () { this.remove(); } ) );">Add new to root</button> <button onclick="add50()">Add 50 to Item 1</button> <button onclick="add50_2()">Add 50 to Item 1 (alt 2)</button> <button onclick="remove50()">Remove 50 from Item 1</button> <button onclick="remove50_2()">Remove 50 from Item 1 (alt 2)</button> <button onclick="add50deep()">Add 50 deep to Item 1</button> <button onclick="add50deep_2()">Add 50 deep to Item 1 (alt 2)</button> <hr> <label for="show-lines"><input type="checkbox" id="show-lines" checked onclick="t.setShowLines(this.checked)"> Show lines</label> <label for="show-expand-icons"><input type="checkbox" id="show-expand-icons" checked onclick="t.setShowExpandIcons(this.checked)"> Show expand icons</label> <label for="show-root"><input type="checkbox" id="show-root" checked onclick="t.setShowRootNode(this.checked)"> Show root node</label> <label for="show-root-lines"><input type="checkbox" id="show-root-lines" checked onclick="t.setShowRootLines(this.checked)"> Show root lines</label> <hr> <button onclick="t.setSelected(ti2)">Select ti2</button> <p>Alt 2 uses suspendRedraw and then does an update when all done.</p> <script type="text/javascript"> var d0 = new Date; t.write(); </script> <p>And another tree in the same page</p> <script type="text/javascript"> var d1 = new Date; var t2 = new WebFXTree("Second Tree"); for (var i = 0; i < 50; i++) t2.add( new WebFXTreeItem("Item " + i) ); t2.write(); document.title += " [" + (d1 - d0) + ", " + (new Date - d0) + "]"; </script> </body> </html>
100gd-compare
trunk/WebContent/components/xtree/demo.html
HTML
epl
4,881
/*----------------------------------------------------------------------------\ | xLoadTree 2.0 PRE RELEASE | | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | | This is a pre release and may not be redistributed. | | Watch http://webfx.eae.net for the final version | |-----------------------------------------------------------------------------| | Created by Erik Arvidsson & Emil A Eklund | | (http://webfx.eae.net/contact.html#erik) | | (http://webfx.eae.net/contact.html#emil) | | For WebFX (http://webfx.eae.net/) | |-----------------------------------------------------------------------------| | A tree menu system for IE 5.5+, Mozilla 1.4+, Opera 7.5+ | |-----------------------------------------------------------------------------| | Copyright (c) 2003, 2004, 2005, 2006 Erik Arvidsson & Emil A Eklund | |-----------------------------------------------------------------------------| | Licensed under the Apache License, Version 2.0 (the "License"); you may not | | use this file except in compliance with the License. You may obtain a copy | | of the License at http://www.apache.org/licenses/LICENSE-2.0 | | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | | Unless required by applicable law or agreed to in writing, software | | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | | License for the specific language governing permissions and limitations | | under the License. | |-----------------------------------------------------------------------------| | Dependencies: xtree2.js - Supplies the tree control | | xtree2.css - Used to define the look and feel | |-----------------------------------------------------------------------------| | 2004-02-21 | Pre release distributed to a few selected tester | | 2005-06-06 | Removed dependency on XML Extras | | 2006-05-28 | Changed license to Apache Software License 2.0. | |-----------------------------------------------------------------------------| | Created 2003-??-?? | All changes are in the log above. | Updated 2006-05-28 | \----------------------------------------------------------------------------*/ webFXTreeConfig.loadingText = "Loading..."; webFXTreeConfig.loadingIcon = "images/loading.gif"; function WebFXLoadTree(sText, sXmlSrc, oAction, sBehavior, sIcon, sOpenIcon) { WebFXTree.call(this, sText, oAction, sBehavior, sIcon, sOpenIcon); // setup default property values this.src = sXmlSrc; this.loading = !sXmlSrc; this.loaded = !sXmlSrc; this.errorText = ""; if (this.src) { /// add loading Item this._loadingItem = WebFXLoadTree.createLoadingItem(); this.add(this._loadingItem); if (this.getExpanded()) { WebFXLoadTree.loadXmlDocument(this); } } } WebFXLoadTree.createLoadingItem = function () { return new WebFXTreeItem(webFXTreeConfig.loadingText, null, null, webFXTreeConfig.loadingIcon); }; _p = WebFXLoadTree.prototype = new WebFXTree; _p.setExpanded = function setExpanded(b) { WebFXTree.prototype.setExpanded.call(this, b); if (this.src && b) { if (!this.loaded && !this.loading) { // load WebFXLoadTree.loadXmlDocument(this); } } }; function WebFXLoadTreeItem(sText, sXmlSrc, oAction, eParent, sIcon, sOpenIcon) { WebFXTreeItem.call(this, sText, oAction, eParent, sIcon, sOpenIcon); // setup default property values this.src = sXmlSrc; this.loading = !sXmlSrc; this.loaded = !sXmlSrc; this.errorText = ""; if (this.src) { /// add loading Item this._loadingItem = WebFXLoadTree.createLoadingItem(); this.add(this._loadingItem); if (this.getExpanded()) { WebFXLoadTree.loadXmlDocument(this); } } } _p = WebFXLoadTreeItem.prototype = new WebFXTreeItem; _p.setExpanded = function setExpanded(b) { WebFXTreeItem.prototype.setExpanded.call(this, b); if (this.src && b) { if (!this.loaded && !this.loading) { // load WebFXLoadTree.loadXmlDocument(this); } } }; // reloads the src file if already loaded WebFXLoadTree.prototype.reload = _p.reload = function reload() { // if loading do nothing if (this.loaded) { var t = this.getTree(); var expanded = this.getExpanded(); var sr = t.getSuspendRedraw(); t.setSuspendRedraw(true); // remove while (this.childNodes.length > 0) { this.remove(this.childNodes[this.childNodes.length - 1]); } this.loaded = false; this._loadingItem = WebFXLoadTree.createLoadingItem(); this.add(this._loadingItem); if (expanded) { this.setExpanded(true); } t.setSuspendRedraw(sr); this.update(); } else if (this.open && !this.loading) { WebFXLoadTree.loadXmlDocument(this); } }; WebFXLoadTree.prototype.setSrc = _p.setSrc = function setSrc(sSrc) { var oldSrc = this.src; if (sSrc == oldSrc) return; var expanded = this.getExpanded(); // remove all this._callSuspended(function () { // remove while (this.childNodes.length > 0) this.remove(this.childNodes[this.childNodes.length - 1]); }); this.update(); this.loaded = false; this.loading = false; if (this._loadingItem) { this._loadingItem.dispose(); this._loadingItem = null; } this.src = sSrc; if (sSrc) { this._loadingItem = WebFXLoadTree.createLoadingItem(); this.add(this._loadingItem); } this.setExpanded(expanded); }; WebFXLoadTree.prototype.getSrc = _p.getSrc = function getSrc() { return this.src; }; WebFXLoadTree.prototype.dispose = function () { WebFXTree.prototype.dispose.call(this); if (this._xmlHttp) { if (this._xmlHttp.dispose) { this._xmlHttp.dispose(); } try { this._xmlHttp.onreadystatechange = null; this._xmlHttp.abort(); } catch (ex) {} this._xmlHttp = null; } }; _p.dispose = function dispose() { WebFXTreeItem.prototype.dispose.call(this); if (this._xmlHttp) { if (this._xmlHttp.dispose) { this._xmlHttp.dispose(); } try { this._xmlHttp.onreadystatechange = null; this._xmlHttp.abort(); } catch (ex) {} this._xmlHttp = null; } }; // The path is divided by '/' and the item is identified by the text WebFXLoadTree.prototype.openPath = _p.openPath = function openPath(sPath, bSelect, bFocus) { // remove any old pending paths to open delete this._pathToOpen; //delete this._pathToOpenById; this._selectPathOnLoad = bSelect; this._focusPathOnLoad = bFocus; if (sPath == "") { if (bSelect) { this.select(); } if (bFocus) { window.setTimeout("WebFXTreeAbstractNode._onTimeoutFocus(\"" + this.getId() + "\")", 10); } return; } var parts = sPath.split("/"); var remainingPath = parts.slice(1).join("/"); if (sPath.charAt(0) == "/") { this.getTree().openPath(remainingPath, bSelect, bFocus); } else { // open this.setExpanded(true); if (this.loaded) { parts = sPath.split("/"); var ti = this.findChildByText(parts[0]); if (!ti) { throw "Could not find child node with text \"" + parts[0] + "\""; } ti.openPath(remainingPath, bSelect, bFocus); } else { this._pathToOpen = sPath; } } }; // Opera has some serious attribute problems. We need to use getAttribute // for certain attributes WebFXLoadTree._attrs = ["text", "src", "action", "id", "target"]; WebFXLoadTree.createItemFromElement = function (oNode) { var jsAttrs = {}; var domAttrs = oNode.attributes; var i, l; l = domAttrs.length; for (i = 0; i < l; i++) { if (domAttrs[i] == null) { continue; } jsAttrs[domAttrs[i].nodeName] = domAttrs[i].nodeValue; } var name, val; for (i = 0; i < WebFXLoadTree._attrs.length; i++) { name = WebFXLoadTree._attrs[i]; value = oNode.getAttribute(name); if (value) { jsAttrs[name] = value; } } var action; if (jsAttrs.onaction) { action = new Function(jsAttrs.onaction); } else if (jsAttrs.action) { action = jsAttrs.action; } var jsNode = new WebFXLoadTreeItem(jsAttrs.html || "", jsAttrs.src, action, null, jsAttrs.icon, jsAttrs.openIcon); if (jsAttrs.text) { jsNode.setText(jsAttrs.text); } if (jsAttrs.target) { jsNode.target = jsAttrs.target; } if (jsAttrs.id) { jsNode.setId(jsAttrs.id); } if (jsAttrs.toolTip) { jsNode.toolTip = jsAttrs.toolTip; } if (jsAttrs.expanded) { jsNode.setExpanded(jsAttrs.expanded != "false"); } if (jsAttrs.onload) { jsNode.onload = new Function(jsAttrs.onload); } if (jsAttrs.onerror) { jsNode.onerror = new Function(jsAttrs.onerror); } jsNode.attributes = jsAttrs; // go through childNodes var cs = oNode.childNodes; l = cs.length; for (i = 0; i < l; i++) { if (cs[i].tagName == "tree") { jsNode.add(WebFXLoadTree.createItemFromElement(cs[i])); } } return jsNode; }; WebFXLoadTree.loadXmlDocument = function (jsNode) { if (jsNode.loading || jsNode.loaded) { return; } jsNode.loading = true; var id = jsNode.getId(); jsNode._xmlHttp = window.XMLHttpRequest ? new XMLHttpRequest : new window.ActiveXObject("Microsoft.XmlHttp"); jsNode._xmlHttp.open("GET", jsNode.src, true); // async jsNode._xmlHttp.onreadystatechange = new Function("WebFXLoadTree._onload(\"" + id + "\")"); // call in new thread to allow ui to update window.setTimeout("WebFXLoadTree._ontimeout(\"" + id + "\")", 10); }; WebFXLoadTree._onload = function (sId) { var jsNode = webFXTreeHandler.all[sId]; if (jsNode._xmlHttp.readyState == 4) { WebFXLoadTree.documentLoaded(jsNode); webFXLoadTreeQueue.remove(jsNode); if (jsNode._xmlHttp.dispose) jsNode._xmlHttp.dispose(); jsNode._xmlHttp = null; } }; WebFXLoadTree._ontimeout = function (sId) { var jsNode = webFXTreeHandler.all[sId]; webFXLoadTreeQueue.add(jsNode); }; // Inserts an xml document as a subtree to the provided node WebFXLoadTree.documentLoaded = function (jsNode) { if (jsNode.loaded) { return; } jsNode.errorText = ""; jsNode.loaded = true; jsNode.loading = false; var t = jsNode.getTree(); var oldSuspend = t.getSuspendRedraw(); t.setSuspendRedraw(true); var doc = jsNode._xmlHttp.responseXML; // check that the load of the xml file went well if(!doc || doc.parserError && doc.parseError.errorCode != 0 || !doc.documentElement) { if (!doc || doc.parseError.errorCode == 0) { jsNode.errorText = "Error loading " + jsNode.src + " (" + jsNode._xmlHttp.status + ": " + jsNode._xmlHttp.statusText + ")"; } else { jsNode.errorText = "Error loading " + jsNode.src + " (" + doc.parseError.reason + ")"; } } else { // there is one extra level of tree elements var root = doc.documentElement; // loop through all tree children var cs = root.childNodes; var l = cs.length; for (var i = 0; i < l; i++) { if (cs[i].tagName == "tree") { jsNode.add(WebFXLoadTree.createItemFromElement(cs[i])); } } } if (jsNode.errorText != "") { jsNode._loadingItem.icon = contextPath + "/components/xtree/images/exclamation.16.gif"; jsNode._loadingItem.text = jsNode.errorText; jsNode._loadingItem.action = WebFXLoadTree._reloadParent; jsNode._loadingItem.toolTip = "Click to reload"; t.setSuspendRedraw(oldSuspend); jsNode._loadingItem.update(); if (typeof jsNode.onerror == "function") { jsNode.onerror(); } } else { // remove dummy if (jsNode._loadingItem != null) { jsNode.remove(jsNode._loadingItem); } if (jsNode._pathToOpen) { jsNode.openPath(jsNode._pathToOpen, jsNode._selectPathOnLoad, jsNode._focusPathOnLoad); } t.setSuspendRedraw(oldSuspend); jsNode.update(); if (typeof jsNode.onload == "function") { jsNode.onload(); } } }; WebFXLoadTree._reloadParent = function () { this.getParent().reload(); }; var webFXLoadTreeQueue = new function () { var nodes = []; var ie = /msie/i.test(navigator.userAgent); var opera = /opera/i.test(navigator.userAgent); this.add = function (jsNode) { if (ie || opera) { nodes.push(jsNode); if (nodes.length == 1) { send(); } } else { jsNode._xmlHttp.send(null); } }; this.remove = function (jsNode) { if (ie || opera) { arrayHelper.remove(nodes, jsNode); if (nodes.length > 0) { send(); } } }; // IE only function send() { var id = nodes[0].getId(); var jsNode = webFXTreeHandler.all[id]; if (!jsNode) { return; } // if no _xmlHttp then remove it if (!jsNode._xmlHttp) { this.remove(jsNode); } else { jsNode._xmlHttp.send(null); } } };
100gd-compare
trunk/WebContent/components/xtree/js/xloadtree2.js
JavaScript
epl
13,233
if (document.getElementById) { var tree = new WebFXTree('Root'); tree.setBehavior('classic'); var a = new WebFXTreeItem('1'); tree.add(a); var b = new WebFXTreeItem('1.1'); a.add(b); b.add(new WebFXTreeItem('1.1.1')); b.add(new WebFXTreeItem('1.1.2')); b.add(new WebFXTreeItem('1.1.3')); var f = new WebFXTreeItem('1.1.4'); b.add(f); f.add(new WebFXTreeItem('1.1.4.1')); f.add(new WebFXTreeItem('1.1.4.2')); f.add(new WebFXTreeItem('1.1.4.3')); var c = new WebFXTreeItem('1.2'); a.add(c); c.add(new WebFXTreeItem('1.5.1')); c.add(new WebFXTreeItem('1.5.2')); c.add(new WebFXTreeItem('1.5.3')); a.add(new WebFXTreeItem('1.3')); a.add(new WebFXTreeItem('1.4')); a.add(new WebFXTreeItem('1.5')); var d = new WebFXTreeItem('2'); tree.add(d); var e = new WebFXTreeItem('2.1'); d.add(e); e.add(new WebFXTreeItem('2.1.1')); e.add(new WebFXTreeItem('2.1.2')); e.add(new WebFXTreeItem('2.1.3')); d.add(new WebFXTreeItem('2.2')); d.add(new WebFXTreeItem('2.3')); d.add(new WebFXTreeItem('2.4')); //document.write(tree); tree.write(); }
100gd-compare
trunk/WebContent/components/xtree/js/tree.v1.js
JavaScript
epl
1,096
/*----------------------------------------------------------------------------\ | xTree 2.0 PRE RELEASE | | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | | This is a pre release and may not be redistributed. | | Watch http://webfx.eae.net for the final version | |-----------------------------------------------------------------------------| | Created by Erik Arvidsson & Emil A Eklund | | (http://webfx.eae.net/contact.html#erik) | | (http://webfx.eae.net/contact.html#emil) | | For WebFX (http://webfx.eae.net/) | |-----------------------------------------------------------------------------| | A tree menu system for IE 5.5+, Mozilla 1.4+, Opera 7, KHTML | |-----------------------------------------------------------------------------| | Copyright (c) 2003, 2004, 2005, 2006 Erik Arvidsson & Emil A Eklund | |-----------------------------------------------------------------------------| | Licensed under the Apache License, Version 2.0 (the "License"); you may not | | use this file except in compliance with the License. You may obtain a copy | | of the License at http://www.apache.org/licenses/LICENSE-2.0 | | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | | Unless required by applicable law or agreed to in writing, software | | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | | License for the specific language governing permissions and limitations | | under the License. | |-----------------------------------------------------------------------------| | Dependencies: xtree2.css - Used to define the look and feel | |-----------------------------------------------------------------------------| | 2004-02-21 | Pre release distributed to a few selected tester | | 2005-06-06 | Added single tab index to improve keyboard navigation | | 2006-05-28 | Changed license to Apache Software License 2.0. | |-----------------------------------------------------------------------------| | Created 2003-??-?? | All changes are in the log above. | Updated 2006-05-28 | \----------------------------------------------------------------------------*/ // // WebFXTreePersisitance function WebFXTreePersistence() {} var _p = WebFXTreePersistence.prototype; _p.getExpanded = function getExpanded(oNode) { return false; }; _p.setExpanded = function setExpanded(oNode, bOpen) {}; // Cookie handling function WebFXCookie() {} _p = WebFXCookie.prototype; _p.setCookie = function setCookie(sName, sValue, nDays) { var expires = ""; if (typeof nDays == "number") { var d = new Date(); d.setTime(d.getTime() + nDays * 24 * 60 * 60 * 1000); expires = "; expires=" + d.toGMTString(); } document.cookie = sName + "=" + escape(sValue) + expires + "; path=/"; }; _p.getCookie = function getCookie(sName) { var re = new RegExp("(\;|^)[^;]*(" + sName + ")\=([^;]*)(;|$)"); var res = re.exec(document.cookie); return res != null ? unescape(res[3]) : null; }; _p.removeCookie = function removeCookie(name) { this.setCookie(name, "", -1); }; // // persistence using cookies // // This is uses one cookie with the ids of the expanded nodes separated using '+' // function WebFXTreeCookiePersistence() { this._openedMap = {}; this._cookies = new WebFXCookie; var s = this._cookies.getCookie(this.cookieName); if (s) { var a = s.split("+"); for (var i = a.length - 1; i >= 0; i--) this._openedMap[a[i]] = true; } } _p = WebFXTreeCookiePersistence.prototype = new WebFXTreePersistence; _p.cookieName = "webfx-tree-cookie-persistence" _p.getExpanded = function getExpanded(oNode) { return oNode.id in this._openedMap; }; _p.setExpanded = function setExpanded(oNode, bOpen) { var old = this.getExpanded(oNode); if (old != bOpen) { if (bOpen) { this._openedMap[oNode.id] = true; } else { delete this._openedMap[oNode.id]; } var res = []; var i = 0; for (var id in this._openedMap) res[i++] = id; this._cookies.setCookie(this.cookieName, res.join("+")); } }; // this object provides a few useful methods when working with arrays var arrayHelper = { indexOf: function (a, o) { for (var i = 0; i < a.length; i++) { if (a[i] == o) { return i; } } return -1; }, insertBefore: function (a, o, o2) { var i = this.indexOf(a, o2); if (i == -1) { a.push(o); } else { a.splice(i, 0, o); } }, remove: function (a, o) { var i = this.indexOf(a, o); if (i != -1) { a.splice(i, 1); } } }; /////////////////////////////////////////////////////////////////////////////// // WebFX Tree Config object // /////////////////////////////////////////////////////////////////////////////// var webFXTreeConfig = { rootIcon : contextPath + "/components/xtree/images/folder.png", openRootIcon : contextPath + "/components/xtree/images/openfolder.png", folderIcon : contextPath + "/components/xtree/images/folder.png", openFolderIcon : contextPath + "/components/xtree/images/openfolder.png", fileIcon : contextPath + "/components/xtree/images/file.png", iIcon : contextPath + "/components/xtree/images/I.png", lIcon : contextPath + "/components/xtree/images/L.png", lMinusIcon : contextPath + "/components/xtree/images/Lminus.png", lPlusIcon : contextPath + "/components/xtree/images/Lplus.png", tIcon : contextPath + "/components/xtree/images/T.png", tMinusIcon : contextPath + "/components/xtree/images/Tminus.png", tPlusIcon : contextPath + "/components/xtree/images/Tplus.png", plusIcon : contextPath + "/components/xtree/images/plus.png", minusIcon : contextPath + "/components/xtree/images/minus.png", blankIcon : contextPath + "/components/xtree/images/blank.png", defaultText : "Tree Item", defaultAction : null, defaultBehavior : "classic", usePersistence : true }; /////////////////////////////////////////////////////////////////////////////// // WebFX Tree Handler object // /////////////////////////////////////////////////////////////////////////////// var webFXTreeHandler = { ie: /msie/i.test(navigator.userAgent), opera: /opera/i.test(navigator.userAgent), idCounter: 0, idPrefix: "wfxt-", getUniqueId: function () { return this.idPrefix + this.idCounter++; }, all: {}, getNodeById: function (sId) { return all[sId]; }, addNode: function (oNode) { this.all[oNode.id] = oNode; }, removeNode: function (oNode) { delete this.all[oNode.id]; }, handleEvent: function (e) { var el = e.target || e.srcElement; while (el != null && !this.all[el.id]) { el = el.parentNode; } if (el == null) { return false; } var node = this.all[el.id]; if (typeof node["_on" + e.type] == "function") { return node["_on" + e.type](e); } return false; }, dispose: function () { if (this.disposed) return; for (var id in this.all) { this.all[id].dispose(); } this.disposed = true; }, htmlToText: function (s) { return String(s).replace(/\s+|<([^>])+>|&amp;|&lt;|&gt;|&quot;|&nbsp;/gi, this._htmlToText); }, _htmlToText: function (s) { switch (s) { case "&amp;": return "&"; case "&lt;": return "<"; case "&gt;": return ">"; case "&quot;": return "\""; case "&nbsp;": return String.fromCharCode(160); default: if (/\s+/.test(s)) { return " "; } if (/^<BR/gi.test(s)) { return "\n"; } return ""; } }, textToHtml: function (s) { return String(s).replace(/&|<|>|\n|\"\u00A0/g, this._textToHtml); }, _textToHtml: function (s) { switch (s) { case "&": return "&amp;"; case "<": return "&lt;"; case ">": return "&gt;"; case "\n": return "<BR>"; case "\"": return "&quot;"; // so we can use this in attributes default: return "&nbsp;"; } }, persistenceManager: new WebFXTreeCookiePersistence() }; /////////////////////////////////////////////////////////////////////////////// // WebFXTreeAbstractNode /////////////////////////////////////////////////////////////////////////////// function WebFXTreeAbstractNode(sText, oAction) { this.childNodes = []; if (sText) this.text = sText; if (oAction) this.action = oAction; this.id = webFXTreeHandler.getUniqueId(); if (webFXTreeConfig.usePersistence) { this.open = webFXTreeHandler.persistenceManager.getExpanded(this); } webFXTreeHandler.addNode(this); } _p = WebFXTreeAbstractNode.prototype; _p._selected = false; _p.indentWidth = 19; _p.open = false; _p.text = webFXTreeConfig.defaultText; _p.action = null; _p.target = null; _p.toolTip = null; _p._focused = false; /* begin tree model */ _p.add = function add(oChild, oBefore) { var oldLast; var emptyBefore = this.childNodes.length == 0; var p = oChild.parentNode; if (oBefore == null) { // append if (p != null) p.remove(oChild); oldLast = this.getLastChild(); this.childNodes.push(oChild); } else { // insertBefore if (oBefore.parentNode != this) { throw new Error("Can only add nodes before siblings"); } if (p != null) { p.remove(oChild); } arrayHelper.insertBefore(this.childNodes, oChild, oBefore); } if (oBefore) { if (oBefore == this.firstChild) { this.firstChild = oChild; } oChild.previousSibling = oBefore.previousSibling; oBefore.previousSibling = oChild; oChild.nextSibling = oBefore; } else { if (!this.firstChild) { this.firstChild = oChild; } if (this.lastChild) { this.lastChild.nextSibling = oChild; } oChild.previousSibling = this.lastChild; this.lastChild = oChild; } oChild.parentNode = this; var t = this.getTree(); if (t) { oChild.tree = t; } var d = this.getDepth(); if (d != null) { oChild.depth = d + 1; } if (this.getCreated() && !t.getSuspendRedraw()) { var el = this.getChildrenElement(); var newEl = oChild.create(); var refEl = oBefore ? oBefore.getElement() : null; el.insertBefore(newEl, refEl); if (oldLast) { oldLast.updateExpandIcon(); } if (emptyBefore) { this.setExpanded(this.getExpanded()); // if we are using classic expand will not update icon if (t && t.getBehavior() != "classic") this.updateIcon(); } } return oChild; }; _p.remove = function remove(oChild) { // backwards compatible. If no argument remove the node if (arguments.length == 0) { if (this.parentNode) { return this.parentNode.remove(this); } return null; } // if we remove selected or tree with the selected we should select this var t = this.getTree(); var si = t ? t.getSelected() : null; if (si == oChild || oChild.contains(si)) { if (si.getFocused()) { this.select(); window.setTimeout("WebFXTreeAbstractNode._onTimeoutFocus(\"" + this.id + "\")", 10); } else { this.select(); } } if (oChild.parentNode != this) { throw new Error("Can only remove children"); } arrayHelper.remove(this.childNodes, oChild); if (this.lastChild == oChild) { this.lastChild = oChild.previousSibling; } if (this.firstChild == oChild) { this.firstChild = oChild.nextSibling; } if (oChild.previousSibling) { oChild.previousSibling.nextSibling = oChild.nextSibling; } if (oChild.nextSibling) { oChild.nextSibling.previousSibling = oChild.previousSibling; } var wasLast = oChild.isLastSibling(); oChild.parentNode = null; oChild.tree = null; oChild.depth = null; if (t && this.getCreated() && !t.getSuspendRedraw()) { var el = this.getChildrenElement(); var childEl = oChild.getElement(); el.removeChild(childEl); if (wasLast) { var newLast = this.getLastChild(); if (newLast) { newLast.updateExpandIcon(); } } if (!this.hasChildren()) { el.style.display = "none"; this.updateExpandIcon(); this.updateIcon(); } } return oChild; }; WebFXTreeAbstractNode._onTimeoutFocus = function (sId) { var jsNode = webFXTreeHandler.all[sId]; jsNode.focus(); }; _p.getId = function getId() { return this.id; }; _p.getTree = function getTree() { throw new Error("getTree called on Abstract Node"); }; _p.getDepth = function getDepth() { throw new Error("getDepth called on Abstract Node"); }; _p.getCreated = function getCreated() { var t = this.getTree(); return t && t.rendered; }; _p.getParent = function getParent() { return this.parentNode; }; _p.contains = function contains(oDescendant) { if (oDescendant == null) return false; if (oDescendant == this) return true; var p = oDescendant.parentNode; return this.contains(p); }; _p.getChildren = _p.getChildNodes = function getChildNodes() { return this.childNodes; }; _p.getFirstChild = function getFirstChild() { return this.childNodes[0]; }; _p.getLastChild = function getLastChild() { return this.childNodes[this.childNodes.length - 1]; }; _p.getPreviousSibling = function getPreviousSibling() { return this.previousSibling; //var p = this.parentNode; //if (p == null) return null; //var cs = p.childNodes; //return cs[arrayHelper.indexOf(cs, this) - 1] }; _p.getNextSibling = function getNextSibling() { return this.nextSibling; //var p = this.parentNode; //if (p == null) return null; //var cs = p.childNodes; //return cs[arrayHelper.indexOf(cs, this) + 1] }; _p.hasChildren = function hasChildren() { return this.childNodes.length > 0; }; _p.isLastSibling = function isLastSibling() { return this.nextSibling == null; //return this.parentNode && this == this.parentNode.getLastChild(); }; _p.findChildByText = function findChildByText(s, n) { if (!n) { n = 0; } var isRe = s instanceof RegExp; for (var i = 0; i < this.childNodes.length; i++) { if (isRe && s.test(this.childNodes[i].getText()) || this.childNodes[i].getText() == s) { if (n == 0) { return this.childNodes[i]; } n--; } } return null; }; _p.findNodeByText = function findNodeByText(s, n) { if (!n) { n = 0; } var isRe = s instanceof RegExp; if (isRe && s.test(this.getText()) || this.getText() == s) { if (n == 0) { return this.childNodes[i]; } n--; } var res; for (var i = 0; i < this.childNodes.length; i++) { res = this.childNodes[i].findNodeByText(s, n); if (res) { return res; } } return null; }; /* end tree model */ _p.setId = function setId(sId) { var el = this.getElement(); webFXTreeHandler.removeNode(this); this.id = sId; if (el) { el.id = sId; } webFXTreeHandler.addNode(this); }; _p.isSelected = function isSelected() { return this._selected; }; _p.select = function select() { this._setSelected(true); }; _p.deselect = function deselect() { this._setSelected(false); }; _p._setSelected = function _setSelected(b) { var t = this.getTree(); if (!t) return; if (this._selected != b) { this._selected = b; var wasFocused = false; // used to keep focus state var si = t.getSelected(); if (b && si != null && si != this) { var oldFireChange = t._fireChange; wasFocused = si._focused; t._fireChange = false; si._setSelected(false); t._fireChange = oldFireChange; } var el = this.getRowElement(); if (el) { el.className = this.getRowClassName(); } if (b) { this._setTabIndex(t.tabIndex); t._selectedItem = this; t._fireOnChange(); t.setSelected(this); if (wasFocused) { this.focus(); } } else { this._setTabIndex(-1); } if (t.getBehavior() != "classic") { this.updateIcon(); } } }; _p.getExpanded = function getExpanded() { return this.open; }; _p.setExpanded = function setExpanded(b) { var ce; this.open = b; var t = this.getTree(); if (this.hasChildren()) { var si = t ? t.getSelected() : null; if (!b && this.contains(si)) { this.select(); } var el = this.getElement(); if (el) { ce = this.getChildrenElement(); if (ce) { ce.style.display = b ? "block" : "none"; } var eie = this.getExpandIconElement(); if (eie) { eie.src = this.getExpandIconSrc(); } } if (webFXTreeConfig.usePersistence) { webFXTreeHandler.persistenceManager.setExpanded(this, b); } } else { ce = this.getChildrenElement(); if (ce) ce.style.display = "none"; } if (t && t.getBehavior() == "classic") { this.updateIcon(); } }; _p.toggle = function toggle() { this.setExpanded(!this.getExpanded()); }; _p.expand = function expand() { this.setExpanded(true); }; _p.collapse = function collapse() { this.setExpanded(false); }; _p.collapseChildren = function collapseChildren() { var cs = this.childNodes; for (var i = 0; i < cs.length; i++) { cs[i].collapseAll(); } }; _p.collapseAll = function collapseAll() { this.collapseChildren(); this.collapse(); }; _p.expandChildren = function expandChildren() { var cs = this.childNodes; for (var i = 0; i < cs.length; i++) { cs[i].expandAll(); } }; _p.expandAll = function expandAll() { this.expandChildren(); this.expand(); }; _p.reveal = function reveal() { var p = this.getParent(); if (p) { p.setExpanded(true); p.reveal(); } }; _p.openPath = function openPath(sPath, bSelect, bFocus) { if (sPath == "") { if (bSelect) { this.select(); } if (bFocus) { window.setTimeout("WebFXTreeAbstractNode._onTimeoutFocus(\"" + this.id + "\")", 10); } return; } var parts = sPath.split("/"); var remainingPath = parts.slice(1).join("/"); var t = this.getTree(); if (sPath.charAt(0) == "/") { if (t) { t.openPath(remainingPath, bSelect, bFocus); } else { throw "Invalid path"; } } else { // open this.setExpanded(true); parts = sPath.split("/"); var ti = this.findChildByText(parts[0]); if (!ti) { throw "Could not find child node with text \"" + parts[0] + "\""; } ti.openPath(remainingPath, bSelect, bFocus); } }; _p.focus = function focus() { var el = this.getLabelElement(); if (el) { el.focus(); } }; _p.getFocused = function getFocused() { return this._focused; }; _p._setTabIndex = function _setTabIndex(i) { var a = this.getLabelElement(); if (a) { if (i == "") { a.removeAttribute("tabIndex"); } else { a.setAttribute("tabIndex", i); } } }; // HTML generation _p.toHtml = function toHtml() { var sb = []; var cs = this.childNodes; var l = cs.length; for (var y = 0; y < l; y++) { sb[y] = cs[y].toHtml(); } var t = this.getTree(); var hideLines = !t.getShowLines() || t == this.parentNode && !t.getShowRootLines(); return "<div class=\"webfx-tree-item\" id=\"" + this.id + "\"" + this.getEventHandlersHtml() + ">" + this.getRowHtml() + "<div class=\"webfx-tree-children" + (hideLines ? "-nolines" : "") + "\" style=\"" + this.getLineStyle() + (this.getExpanded() && this.hasChildren() ? "" : "display:none;") + "\">" + sb.join("") + "</div></div>"; }; _p.getRowHtml = function getRowHtml() { var t = this.getTree(); return "<div class=\"" + this.getRowClassName() + "\" style=\"padding-left:" + Math.max(0, (this.getDepth() - 1) * this.indentWidth) + "px\">" + this.getExpandIconHtml() + //"<span class=\"webfx-tree-icon-and-label\">" + this.getIconHtml() + this.getLabelHtml() + //"</span>" + "</div>"; }; _p.getRowClassName = function getRowClassName() { return "webfx-tree-row" + (this.isSelected() ? " selected" : "") + (this.action ? "" : " no-action"); }; _p.getLabelHtml = function getLabelHtml() { var toolTip = this.getToolTip(); var target = this.getTarget(); return "<a href=\"" + webFXTreeHandler.textToHtml(this._getHref()) + "\" class=\"webfx-tree-item-label\" tabindex=\"-1\"" + (toolTip ? " title=\"" + webFXTreeHandler.textToHtml(toolTip) + "\"" : "") + (target ? " target=\"" + target + "\"" : "") + " onfocus=\"webFXTreeHandler.handleEvent(event)\"" + " onblur=\"webFXTreeHandler.handleEvent(event)\">" + this.getHtml() + "</a>"; }; _p._getHref = function _getHref() { if (typeof this.action == "string") return this.action; else return "#"; }; _p.getEventHandlersHtml = function getEventHandlersHtml() { return ""; }; _p.getIconHtml = function getIconHtml() { // here we are not using textToHtml since the file names rarerly contains // HTML... return "<img class=\"webfx-tree-icon\" src=\"" + this.getIconSrc() + "\">"; }; _p.getIconSrc = function getIconSrc() { throw new Error("getIconSrc called on Abstract Node"); }; _p.getExpandIconHtml = function getExpandIconHtml() { // here we are not using textToHtml since the file names rarerly contains // HTML... return "<img class=\"webfx-tree-expand-icon\" src=\"" + this.getExpandIconSrc() + "\">"; }; _p.getExpandIconSrc = function getExpandIconSrc() { var src; var t = this.getTree(); var hideLines = !t.getShowLines() || t == this.parentNode && !t.getShowRootLines(); if (this.hasChildren()) { var bits = 0; /* Bitmap used to determine which icon to use 1 Plus 2 Minus 4 T Line 8 L Line */ if (t && t.getShowExpandIcons()) { if (this.getExpanded()) { bits = 2; } else { bits = 1; } } if (t && !hideLines) { if (this.isLastSibling()) { bits += 4; } else { bits += 8; } } switch (bits) { case 1: return webFXTreeConfig.plusIcon; case 2: return webFXTreeConfig.minusIcon; case 4: return webFXTreeConfig.lIcon; case 5: return webFXTreeConfig.lPlusIcon; case 6: return webFXTreeConfig.lMinusIcon; case 8: return webFXTreeConfig.tIcon; case 9: return webFXTreeConfig.tPlusIcon; case 10: return webFXTreeConfig.tMinusIcon; default: // 0 return webFXTreeConfig.blankIcon; } } else { if (t && hideLines) { return webFXTreeConfig.blankIcon; } else if (this.isLastSibling()) { return webFXTreeConfig.lIcon; } else { return webFXTreeConfig.tIcon; } } }; _p.getLineStyle = function getLineStyle() { return "background-position:" + this.getLineStyle2() + ";"; }; _p.getLineStyle2 = function getLineStyle2() { return (this.isLastSibling() ? "-100" : (this.getDepth() - 1) * this.indentWidth) + "px 0"; }; // End HTML generation // DOM // this returns the div for the tree node _p.getElement = function getElement() { return document.getElementById(this.id); }; // the row is the div that is used to draw the node without the children _p.getRowElement = function getRowElement() { var el = this.getElement(); if (!el) return null; return el.firstChild; }; // plus/minus image _p.getExpandIconElement = function getExpandIconElement() { var el = this.getRowElement(); if (!el) return null; return el.firstChild; }; _p.getIconElement = function getIconElement() { var el = this.getRowElement(); if (!el) return null; return el.childNodes[1]; }; // anchor element _p.getLabelElement = function getLabelElement() { var el = this.getRowElement(); if (!el) return null; return el.lastChild; }; // the div containing the children _p.getChildrenElement = function getChildrenElement() { var el = this.getElement(); if (!el) return null; return el.lastChild; }; // IE uses about:blank if not attached to document and this can cause Win2k3 // to fail if (webFXTreeHandler.ie) { _p.create = function create() { var dummy = document.createElement("div"); dummy.style.display = "none"; document.body.appendChild(dummy); dummy.innerHTML = this.toHtml(); var res = dummy.removeChild(dummy.firstChild); document.body.removeChild(dummy); return res; }; } else { _p.create = function create() { var dummy = document.createElement("div"); dummy.innerHTML = this.toHtml(); return dummy.removeChild(dummy.firstChild); }; } // Getters and setters for some common fields _p.setIcon = function setIcon(s) { this.icon = s; if (this.getCreated()) { this.updateIcon(); } }; _p.getIcon = function getIcon() { return this.icon; }; _p.setOpenIcon = function setOpenIcon(s) { this.openIcon = s; if (this.getCreated()) { this.updateIcon(); } }; _p.getOpenIcon = function getOpenIcon() { return this.openIcon; }; _p.setText = function setText(s) { this.setHtml(webFXTreeHandler.textToHtml(s)); }; _p.getText = function getText() { return webFXTreeHandler.htmlToText(this.getHtml()); }; _p.setHtml = function setHtml(s) { this.text = s; var el = this.getLabelElement(); if (el) { el.innerHTML = s; } }; _p.getHtml = function getHtml() { return this.text; }; _p.setTarget = function setTarget(s) { this.target = s; }; _p.getTarget = function getTarget() { return this.target; }; _p.setToolTip = function setToolTip(s) { this.toolTip = s; var el = this.getLabelElement(); if (el) { el.title = s; } }; _p.getToolTip = function getToolTip() { return this.toolTip; }; _p.setAction = function setAction(oAction) { this.action = oAction; var el = this.getLabelElement(); if (el) { el.href = this._getHref(); } el = this.getRowElement(); if (el) { el.className = this.getRowClassName(); } }; _p.getAction = function getAction() { return this.action; }; // update methods _p.update = function update() { var t = this.getTree(); if (t.suspendRedraw) return; var el = this.getElement(); if (!el || !el.parentNode) return; var newEl = this.create(); el.parentNode.replaceChild(newEl, el); this._setTabIndex(this.tabIndex); // in case root had the tab index var si = t.getSelected(); if (si && si.getFocused()) { si.focus(); } }; _p.updateExpandIcon = function updateExpandIcon() { var t = this.getTree(); if (t.suspendRedraw) return; var img = this.getExpandIconElement(); img.src = this.getExpandIconSrc(); var cel = this.getChildrenElement(); cel.style.backgroundPosition = this.getLineStyle2(); }; _p.updateIcon = function updateIcon() { var t = this.getTree(); if (t.suspendRedraw) return; var img = this.getIconElement(); if (img) { img.src = this.getIconSrc(); } }; // End DOM _p._callSuspended = function _callSuspended(f) { var t = this.getTree(); var sr = t.getSuspendRedraw(); t.setSuspendRedraw(true); f.call(this); t.setSuspendRedraw(sr); }; // Event handlers _p._onmousedown = function _onmousedown(e) { var el = e.target || e.srcElement; // expand icon if (/webfx-tree-expand-icon/.test(el.className) && this.hasChildren()) { this.toggle(); if (webFXTreeHandler.ie) { window.setTimeout("WebFXTreeAbstractNode._onTimeoutFocus(\"" + this.id + "\")", 10); } return false; } this.select(); if (/*!/webfx-tree-item-label/.test(el.className) && */!webFXTreeHandler.opera) { // opera cancels the click if focus is called // in case we are not clicking on the label if (webFXTreeHandler.ie) { window.setTimeout("WebFXTreeAbstractNode._onTimeoutFocus(\"" + this.id + "\")", 10); } else { this.focus(); } } var rowEl = this.getRowElement(); if (rowEl) { rowEl.className = this.getRowClassName(); } return false; }; _p._onclick = function _onclick(e) { var el = e.target || e.srcElement; // expand icon if (/webfx-tree-expand-icon/.test(el.className) && this.hasChildren()) { return false; } if (typeof this.action == "function") { this.action(); } else if (this.action != null) { window.open(this.action, this.target || "_self"); } return false; }; _p._ondblclick = function _ondblclick(e) { var el = e.target || e.srcElement; // expand icon if (/webfx-tree-expand-icon/.test(el.className) && this.hasChildren()) { return; } this.toggle(); }; _p._onfocus = function _onfocus(e) { this.select(); this._focused = true; }; _p._onblur = function _onblur(e) { this._focused = false; }; _p._onkeydown = function _onkeydown(e) { var n; var rv = true; switch (e.keyCode) { case 39: // RIGHT if (e.altKey) { rv = true; break; } if (this.hasChildren()) { if (!this.getExpanded()) { this.setExpanded(true); } else { this.getFirstChild().focus(); } } rv = false; break; case 37: // LEFT if (e.altKey) { rv = true; break; } if (this.hasChildren() && this.getExpanded()) { this.setExpanded(false); } else { var p = this.getParent(); var t = this.getTree(); // don't go to root if hidden if (p && (t.showRootNode || p != t)) { p.focus(); } } rv = false; break; case 40: // DOWN n = this.getNextShownNode(); if (n) { n.focus(); } rv = false; break; case 38: // UP n = this.getPreviousShownNode() if (n) { n.focus(); } rv = false; break; } if (!rv && e.preventDefault) { e.preventDefault(); } e.returnValue = rv; return rv; }; _p._onkeypress = function _onkeypress(e) { if (!e.altKey && e.keyCode >= 37 && e.keyCode <= 40) { if (e.preventDefault) { e.preventDefault(); } e.returnValue = false; return false; } }; // End event handlers _p.dispose = function dispose() { if (this.disposed) return; for (var i = this.childNodes.length - 1; i >= 0; i--) { this.childNodes[i].dispose(); } this.tree = null; this.parentNode = null; this.childNodes = null; this.disposed = true; }; // Some methods that are usable when navigating the tree using the arrows _p.getLastShownDescendant = function getLastShownDescendant() { if (!this.getExpanded() || !this.hasChildren()) { return this; } // we know there is at least 1 child return this.getLastChild().getLastShownDescendant(); }; _p.getNextShownNode = function getNextShownNode() { if (this.hasChildren() && this.getExpanded()) { return this.getFirstChild(); } else { var p = this; var next; while (p != null) { next = p.getNextSibling(); if (next != null) { return next; } p = p.getParent(); } return null; } }; _p.getPreviousShownNode = function getPreviousShownNode() { var ps = this.getPreviousSibling(); if (ps != null) { return ps.getLastShownDescendant(); } var p = this.getParent(); var t = this.getTree(); if (!t.showRootNode && p == t) { return null; } return p; }; /////////////////////////////////////////////////////////////////////////////// // WebFXTree /////////////////////////////////////////////////////////////////////////////// function WebFXTree(sText, oAction, sBehavior, sIcon, sOpenIcon) { WebFXTreeAbstractNode.call(this, sText, oAction); if (sIcon) this.icon = sIcon; if (sOpenIcon) this.openIcon = sOpenIcon; if (sBehavior) this.behavior = sBehavior; } _p = WebFXTree.prototype = new WebFXTreeAbstractNode; _p.indentWidth = 19; _p.open = true; _p._selectedItem = null; _p._fireChange = true; _p.rendered = false; _p.suspendRedraw = false; _p.showLines = true; _p.showExpandIcons = true; _p.showRootNode = true; _p.showRootLines = true; _p.getTree = function getTree() { return this; }; _p.getDepth = function getDepth() { return 0; }; _p.getCreated = function getCreated() { return this.rendered; }; /* end tree model */ _p.getExpanded = function getExpanded() { return !this.showRootNode || WebFXTreeAbstractNode.prototype.getExpanded.call(this); }; _p.setExpanded = function setExpanded(b) { if (!this.showRootNode) { this.open = b; } else { WebFXTreeAbstractNode.prototype.setExpanded.call(this, b); } }; _p.getExpandIconHtml = function getExpandIconHtml() { return ""; }; // we don't have an expand icon here _p.getIconElement = function getIconElement() { var el = this.getRowElement(); if (!el) return null; return el.firstChild; }; // no expand icon for root element _p.getExpandIconElement = function getExpandIconElement(oDoc) { return null; }; _p.updateExpandIcon = function updateExpandIcon() { // no expand icon }; _p.getRowClassName = function getRowClassName() { return WebFXTreeAbstractNode.prototype.getRowClassName.call(this) + (this.showRootNode ? "" : " webfx-tree-hide-root"); }; // if classic then the openIcon is used for expanded, otherwise openIcon is used // for selected _p.getIconSrc = function getIconSrc() { var behavior = this.getTree() ? this.getTree().getBehavior() : webFXTreeConfig.defaultBehavior; var open = behavior == "classic" && this.getExpanded() || behavior != "classic" && this.isSelected(); if (open && this.openIcon) { return this.openIcon; } if (!open && this.icon) { return this.icon; } // fall back on default icons return open ? webFXTreeConfig.openRootIcon : webFXTreeConfig.rootIcon; }; _p.getEventHandlersHtml = function getEventHandlersHtml() { return " onclick=\"return webFXTreeHandler.handleEvent(event)\" " + "onmousedown=\"return webFXTreeHandler.handleEvent(event)\" " + "ondblclick=\"return webFXTreeHandler.handleEvent(event)\" " + "onkeydown=\"return webFXTreeHandler.handleEvent(event)\" " + "onkeypress=\"return webFXTreeHandler.handleEvent(event)\""; }; _p.setSelected = function setSelected(o) { if (this._selectedItem != o && o) { o._setSelected(true); } }; _p._fireOnChange = function _fireOnChange() { if (this._fireChange && typeof this.onchange == "function") { this.onchange(); } }; _p.getSelected = function getSelected() { return this._selectedItem; }; _p.tabIndex = ""; _p.setTabIndex = function setTabIndex(i) { var n = this._selectedItem || (this.showRootNode ? this : this.firstChild); this.tabIndex = i; if (n) { n._setTabIndex(i); } }; _p.getTabIndex = function getTabIndex() { return this.tabIndex; }; _p.setBehavior = function setBehavior(s) { this.behavior = s; }; _p.getBehavior = function getBehavior() { return this.behavior || webFXTreeConfig.defaultBehavior; }; _p.setShowLines = function setShowLines(b) { if (this.showLines != b) { this.showLines = b; if (this.rendered) { this.update(); } } }; _p.getShowLines = function getShowLines() { return this.showLines; }; _p.setShowRootLines = function setShowRootLines(b) { if (this.showRootLines != b) { this.showRootLines = b; if (this.rendered) { this.update(); } } }; _p.getShowRootLines = function getShowRootLines() { return this.showRootLines; }; _p.setShowExpandIcons = function setShowExpandIcons(b) { if (this.showExpandIcons != b) { this.showExpandIcons = b; if (this.rendered) { this.getTree().update(); } } }; _p.getShowExpandIcons = function getShowExpandIcons() { return this.showExpandIcons; }; _p.setShowRootNode = function setShowRootNode(b) { if (this.showRootNode != b) { this.showRootNode = b; if (this.rendered) { this.getTree().update(); } } }; _p.getShowRoootNode = function getShowRoootNode() { return this.showRootNode; }; _p.onchange = function onchange() {}; _p.create = function create() { var el = WebFXTreeAbstractNode.prototype.create.call(this); this.setTabIndex(this.tabIndex); this.rendered = true; return el; }; _p.write = function write() { document.write(this.toHtml()); this.setTabIndex(this.tabIndex); this.rendered = true; }; _p.setSuspendRedraw = function setSuspendRedraw(b) { this.suspendRedraw = b; }; _p.getSuspendRedraw = function getSuspendRedraw() { return this.suspendRedraw; }; /////////////////////////////////////////////////////////////////////////////// // WebFXTreeItem /////////////////////////////////////////////////////////////////////////////// function WebFXTreeItem(sText, oAction, eParent, sIcon, sOpenIcon) { WebFXTreeAbstractNode.call(this, sText, oAction); if (sIcon) this.icon = sIcon; if (sOpenIcon) this.openIcon = sOpenIcon; if (eParent) eParent.add(this); } _p = WebFXTreeItem.prototype = new WebFXTreeAbstractNode; _p.tree = null; /* tree model */ _p.getDepth = function getDepth() { if (this.depth != null) { return this.depth; } if (this.parentNode) { var pd = this.parentNode.getDepth(); return this.depth = (pd != null ? pd + 1 : null); } return null; }; _p.getTree = function getTree() { if (this.tree) { return this.tree; } if (this.parentNode) { return this.tree = this.parentNode.getTree(); } return null; }; _p.getCreated = function getCreated() { var t = this.getTree(); return t && t.getCreated(); }; // if classic then the openIcon is used for expanded, otherwise openIcon is used // for selected _p.getIconSrc = function getIconSrc() { var behavior = this.getTree() ? this.getTree().getBehavior() : webFXTreeConfig.defaultBehavior; var open = behavior == "classic" && this.getExpanded() || behavior != "classic" && this.isSelected(); if (open && this.openIcon) { return this.openIcon; } if (!open && this.icon) { return this.icon; } // fall back on default icons if (this.hasChildren()) { return open ? webFXTreeConfig.openFolderIcon : webFXTreeConfig.folderIcon; } return webFXTreeConfig.fileIcon; }; /* end tree model */ if (window.attachEvent) { window.attachEvent("onunload", function () { for (var id in webFXTreeHandler.all) webFXTreeHandler.all[id].dispose(); }); }
100gd-compare
trunk/WebContent/components/xtree/js/xtree2.js
JavaScript
epl
38,572
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title></title> <!-- The xtree script file --> <script src="js/xtree2.js"></script> <!-- Modify this file to change the way the tree looks --> <link type="text/css" rel="stylesheet" href="css/xtree2.css"> <style> body { background: white; color: black; } input { width: 120px; } </style> </head> <body> <div style="position: absolute; width: 200px; top: 0px; left: 0px; height: 100%; padding: 5px; overflow: auto;"> <!-- js file containing the tree content, edit this file to alter the menu, the menu will be inserted where this tag is located in the document --> <script src="js/tree.v1.js"></script> </div> <div style="position: absolute; left: 205px; top: 10px;"> <p> This tree works just as the one found in the Microsoft Windows Explorer, expand/collapse a tree item by double click on the icon or by single click on the plus/minus symbol.<br/>Buttons below bound to the tree root. </p> <p> This is the method thats called when you click on a tree item.<br/> <input type="button" value="toggle()" onclick="tree.toggle();"> </p> <p> Pretty self explaining, expands or collapses the current item.<br/> <input type="button" value="expand()" onclick="tree.expand();"> <input type="button" value="collapse()" onclick="tree.collapse();"> </p> <p> Expands or collapses the current item and all child items (recursive).<br/> <input type="button" value="expandAll()" onclick="tree.expandAll();"> <input type="button" value="collapseAll()" onclick="tree.collapseAll();"> </p> <p> Expands or collapses all child items (recursive) but not the item itself.<br/> <input type="button" value="expandChildren()" onclick="tree.expandChildren();"> <input type="button" value="collapseChildren()" onclick="tree.collapseChildren();"> </p> <p> Returns the id of the selected item (if any)<br/> <input type="button" value="alert(tree.getSelected().id);" onclick="if (tree.getSelected()) { alert(tree.getSelected().id); }" style="width: 245px;"> </p> <p> Add node(s) below selected, or remove the selected node.<br/> <input type="button" onclick="addNode();" style="width: 80px;" value="Add one" /> <input type="button" onclick="addNodes();" style="width: 80px;" value="Add multiple" /> <input type="button" onclick="delNode();" style="width: 80px;" value="Remove" /> </p> </div> </body> <script> function addNode() { if (tree.getSelected()) { tree.getSelected().add(new WebFXTreeItem('New')); } } function addNodes() { if (tree.getSelected()) { var foo = tree.getSelected().add(new WebFXTreeItem('New')); var bar = foo.add(new WebFXTreeItem('Sub 1')); var fbr = foo.add(new WebFXTreeItem('Sub 2')); } } function delNode() { if (tree.getSelected()) { tree.getSelected().remove(); } } </script> </html>
100gd-compare
trunk/WebContent/components/xtree/demo.v1.html
HTML
epl
2,870
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <title>XLoadTree Demo (WebFX)</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script type="text/javascript" src="js/xtree2.js"></script> <script type="text/javascript" src="js/xloadtree2.js"></script> <link type="text/css" rel="stylesheet" href="css/xtree2.css" /> <style type="text/css"> body { background: white; color: black; } </style> </head> <body> <p><button onclick="rti.reload()">Reload Item</button></p> <p><button onclick="tree.openPath( '/Tree Item 2/Load treeLARGE.xml/Loaded Item 70', true, true )">Open /Tree Item 2/Load treeLARGE.xml/Loaded Item 70</button></p> <p><button onclick="tree.openPath( '/Tree Item 2/Loaded Item 2/Loaded Item 2.1', true )">Open /Tree Item 2/Loaded Item 2/Loaded Item 2.1</button></p> <p><button onclick="tree.openPath( '/Tree Item 2/Deep nesting/0/1/2/3/4/5/6/7/8/9/10', true )">Open /Tree Item 2/Deep nesting/0/1/2/3/4/5/6/7/8/9/10</button></p> <script type="text/javascript"> var rti; var tree = new WebFXTree("Root"); tree.add(new WebFXTreeItem("Tree Item 1")); tree.add(new WebFXLoadTreeItem("Tree Item 2", "tree.xml")); tree.add(rti = new WebFXLoadTreeItem("Tree Item 3 (Reload)", "date.xml.pl")); tree.add(new WebFXTreeItem("Tree Item 4")); tree.write(); t = tree; </script> </body> </html>
100gd-compare
trunk/WebContent/components/xtree/xloaddemo.html
HTML
epl
1,455
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>xTree API 2 (WebFX)</title> <!-- WebFX Layout Include --> <script type="text/javascript" src="../../webfxlayout.js"></script> <script type="text/javascript" src="../../webfxapi.js"></script> <!-- end WebFX Layout Includes --> <style type="text/css"> table { width: 500px; } td { vertical-align: top; } </style> </head> <body> <!-- WebFX Layout Include --> <script type="text/javascript"> /* var articleMenu= new WebFXMenu; articleMenu.left = 384; articleMenu.top = 86; articleMenu.width = 140; articleMenu.add(new WebFXMenuItem("History & Introduction", "index.html")); articleMenu.add(new WebFXMenuItem("Usage", "usage.html")); articleMenu.add(new WebFXMenuItem("API", "api.html")); articleMenu.add(new WebFXMenuItem("Implementation", "implementation.html")); articleMenu.add(new WebFXMenuItem("Demo", "javascript:window.open('demo.html','demo','scrollbars=yes,status=no,width=500,height=400,resizable=yes'); void(0);")); articleMenu.add(new WebFXMenuSeparator); articleMenu.add(new WebFXMenuItem("Download", "http://webfx.eae.net/download/xtree117.zip")); webfxMenuBar.add(new WebFXMenuButton("Article Menu", null, null, articleMenu)); */ webfxLayout.writeTitle("xTree2 API"); webfxLayout.writeMenu(); webfxLayout.writeDesignedByEdger(); </script> <div class="webfx-main-body"> <!-- end WebFX Layout Includes --> <h2 id="WebFXLoadTree">WebFXLoadTree</h2><p>This class extends <code><a href="#WebFXTree">WebFXTree</a></code> and therefore all methods and field available for <code><a href="#WebFXTree">WebFXTree</a></code> are also available for <code>WebFXLoadTree</code>.</p><p> This tree can be used to dynamically load an XML file that describes the tree. </p><h3>Syntax</h3><p><code> new WebFXLoadTree(<span class="methodArgument">sText</span>, <span class="methodArgument">sXmlSrc</span>, <span class="methodArgument">oAction</span>, <span class="methodArgument">sBehavior</span>, <span class="methodArgument">sIcon</span>, <span class="methodArgument">sOpenIcon</span>)</code></p><h3>Parameters</h3><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td><code>sText</code></td><td><code></code></td><td> The text (HTML) to show as a label for the tree item </td></tr><tr><td><code>sXmlSrc</code></td><td><code></code></td><td> The URI to XML file describing the items in this tree node </td></tr><tr><td><code>oAction</code></td><td><code></code></td><td> The action to do when the node is activated. If this is String then it is treated as an URL but you can also pass a Function object which will be called when activated. </td></tr><tr><td><code>sBehavior</code></td><td><code></code></td><td> This is used to decide when to show the open icon for folders. Supported values are "classic" and "explorer". When this is "explorer" selected folders show the open icon. For "classic" the open icon is shown for expanded folders. </td></tr><tr><td><code>sIcon</code></td><td><code></code></td><td>The image to use as icon</td></tr><tr><td><code>sOpenIcon</code></td><td><code></code></td><td>The image to use as open icon</td></tr></tbody></table><h3>Static Methods</h3><table><thead><tr><td>Name</td><td>Description</td></tr></thead><tbody> <tr><td><a name="createItemFromElement"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">createItemFromElement</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.createItemFromElement(<span class="methodArgument">oNode</span>)</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td><code>oNode</code></td><td><code></code></td><td> The XML element that describes the tree node. </td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> This static method takes an XML element and returns a WebFXAbstractNode </td></tr> <tr><td><a name="loadXmlDocument"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">loadXmlDocument</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.loadXmlDocument(<span class="methodArgument">jsNode</span>)</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td><code>jsNode</code></td><td><code></code></td><td> The load tree node that we want to load the document for. </td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> This starts loading of an XML document associated with a tree node. </td></tr> <tr><td><a name="documentLoaded"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">documentLoaded</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.documentLoaded(<span class="methodArgument">jsNode</span>)</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td><code>jsNode</code></td><td><code></code></td><td> The load tree node that we loaded the document for. </td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> This is called once the document for a tree node has loaded </td></tr> </tbody></table><h3>Static Fields</h3><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td colspan="3">None.</td></tr></tbody></table><h3>Methods</h3><table><thead><tr><td>Name</td><td>Description</td></tr></thead><tbody><tr><td><a name="getSrc"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">getSrc</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.getSrc()</code></p><h4>Arguments</h4><p>No Arguments.</p><h4>Return Type</h4><p><code>void</code></p></div></div></td><td>Returns the URI to the XML file</td></tr><tr><td><a name="reload"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">reload</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.reload()</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td></td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> Reloads the XML file and rebuilds the tree. If the XML file is cached (and the HTTP headers don't require the file to be refetched) the file will be taken from the cache. </td></tr><tr><td><a name="setSrc"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">setSrc</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.setSrc()</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td></td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td>Sets the URI to the XML file</td></tr></tbody></table><h3>Fields</h3><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td colspan="3">None.</td></tr></tbody></table><h3>Events</h3><table><thead><tr><td>Name</td><td>Descripton</td></tr></thead><tbody><tr><td colspan="2">None.</td></tr></tbody></table><h3>Remarks</h3><p> None. </p><h2 id="WebFXLoadTreeItem">WebFXLoadTreeItem</h2><p>This class extends <code><a href="#WebFXTreeItem">WebFXTreeItem</a></code> and therefore all methods and field available for <code><a href="#WebFXTreeItem">WebFXTreeItem</a></code> are also available for <code>WebFXLoadTreeItem</code>.</p><p> This tree item can be used to dynamically load an XML file that describes the sub tree of the item. </p><h3>Syntax</h3><p><code> new WebFXLoadTreeItem(<span class="methodArgument">sText</span>, <span class="methodArgument">sXmlSrc</span>, <span class="methodArgument">oAction</span>, <span class="methodArgument">eParent</span>, <span class="methodArgument">sIcon</span>, <span class="methodArgument">sOpenIcon</span>)</code></p><h3>Parameters</h3><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td><code>sText</code></td><td><code></code></td><td> The text (HTML) to show as a label for the tree item </td></tr><tr><td><code>sXmlSrc</code></td><td><code></code></td><td> The URI to XML file describing the items in this tree node </td></tr><tr><td><code>oAction</code></td><td><code></code></td><td> The action to do when the node is activated. If this is String then it is treated as an URL but you can also pass a Function object which will be called when activated. </td></tr><tr><td><code>eParent</code></td><td><code></code></td><td> Optional parent tree item. If provided then the item will be added as a child to eParent </td></tr><tr><td><code>sIcon</code></td><td><code></code></td><td>The image to use as icon</td></tr><tr><td><code>sOpenIcon</code></td><td><code></code></td><td>The image to use as open icon</td></tr></tbody></table><h3>Static Methods</h3><table><thead><tr><td>Name</td><td>Description</td></tr></thead><tbody><tr><td colspan="2">None.</td></tr></tbody></table><h3>Static Fields</h3><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td colspan="3">None.</td></tr></tbody></table><h3>Methods</h3><table><thead><tr><td>Name</td><td>Description</td></tr></thead><tbody><tr><td><a name="getSrc"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">getSrc</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.getSrc()</code></p><h4>Arguments</h4><p>No Arguments.</p><h4>Return Type</h4><p><code>void</code></p></div></div></td><td>Returns the URI to the XML file</td></tr><tr><td><a name="reload"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">reload</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.reload()</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td></td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td> Reloads the XML file and rebuilds the tree. If the XML file is cached (and the HTTP headers don't require the file to be refetched) the file will be taken from the cache. </td></tr><tr><td><a name="setSrc"></a><a class="helpLink" href="javascript://" onclick="toggleMethodArguments( event, this ); return false;">setSrc</a><div class="methodContainer"><div class="methodInfo"><h4>Syntax</h4><p><code><span class="object">object</span>.setSrc()</code></p><h4>Arguments</h4><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td></td></tr></tbody></table><h4>Return Type</h4><p><code>void</code></p></div></div></td><td>Sets the URI to the XML file</td></tr></tbody></table><h3>Fields</h3><table><thead><tr><td>Name</td><td>Type</td><td>Descripton</td></tr></thead><tbody><tr><td colspan="3">None.</td></tr></tbody></table><h3>Events</h3><table><thead><tr><td>Name</td><td>Descripton</td></tr></thead><tbody><tr><td colspan="2">None.</td></tr></tbody></table><h3>Remarks</h3><p> None. </p> <!-- end webfx-main-body --> </div> </body> </html>
100gd-compare
trunk/WebContent/components/xtree/api.xloadtree2.html
HTML
epl
11,904
#!/usr/bin/perl # # This file uses ETP which can be found at # http://perl.eae.net/etp/ # use lib "../../.."; use Etp; PrintOutput(); sub PrintOutput() { my $etp = new Etp(); print("Content-Type: text/xml; charset=UTF-8\n"); print("Cache-Control: no-cache\n"); print("Last-Modified: " . $etp->getDate(0, 3) . "\n"); print("\n"); print("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"); print("<tree><tree text=\"" . $etp->getDate(0, 3) . "\"/></tree>\n"); }
100gd-compare
trunk/WebContent/components/xtree/date.xml.pl
Perl
epl
466
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>XTree 2 Demo</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <link type="text/css" rel="stylesheet" href="css/xtree2.links.css"> <script type="text/javascript" src="js/xtree2.js"></script> <script type="text/javascript" src="js/xloadtree2.js"></script> </head> <body> <script type="text/javascript"> var tree = new WebFXLoadTree("Hello World", "tree.xml"); tree.write(); </script> </body> </html>
100gd-compare
trunk/WebContent/components/xtree/xloadtreedemo.html
HTML
epl
571
.webfx-tree-row { /* line-height: 16px; height: 16px; */ white-space: nowrap; font: icon; } .webfx-tree-row span { /* display: inline-block; height: 16px; line-height: 16px; */ overflow: hidden; text-overflow: ellipsis; } .webfx-tree-children { background-repeat: repeat-y; background-image: url("../images/I.png") !important; background-position-y: 1px !important; /* IE only */ font: icon; } .webfx-tree-children-nolines { font: icon; } .webfx-tree-row img { vertical-align: middle; height: 16px; } .webfx-tree-icon { width: 16px; cursor: hand; cursor: pointer; } .webfx-tree-expand-icon { width: 19px; } .webfx-tree-item-label { margin-left: 3px; padding: 1px 2px 1px 2px; } .selected .webfx-tree-item-label:hover, .selected .webfx-tree-item-label { background: ThreeDFace; } .selected .webfx-tree-item-label:focus:hover, .selected .webfx-tree-item-label:focus, .selected .webfx-tree-item-label:active:hover, .selected .webfx-tree-item-label:active { background: Highlight !important; color: HighlightText !important; } .webfx-tree-item-label { /*-moz-border-radius: 4px;*/ /*border: 1px solid transparent;*/ } .webfx-tree-hide-root { display: none; } .no-action .webfx-tree-item-label, .no-action .webfx-tree-item-label:hover, .no-action img { color: WindowText; text-decoration: none; cursor: default; }
100gd-compare
trunk/WebContent/components/xtree/css/xtree2.links.css
CSS
epl
1,477
.webfx-tree-row { /* line-height: 16px; height: 16px; */ white-space: nowrap; font: icon; } .webfx-tree-row span { /* display: inline-block; height: 16px; line-height: 16px; */ overflow: hidden; text-overflow: ellipsis; } .webfx-tree-children { background-repeat: repeat-y; background-image: url("../images/I.png") !important; background-position-y: 1px !important; /* IE only */ font: icon; } .webfx-tree-children-nolines { font: icon; } .webfx-tree-row img { vertical-align: middle; height: 16px; } .webfx-tree-icon { width: 16px; cursor: hand; cursor: pointer; } .webfx-tree-expand-icon { width: 19px; } .webfx-tree-item-label { margin-left: 3px; padding: 1px 2px 1px 2px; text-decoration: none; color: WindowText; } .webfx-tree-item-label:hover { text-decoration: underline; color: blue; } .selected .webfx-tree-item-label:hover, .selected .webfx-tree-item-label { background: ThreeDFace; } .selected .webfx-tree-item-label:focus:hover, .selected .webfx-tree-item-label:focus, .selected .webfx-tree-item-label:active:hover, .selected .webfx-tree-item-label:active { background: Highlight; color: HighlightText; } .webfx-tree-item-label { /*-moz-border-radius: 4px;*/ /*border: 1px solid transparent;*/ } .webfx-tree-hide-root { display: none; }
100gd-compare
trunk/WebContent/components/xtree/css/xtree2.css
CSS
epl
1,417
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>xTree 2 Beta</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <!-- WebFX Layout Include --> <script type="text/javascript" src="../../webfxlayout.js"></script> <!-- end WebFX Layout Includes --> <style type="text/css"> .links { padding: 0; margin: 10px; } .links li { display: inline; padding-right: 1ex; } </style> </head> <body> <!-- WebFX Layout Include --> <script type="text/javascript"> try { webfxLayout.writeTitle("xTree 2 Beta"); webfxLayout.writeMenu(); webfxLayout.writeDesignedByEdger(); } catch (ex) {} </script> <div class="webfx-main-body"> <!-- end WebFX Layout Includes --> <ul class="links"> <li><a href="requirements.txt">requirements.txt</a></li> <li><a href="demo.html">demo.html</a></li> <li><a href="demo.v1.html">demo.v1.html</a></li> <li><a href="xloaddemo.html">xloaddemo.html</a></li> <li><a href="xloadtreedemo.html">xloadtreedemo.html</a></li> </ul> <h2>Better Keyboard Navigation</h2> <p class="date">2005-06-06</p> <p>Now only one item has tabIndex set so that the entier tree only takes up one entry in the tab focus chain.</p> <h2>API Docs uploaded</h2> <p class="date">2005-01-04</p> <p>All methods and fields are now documented</p> <ul> <li><a href="api.html">api.html</a></li> <li><a href="api.xloadtree2.html">api.xloadtree2.html</a></li> </ul> <h2>Minor Updates</h2> <p class="date">2004-11-16</p> <p>Fixed an issue with focus in IE.</p> <p><code>findChildByText</code> now takes an optional second argument telling which child to return if more than one child is found. Another similar method called <code>findNodeByText</code> searches for the node amongst the current node and all its descendants. These 2 methods alsp accepts a regular expresion instead of a string.</p> <h2>Welcome to the beta of xTree 2</h2> <p class="date">2004-11-13</p> <p>This has been long in the making and it has been a collaboration between me and Emil. The implementation of xTree 2 and xLoadTree 2 are now feature complete. There are still plenty of things to do:</p> <ul> <li>Write API docs</li> <li>Write article</li> <li>Create better demos</li> <li>Ensure that all the requirements are fulfilled</li> <li>Make sure that there are no serious/obvious bugs/issues.</li> </ul> <h3>Requirements</h3> <p>Take a look at <a href="requirements.txt">requirements.txt</a>. There are still some open items but these are mostly open because they need to be verified and further tested.</p> <p>We are interested in feedback regarding what platforms this currently runs on.</p> <h3>Backwards Compatibility</h3> <p>Version 2 is mostly backwards compatible. If you can find any cases where your app worked using 1.x but not using xTree 2 beta (or xLoadTree) please notify us.</p> <p class="author">Author: Erik Arvidsson</p> <!-- end webfx-main-body --> </div> </body> </html>
100gd-compare
trunk/WebContent/components/xtree/readme.html
HTML
epl
3,109
#!/usr/bin/perl # # This file uses ETP which can be found at # http://perl.eae.net/etp/ # use lib "../../.."; use Etp; PrintOutput(); sub PrintOutput() { my $etp = new Etp(); $etp->parseInput(); my $counter = $etp->getInput('counter') || 0; print("Content-Type: text/xml; charset=UTF-8\n"); print("Cache-Control: no-cache\n"); print("Last-Modified: " . $etp->getDate(0, 3) . "\n"); print("\n"); print("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"); print("<tree><tree text=\"" . $counter . "\" src=\"nest.xml.pl?counter=" . ($counter + 1) . "\"/></tree>\n"); }
100gd-compare
trunk/WebContent/components/xtree/nest.xml.pl
Perl
epl
578
<%@ page contentType="text/html;charset=GBK"%> <SCRIPT LANGUAGE="JavaScript"> <!-- var contextPath = "${ctx}"; //--> </SCRIPT> <link rel="StyleSheet" href="${ctx}/components/dtree/dtree.css" type="text/css" /> <script type="text/javascript" src="${ctx}/components/dtree/dtree.js"></script>
100gd-compare
trunk/WebContent/components/dtree/index.jsp
Java Server Pages
epl
299
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <title>Destroydrop &raquo; Javascripts &raquo; Tree &raquo; Api</title> <meta http-equiv="content-type" content="text/html;charset=iso-8859-1" /> <link rel="stylesheet" href="/dd.css" type="text/css" /> <link rel="shortcut icon" href="/favicon.ico" /> </head> <body> <div id="shadow"> <div id="content"> <div id="location"> <h1><a href="/">Destroydrop</a> &raquo; <a href="/javascripts/">Javascripts</a> &raquo; <a href="/javascripts/tree/">Tree</a> &raquo; <a href="/javascripts/tree/api/">Api</a></h1> </div> <div class="line"></div> <div id="files"> <h3>Overview</h3> <div class="line"></div> <div class="item"> <ul class="arrow"> <li><a href="#functions">Functions</a> <ul class="arrow"> <li><a href="#add">add</a></li> <li><a href="#openall">openAll</a></li> <li><a href="#closeall">closeAll</a></li> <li><a href="#opento">openTo</a></li> </ul> </li> <li><a href="#configuration">Configuration</a></li> </ul> </div> <a name="functions"></a> <h3>Functions</h3> <div class="line"></div> <div class="item"> <a name="add"></a> <h4 class="func">add()</h4> <p>Adds a node to the tree.<br />Can only be called before the tree is drawn.</p> <p>id, pid and name are required.</p> <h4>Parameters</h4> <table class="files"> <tr> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr> <td>id</td> <td>Number</td> <td>Unique identity number.</td> </tr> <tr> <td>pid</td> <td>Number</td> <td>Number refering to the parent node. The value for the root node has to be -1.</td> </tr> <tr> <td>name</td> <td>String</td> <td>Text label for the node.</td> </tr> <tr> <td>url</td> <td>String</td> <td>Url for the node.</td> </tr> <tr> <td>title</td> <td>String</td> <td>Title for the node.</td> </tr> <tr> <td>target</td> <td>String</td> <td>Target for the node.</td> </tr> <tr> <td>icon</td> <td>String</td> <td>Image file to use as the icon. Uses default if not specified.</td> </tr> <tr> <td>iconOpen</td> <td>String</td> <td>Image file to use as the open icon. Uses default if not specified.</td> </tr> <tr> <td>open</td> <td>Boolean</td> <td>Is the node open.</td> </tr> </table> <br /> <h4>Example</h4> <p><code>mytree.add(1, 0, 'My node', 'node.html', 'node title', 'mainframe', 'img/musicfolder.gif');</code></p> <br /> <a name="openall"></a> <h4 class="func">openAll()</h4> <p>Opens all the nodes.<br />Can be called before and after the tree is drawn.</p> <h4>Example</h4> <p><code>mytree.openAll();</code></p> <br /> <a name="closeall"></a> <h4 class="func">closeAll()</h4> <p>Closes all the nodes.<br />Can be called before and after the tree is drawn.</p> <h4>Example</h4> <p><code>mytree.closeAll();</code></p> <br /> <a name="opento"></a> <h4 class="func">openTo()</h4> <p>Opens the tree to a certain node and can also select the node.<br /> Can only be called after the tree is drawn.</p> <h4>Parameters</h4> <table class="files"> <tr> <th>Name</th> <th>Type</th> <th>Description</th> </tr> <tr> <td>id</td> <td>Number</td> <td>Identity number for the node.</td> </tr> <tr> <td>select</td> <td>Boolean</td> <td>Should the node be selected.</td> </tr> </table> <h4>Example</h4> <p><code>mytree.openTo(4, true);</code></p> </div> <a name="configuration"></a> <h3>Configuration</h3> <div class="line"></div> <div class="item"> <table class="files"> <tr> <th>Variable</th> <th>Type</th> <th>Default</th> <th>Description</th> </tr> <tr> <td>target</td> <td>String</td> <td>true</td> <td>Target for all the nodes.</td> </tr> <tr> <td>folderLinks</td> <td>Boolean</td> <td>true</td> <td>Should folders be links.</td> </tr> <tr> <td>useSelection</td> <td>Boolean</td> <td>true</td> <td>Nodes can be selected(highlighted).</td> </tr> <tr> <td>useCookies</td> <td>Boolean</td> <td>true</td> <td>The tree uses cookies to rember it's state.</td> </tr> <tr> <td>useLines</td> <td>Boolean</td> <td>true</td> <td>Tree is drawn with lines.</td> </tr> <tr> <td>useIcons</td> <td>Boolean</td> <td>true</td> <td>Tree is drawn with icons.</td> </tr> <tr> <td>useStatusText</td> <td>Boolean</td> <td>false</td> <td>Displays node names in the statusbar instead of the url.</td> </tr> <tr> <td>closeSameLevel</td> <td>Boolean</td> <td>false</td> <td>Only one node within a parent can be expanded at the same time. openAll() and closeAll() functions do not work when this is enabled.</td> </tr> <tr> <td>inOrder</td> <td>Boolean</td> <td>false</td> <td>If parent nodes are always added before children, setting this to true speeds up the tree.</td> </tr> </table> <h4>Example</h4> <p><code>mytree.config.target = "mytarget";</code></p> </div> </div> <div class="line"></div> <div id="copy"> <p class="right"><a href="http://validator.w3.org/check/referer">XHTML</a>, <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a></p> <p><a href="mailto&#58;drop&#64;destroydrop&#46;com">&copy;2002-2003 Geir Landr&ouml;</a></p> </div> </div> </div> </body> </html>
100gd-compare
trunk/WebContent/components/dtree/api.html
HTML
epl
5,566
<html> <head> <meta http-equiv="content-type" content="text/xml; charset=utf-8" /> <title>My97DatePicker</title> <script type="text/javascript" src="config.js"></script> <script> var $d, $dp, $pdp = parent.$dp, $dt, $tdt, $sdt, $lastInput, $IE=$pdp.ie, $FF = $pdp.ff,$OPERA=$pdp.opera, $ny, $cMark = false; if ($pdp.eCont) { $dp = {}; for (var p in $pdp) { $dp[p] = $pdp[p]; } } else $dp = $pdp; $dp.realLang = getCurr(langList, $dp.lang); document.write("<script src='lang/" + $dp.realLang.name + ".js' charset='" + $dp.realLang.charset + "'><\/script>"); for (var i = 0; i < skinList.length; i++) { document.write('<link rel="stylesheet" type="text/css" href="skin/' + skinList[i].name + '/datepicker.css" title="' + skinList[i].name + '" charset="' + skinList[i].charset + '" disabled="true"/>'); } function getCurr(arr, name){ var isFound = false; var item = arr[0]; for (var i = 0; i < arr.length; i++) { if (arr[i].name == name) { item = arr[i]; break; } } return item; } </script> <script type="text/javascript" src="calendar.js"></script> </head> <body leftmargin="0" topmargin="0" onload="$c.autoSize()"> </body> </html> <script>new My97DP();</script>
100gd-compare
trunk/WebContent/components/DatePicker/My97DatePicker.htm
HTML
epl
1,228
.Wdate{ border:#999 1px solid; height:20px; background:#fff url(datePicker.gif) no-repeat right; } .WdateFmtErr{ font-weight:bold; color:red; }
100gd-compare
trunk/WebContent/components/DatePicker/skin/WdatePicker.css
CSS
epl
158
var langList = [ {name:'en', charset:'UTF-8'}, {name:'zh-cn', charset:'gb2312'}, {name:'zh-tw', charset:'GBK'} ]; var skinList = [ {name:'default', charset:'gb2312'}, {name:'whyGreen', charset:'gb2312'} ];
100gd-compare
trunk/WebContent/components/DatePicker/config.js
JavaScript
epl
225
var $lang={ errAlertMsg: "Invalid date or the date out of range,redo or not?", aWeekStr: ["wk", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], aMonStr: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], clearStr: "Clear", todayStr: "Today", okStr: "OK", updateStr: "OK", timeStr: "Time", quickStr: "Quick Selection", err_1: 'MinDate Cannot be bigger than MaxDate!' }
100gd-compare
trunk/WebContent/components/DatePicker/lang/en.js
JavaScript
epl
415
<%@ page contentType="text/html;charset=GBK"%> <%@ include file="/login/common/common_taglibs.jsp" %> <html> <head> <%@ include file="/login/common/head_common_element.jsp"%> </head> <frameset cols="260,*" frameborder="no" border="1" framespacing="0" > <frame src="${ctx}/cms/article/show.do?method=tree" name="leftFrame" id="leftFrame"/> <frame src="${ctx}/cms/article/show.do?method=list&menuId=0" name="mainFrame" id="mainFrame" /> </frameset> <noframes> <body> </body> </html>
100gd-compare
trunk/WebContent/login/cms/cms_article_show_index.jsp
Java Server Pages
epl
504