This repository has been archived by the owner on Aug 15, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added fckeditor to content section edit page
- Loading branch information
Josh Adams
committed
Sep 7, 2008
1 parent
07b18dc
commit ea48385
Showing
1,150 changed files
with
184,231 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<h1>Editing Content Section</h1> | ||
<% form_for :content_section, :url => content_section_path(@content_section), :html => { :method => :put } do |f| -%> | ||
<%= f.text_field(:name) -%><br /> | ||
<%= f.text_area(:contents) -%><br /> | ||
<%= fckeditor_textarea(:content_section, :contents, :toolbarSet => 'Simple', :width => '100%', :height => '400px') -%><br /> | ||
<%= submit_tag("Update Content Section") -%> | ||
<% end -%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
db/migrate/20080907232248_add_version_to_content_sections.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
class AddVersionToContentSections < ActiveRecord::Migration | ||
def self.up | ||
create_table :content_section_versions do |t| | ||
t.integer :content_section_id, :version, :author_id | ||
t.string :name | ||
t.text :contents | ||
t.timestamps | ||
end | ||
add_column :content_sections, :version, :integer, :default => 1 | ||
end | ||
|
||
def self.down | ||
remove_column :content_sections, :version | ||
drop_table :content_section_versions | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// CHANGE FOR APPS HOSTED IN SUBDIRECTORY | ||
FCKRelativePath = ''; | ||
|
||
// DON'T CHANGE THESE | ||
FCKConfig.LinkBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Connector='+FCKRelativePath+'/fckeditor/command'; | ||
FCKConfig.ImageBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Image&Connector='+FCKRelativePath+'/fckeditor/command'; | ||
FCKConfig.FlashBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Flash&Connector='+FCKRelativePath+'/fckeditor/command'; | ||
|
||
FCKConfig.LinkUploadURL = FCKRelativePath+'/fckeditor/upload'; | ||
FCKConfig.ImageUploadURL = FCKRelativePath+'/fckeditor/upload?Type=Image'; | ||
FCKConfig.FlashUploadURL = FCKRelativePath+'/fckeditor/upload?Type=Flash'; | ||
FCKConfig.SpellerPagesServerScript = FCKRelativePath+'/fckeditor/check_spelling'; | ||
FCKConfig.AllowQueryStringDebug = false; | ||
FCKConfig.SpellChecker = 'SpellerPages'; | ||
|
||
// ONLY CHANGE BELOW HERE | ||
FCKConfig.SkinPath = FCKConfig.BasePath + 'skins/silver/'; | ||
|
||
FCKConfig.ToolbarSets["Simple"] = [ | ||
['Source','-','-','Templates'], | ||
['Cut','Copy','Paste','PasteWord','-','Print','SpellCheck'], | ||
['Undo','Redo','-','Find','Replace','-','SelectAll'], | ||
'/', | ||
['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'], | ||
['OrderedList','UnorderedList','-','Outdent','Indent'], | ||
['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'], | ||
['Link','Unlink'], | ||
'/', | ||
['Image','Table','Rule','Smiley'], | ||
['FontName','FontSize'], | ||
['TextColor','BGColor'], | ||
['-','About'] | ||
] ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
<!-- | ||
* FCKeditor - The text editor for Internet - http://www.fckeditor.net | ||
* Copyright (C) 2003-2008 Frederico Caldeira Knabben | ||
* | ||
* == BEGIN LICENSE == | ||
* | ||
* 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 | ||
* | ||
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") | ||
* http://www.gnu.org/licenses/lgpl.html | ||
* | ||
* - Mozilla Public License Version 1.1 or later (the "MPL") | ||
* http://www.mozilla.org/MPL/MPL-1.1.html | ||
* | ||
* == END LICENSE == | ||
--> | ||
<html xmlns="http://www.w3.org/1999/xhtml"> | ||
<head> | ||
<title>FCKeditor - Documentation</title> | ||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | ||
<style type="text/css"> | ||
body { font-family: arial, verdana, sans-serif } | ||
p { margin-left: 20px } | ||
</style> | ||
</head> | ||
<body> | ||
<h1> | ||
FCKeditor Documentation</h1> | ||
<p> | ||
You can find the official documentation for FCKeditor online, at <a href="http://docs.fckeditor.net/"> | ||
http://docs.fckeditor.net/</a>.</p> | ||
</body> | ||
</html> |
38 changes: 38 additions & 0 deletions
38
public/javascripts/fckeditor/_samples/_plugins/findreplace/fckplugin.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* FCKeditor - The text editor for Internet - http://www.fckeditor.net | ||
* Copyright (C) 2003-2008 Frederico Caldeira Knabben | ||
* | ||
* == BEGIN LICENSE == | ||
* | ||
* 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 | ||
* | ||
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") | ||
* http://www.gnu.org/licenses/lgpl.html | ||
* | ||
* - Mozilla Public License Version 1.1 or later (the "MPL") | ||
* http://www.mozilla.org/MPL/MPL-1.1.html | ||
* | ||
* == END LICENSE == | ||
* | ||
* This is the sample plugin definition file. | ||
*/ | ||
|
||
// Register the related commands. | ||
FCKCommands.RegisterCommand( 'My_Find' , new FCKDialogCommand( FCKLang['DlgMyFindTitle'] , FCKLang['DlgMyFindTitle'] , FCKConfig.PluginsPath + 'findreplace/find.html' , 340, 170 ) ) ; | ||
FCKCommands.RegisterCommand( 'My_Replace' , new FCKDialogCommand( FCKLang['DlgMyReplaceTitle'], FCKLang['DlgMyReplaceTitle'] , FCKConfig.PluginsPath + 'findreplace/replace.html', 340, 200 ) ) ; | ||
|
||
// Create the "Find" toolbar button. | ||
var oFindItem = new FCKToolbarButton( 'My_Find', FCKLang['DlgMyFindTitle'] ) ; | ||
oFindItem.IconPath = FCKConfig.PluginsPath + 'findreplace/find.gif' ; | ||
|
||
FCKToolbarItems.RegisterItem( 'My_Find', oFindItem ) ; // 'My_Find' is the name used in the Toolbar config. | ||
|
||
// Create the "Replace" toolbar button. | ||
var oReplaceItem = new FCKToolbarButton( 'My_Replace', FCKLang['DlgMyReplaceTitle'] ) ; | ||
oReplaceItem.IconPath = FCKConfig.PluginsPath + 'findreplace/replace.gif' ; | ||
|
||
FCKToolbarItems.RegisterItem( 'My_Replace', oReplaceItem ) ; // 'My_Replace' is the name used in the Toolbar config. |
Binary file added
BIN
+595 Bytes
public/javascripts/fckeditor/_samples/_plugins/findreplace/find.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
172 changes: 172 additions & 0 deletions
172
public/javascripts/fckeditor/_samples/_plugins/findreplace/find.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,172 @@ | ||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> | ||
<!-- | ||
* FCKeditor - The text editor for Internet - http://www.fckeditor.net | ||
* Copyright (C) 2003-2008 Frederico Caldeira Knabben | ||
* | ||
* == BEGIN LICENSE == | ||
* | ||
* 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 | ||
* | ||
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") | ||
* http://www.gnu.org/licenses/lgpl.html | ||
* | ||
* - Mozilla Public License Version 1.1 or later (the "MPL") | ||
* http://www.mozilla.org/MPL/MPL-1.1.html | ||
* | ||
* == END LICENSE == | ||
* | ||
* This is the sample "Find" plugin window. | ||
--> | ||
<html> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | ||
<meta content="noindex, nofollow" name="robots"> | ||
<script type="text/javascript"> | ||
|
||
var oEditor = window.parent.InnerDialogLoaded() ; | ||
|
||
function OnLoad() | ||
{ | ||
// Whole word is available on IE only. | ||
if ( oEditor.FCKBrowserInfo.IsIE ) | ||
document.getElementById('divWord').style.display = '' ; | ||
|
||
// First of all, translate the dialog box texts. | ||
oEditor.FCKLanguageManager.TranslatePage( document ) ; | ||
|
||
window.parent.SetAutoSize( true ) ; | ||
} | ||
|
||
function btnStat(frm) | ||
{ | ||
document.getElementById('btnFind').disabled = | ||
( document.getElementById('txtFind').value.length == 0 ) ; | ||
} | ||
|
||
function ReplaceTextNodes( parentNode, regex, replaceValue, replaceAll ) | ||
{ | ||
for ( var i = 0 ; i < parentNode.childNodes.length ; i++ ) | ||
{ | ||
var oNode = parentNode.childNodes[i] ; | ||
if ( oNode.nodeType == 3 ) | ||
{ | ||
var sReplaced = oNode.nodeValue.replace( regex, replaceValue ) ; | ||
if ( oNode.nodeValue != sReplaced ) | ||
{ | ||
oNode.nodeValue = sReplaced ; | ||
if ( ! replaceAll ) | ||
return true ; | ||
} | ||
} | ||
else | ||
{ | ||
if ( ReplaceTextNodes( oNode, regex, replaceValue ) ) | ||
return true ; | ||
} | ||
} | ||
return false ; | ||
} | ||
|
||
function GetRegexExpr() | ||
{ | ||
if ( document.getElementById('chkWord').checked ) | ||
var sExpr = '\\b' + document.getElementById('txtFind').value + '\\b' ; | ||
else | ||
var sExpr = document.getElementById('txtFind').value ; | ||
|
||
return sExpr ; | ||
} | ||
|
||
function GetCase() | ||
{ | ||
return ( document.getElementById('chkCase').checked ? '' : 'i' ) ; | ||
} | ||
|
||
function Ok() | ||
{ | ||
if ( document.getElementById('txtFind').value.length == 0 ) | ||
return ; | ||
|
||
if ( oEditor.FCKBrowserInfo.IsIE ) | ||
FindIE() ; | ||
else | ||
FindGecko() ; | ||
} | ||
|
||
var oRange = null ; | ||
|
||
function FindIE() | ||
{ | ||
if ( oRange == null ) | ||
oRange = oEditor.FCK.EditorDocument.body.createTextRange() ; | ||
|
||
var iFlags = 0 ; | ||
|
||
if ( chkCase.checked ) | ||
iFlags = iFlags | 4 ; | ||
|
||
if ( chkWord.checked ) | ||
iFlags = iFlags | 2 ; | ||
|
||
var bFound = oRange.findText( document.getElementById('txtFind').value, 1, iFlags ) ; | ||
|
||
if ( bFound ) | ||
{ | ||
oRange.scrollIntoView() ; | ||
oRange.select() ; | ||
oRange.collapse(false) ; | ||
oLastRangeFound = oRange ; | ||
} | ||
else | ||
{ | ||
oRange = null ; | ||
alert( oEditor.FCKLang.DlgFindNotFoundMsg ) ; | ||
} | ||
} | ||
|
||
function FindGecko() | ||
{ | ||
var bCase = document.getElementById('chkCase').checked ; | ||
var bWord = document.getElementById('chkWord').checked ; | ||
|
||
// window.find( searchString, caseSensitive, backwards, wrapAround, wholeWord, searchInFrames, showDialog ) ; | ||
oEditor.FCK.EditorWindow.find( document.getElementById('txtFind').value, bCase, false, false, bWord, false, false ) ; | ||
|
||
} | ||
</script> | ||
</head> | ||
<body onload="OnLoad()" scroll="no" style="OVERFLOW: hidden"> | ||
<div align="center"> | ||
This is my Plugin! | ||
</div> | ||
<table cellSpacing="3" cellPadding="2" width="100%" border="0"> | ||
<tr> | ||
<td nowrap> | ||
<label for="txtFind" fckLang="DlgMyReplaceFindLbl">Find what:</label> | ||
</td> | ||
<td width="100%"> | ||
<input id="txtFind" onkeyup="btnStat(this.form)" style="WIDTH: 100%" tabIndex="1" type="text"> | ||
</td> | ||
<td> | ||
<input id="btnFind" style="WIDTH: 100%; PADDING-RIGHT: 5px; PADDING-LEFT: 5px" disabled | ||
onclick="Ok();" type="button" value="Find" fckLang="DlgMyFindFindBtn"> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td valign="bottom" colSpan="3"> | ||
<input id="chkCase" tabIndex="3" type="checkbox"><label for="chkCase" fckLang="DlgMyReplaceCaseChk">Match | ||
case</label> | ||
<br> | ||
<div id="divWord" style="DISPLAY: none"> | ||
<input id="chkWord" tabIndex="4" type="checkbox"><label for="chkWord" fckLang="DlgMyReplaceWordChk">Match | ||
whole word</label> | ||
</div> | ||
</td> | ||
</tr> | ||
</table> | ||
</body> | ||
</html> |
33 changes: 33 additions & 0 deletions
33
public/javascripts/fckeditor/_samples/_plugins/findreplace/lang/en.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* FCKeditor - The text editor for Internet - http://www.fckeditor.net | ||
* Copyright (C) 2003-2008 Frederico Caldeira Knabben | ||
* | ||
* == BEGIN LICENSE == | ||
* | ||
* 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 | ||
* | ||
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") | ||
* http://www.gnu.org/licenses/lgpl.html | ||
* | ||
* - Mozilla Public License Version 1.1 or later (the "MPL") | ||
* http://www.mozilla.org/MPL/MPL-1.1.html | ||
* | ||
* == END LICENSE == | ||
* | ||
* English language file for the sample plugin. | ||
*/ | ||
|
||
FCKLang['DlgMyReplaceTitle'] = 'Plugin - Replace' ; | ||
FCKLang['DlgMyReplaceFindLbl'] = 'Find what:' ; | ||
FCKLang['DlgMyReplaceReplaceLbl'] = 'Replace with:' ; | ||
FCKLang['DlgMyReplaceCaseChk'] = 'Match case' ; | ||
FCKLang['DlgMyReplaceReplaceBtn'] = 'Replace' ; | ||
FCKLang['DlgMyReplaceReplAllBtn'] = 'Replace All' ; | ||
FCKLang['DlgMyReplaceWordChk'] = 'Match whole word' ; | ||
|
||
FCKLang['DlgMyFindTitle'] = 'Plugin - Find' ; | ||
FCKLang['DlgMyFindFindBtn'] = 'Find' ; |
Oops, something went wrong.