mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-14 10:54:50 +08:00
- More Admin UI work (CMSPages). The meat of each page still needs a little work otherwise things are shaping up nicely
- Adding searchreplace TinyMCE plugin --HG-- extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4041966
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/* begin: reset
|
||||
todo: (nheskew) pare down and combine with existing selectors where appropriate */
|
||||
todo: (heskew) pare down and combine with existing selectors where appropriate */
|
||||
/* http://meyerweb.com/eric/tools/css/reset/ */
|
||||
/* v1.0 | 20080212 */
|
||||
html, body, div, span, applet, object, iframe,
|
||||
@@ -48,14 +48,16 @@ html {
|
||||
color:#525e50;
|
||||
}
|
||||
body {
|
||||
color:#5a5b32;
|
||||
font-family:Frutiger, "Frutiger Linotype", Univers, Calibri, "Gill Sans", "Gill Sans MT", "Myriad Pro", Myriad, "DejaVu Sans Condensed", "Liberation Sans", "Nimbus Sans L", Tahoma, Geneva, "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
font-size:62.5%; /* 10px */
|
||||
line-height:1.6em;
|
||||
margin:0 auto 1em;
|
||||
min-width:96em; /* 960px */
|
||||
min-width:94.6em; /* 946px */
|
||||
padding:0 .4em;
|
||||
}
|
||||
body, input, select, textarea {
|
||||
color:#5a5b32;
|
||||
font-family:Frutiger, "Frutiger Linotype", Univers, Calibri, "Gill Sans", "Gill Sans MT", "Myriad Pro", Myriad, "DejaVu Sans Condensed", "Liberation Sans", "Nimbus Sans L", Tahoma, Geneva, "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
}
|
||||
body#preview {
|
||||
min-width:0;
|
||||
}
|
||||
@@ -63,6 +65,73 @@ body#preview {
|
||||
background:#f9faf5;
|
||||
}
|
||||
|
||||
/* Layout
|
||||
|
||||
number of columns: 24; actual width: 946; column width: 26; gutter width:14
|
||||
|
||||
| 24| 23| 22| 21| 20| 19| 18| 17| 16| 15| 14| 13| 12| 11| 10| 9| 8| 7| 6| 5| 4| 3| 2
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
.5g| 0.759| 0.793| 0.829| 0.870| 0.914| 0.963| 1.017| 1.079| 1.148| 1.226| 1.316| 1.420| 1.542| 1.687| 1.862| 2.077| 2.349| 2.703| 3.182| 3.867| 4.930| 6.796| 10.938
|
||||
24|100.000| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---
|
||||
23| 95.770|100.000| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---
|
||||
22| 91.540| 95.583|100.000| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---
|
||||
21| 87.310| 91.166| 95.379|100.000| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---
|
||||
20| 83.080| 86.750| 90.758| 95.155|100.000| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---
|
||||
19| 78.850| 82.333| 86.137| 90.311| 94.909|100.000| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---
|
||||
18| 74.620| 77.916| 81.517| 85.466| 89.817| 94.635|100.000| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---
|
||||
17| 70.390| 73.499| 76.896| 80.621| 84.726| 89.271| 94.331|100.000| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---
|
||||
16| 66.161| 69.083| 72.275| 75.776| 79.634| 83.906| 88.663| 93.991|100.000| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---
|
||||
15| 61.931| 64.666| 67.654| 70.932| 74.543| 78.542| 82.994| 87.982| 93.607|100.000| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---
|
||||
14| 57.701| 60.249| 63.033| 66.087| 69.452| 73.177| 77.326| 81.972| 87.213| 93.170|100.000| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---
|
||||
13| 53.471| 55.832| 58.412| 61.242| 64.360| 67.813| 71.657| 75.963| 80.820| 86.340| 92.669|100.000| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---
|
||||
12| 49.241| 51.416| 53.791| 56.398| 59.269| 62.448| 65.988| 69.954| 74.426| 79.510| 85.338| 92.089|100.000| ---| ---| ---| ---| ---| ---| ---| ---| ---| ---
|
||||
11| 45.011| 46.999| 49.171| 51.553| 54.178| 57.084| 60.320| 63.945| 68.033| 72.680| 78.008| 84.178| 91.410|100.000| ---| ---| ---| ---| ---| ---| ---| ---| ---
|
||||
10| 40.781| 42.582| 44.550| 46.708| 49.086| 51.719| 54.651| 57.935| 61.639| 65.849| 70.677| 76.268| 82.819| 90.602|100.000| ---| ---| ---| ---| ---| ---| ---| ---
|
||||
9| 36.551| 38.165| 39.929| 41.863| 43.995| 46.355| 48.983| 51.926| 55.246| 59.019| 63.346| 68.357| 74.229| 81.205| 89.628|100.000| ---| ---| ---| ---| ---| ---| ---
|
||||
8| 32.321| 33.749| 35.308| 37.019| 38.903| 40.990| 43.314| 45.917| 48.852| 52.189| 56.015| 60.446| 65.639| 71.807| 79.255| 88.427|100.000| ---| ---| ---| ---| ---| ---
|
||||
7| 28.091| 29.332| 30.687| 32.174| 33.812| 35.626| 37.645| 39.908| 42.459| 45.359| 48.684| 52.535| 57.048| 62.410| 68.883| 76.855| 86.913|100.000| ---| ---| ---| ---| ---
|
||||
6| 23.861| 24.915| 26.066| 27.329| 28.721| 30.261| 31.977| 33.898| 36.066| 38.529| 41.353| 44.625| 48.458| 53.012| 58.511| 65.282| 73.826| 84.942|100.000| ---| ---| ---| ---
|
||||
5| 19.631| 20.498| 21.445| 22.484| 23.629| 24.897| 26.308| 27.889| 29.672| 31.699| 34.023| 36.714| 39.868| 43.614| 48.138| 53.709| 60.738| 69.884| 82.273|100.000| ---| ---| ---
|
||||
4| 15.401| 16.082| 16.825| 17.640| 18.538| 19.532| 20.640| 21.880| 23.279| 24.869| 26.692| 28.803| 31.278| 34.217| 37.766| 42.136| 47.651| 54.826| 64.545| 78.453|100.000| ---| ---
|
||||
3| 11.171| 11.665| 12.204| 12.795| 13.446| 14.168| 14.971| 15.871| 16.885| 18.039| 19.361| 20.892| 22.687| 24.819| 27.394| 30.564| 34.564| 39.768| 46.818| 56.906| 72.535|100.000| ---
|
||||
2| 6.941| 7.248| 7.583| 7.950| 8.355| 8.803| 9.302| 9.861| 10.492| 11.208| 12.030| 12.982| 14.097| 15.422| 17.021| 18.991| 21.477| 24.710| 29.091| 35.359| 45.070| 62.136|100.000
|
||||
1| 2.711| 2.831| 2.962| 3.106| 3.264| 3.439| 3.634| 3.852| 4.098| 4.378| 4.699| 5.071| 5.507| 6.024| 6.649| 7.418| 8.389| 9.653| 11.364| 13.812| 17.606| 24.272| 39.063
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
| 24| 23| 22| 21| 20| 19| 18| 17| 16| 15| 14| 13| 12| 11| 10| 9| 8| 7| 6| 5| 4| 3| 2
|
||||
|
||||
----------------------------------------------------------*/
|
||||
#header, #footer {
|
||||
width:100%;
|
||||
}
|
||||
#header {
|
||||
overflow:hidden;
|
||||
}
|
||||
#content {
|
||||
overflow:hidden;
|
||||
padding:1.4em;
|
||||
}
|
||||
#main {
|
||||
display:inline;
|
||||
float:right;
|
||||
width:83.08%;
|
||||
}
|
||||
#navigation {
|
||||
display:inline;
|
||||
float:left;
|
||||
width:15.401%;
|
||||
}
|
||||
.wrapper, .sections {
|
||||
overflow:hidden;
|
||||
}
|
||||
.sections .primary {
|
||||
float:left;
|
||||
width:74.543%;
|
||||
}
|
||||
.sections .secondary {
|
||||
float:right;
|
||||
width:23.629%;
|
||||
}
|
||||
|
||||
/* Headings and defaults
|
||||
----------------------------------------------------------*/
|
||||
h1, h2, h3, h4, h5, h6, legend {
|
||||
@@ -74,7 +143,7 @@ h1, h2, h3, h4, h5, h6, legend {
|
||||
|
||||
h1 { font-size:2.8em; } /* 28px */
|
||||
h2 { font-size:2.4em; } /* 24px */
|
||||
h3 { font-size:2em; } /* 20px */
|
||||
h3 { font-size:2.1em; } /* 21px */
|
||||
h4 { font-size:1.8em; } /* 18px */
|
||||
h5 { font-size:1.6em; } /* 16px */
|
||||
h6, p, label, input, select, th, td { font-size:1.5em; } /* 15px */
|
||||
@@ -155,33 +224,6 @@ a.linkButton, a.linkButton:visited {
|
||||
color:#ffea9b;
|
||||
}
|
||||
|
||||
|
||||
/* temp rough structure */
|
||||
#header, #footer {
|
||||
width:100%;
|
||||
}
|
||||
#header {
|
||||
overflow:hidden;
|
||||
}
|
||||
#content {
|
||||
overflow:auto;
|
||||
padding:1.4em;
|
||||
}
|
||||
#main {
|
||||
display:inline;
|
||||
float:right;
|
||||
margin-left:-22em;
|
||||
width:100%;
|
||||
}
|
||||
#main .wrapper {
|
||||
margin-left:22em;
|
||||
}
|
||||
#navigation {
|
||||
display:inline;
|
||||
float:left;
|
||||
width:20.5em;
|
||||
}
|
||||
|
||||
/* Navigation
|
||||
----------------------------------------------------------*/
|
||||
#navshortcut {
|
||||
@@ -227,7 +269,7 @@ a.linkButton, a.linkButton:visited {
|
||||
#main h2, #main h3, #main h4 {
|
||||
margin:.23em 0 1em;
|
||||
}
|
||||
#main h2 {
|
||||
#main h2, #main h3 {
|
||||
border-bottom:1px dashed #e4e7dc;
|
||||
}
|
||||
|
||||
@@ -264,11 +306,6 @@ div.confirmation, div.warning, div.critical {
|
||||
line-height:24px;
|
||||
}
|
||||
|
||||
fieldset {
|
||||
margin:10px;
|
||||
border:1px solid #d2d6c6;
|
||||
}
|
||||
|
||||
label {
|
||||
display: block;
|
||||
font-weight:700;
|
||||
@@ -284,8 +321,7 @@ legend {
|
||||
color:#525e50;
|
||||
}
|
||||
|
||||
select, textarea, #PublishLaterDate, .inputText{
|
||||
font-family: Frutiger, "Frutiger Linotype", Univers, Calibri, "Gill Sans", "Gill Sans MT", "Myriad Pro", Myriad, "DejaVu Sans Condensed", "Liberation Sans", "Nimbus Sans L", Tahoma, Geneva, "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
select, textarea, input.text, #PublishLaterDate {
|
||||
margin:4px;
|
||||
padding:2px;
|
||||
border:1px solid #d2d6c6;
|
||||
@@ -293,8 +329,25 @@ select, textarea, #PublishLaterDate, .inputText{
|
||||
}
|
||||
|
||||
textarea {
|
||||
height:8em;
|
||||
width:80%;
|
||||
height:260px;
|
||||
}
|
||||
/* todo: (heskew) move editor specific style elsewhere and make to not suck :| */
|
||||
.primary input.large.text,
|
||||
.primary textarea,
|
||||
.primary fieldset {
|
||||
margin:.613% 0 .613% .613%;
|
||||
padding:4px;
|
||||
width:98.161%;
|
||||
}
|
||||
.primary .mceEditor {
|
||||
display:block;
|
||||
margin:.613% 0 .613% .613%;
|
||||
}
|
||||
.secondary fieldset {
|
||||
margin:.446% 0 .446% .446%;
|
||||
padding:4px;
|
||||
width:98.662%;
|
||||
}
|
||||
|
||||
.radioButton {
|
||||
@@ -302,15 +355,14 @@ margin:0 6px 0 0;
|
||||
}
|
||||
|
||||
input[button], button, .button {
|
||||
font-family: Frutiger, "Frutiger Linotype", Univers, Calibri, "Gill Sans", "Gill Sans MT", "Myriad Pro", Myriad, "DejaVu Sans Condensed", "Liberation Sans", "Nimbus Sans L", Tahoma, Geneva, "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
text-align:center;
|
||||
padding: 0px 8px;
|
||||
height: 26px;
|
||||
margin:20px 4px 0 4px;
|
||||
background:url(images/tableHeaderBackground.gif) repeat-x top left #dddfcb;
|
||||
background:#dddfcb url(images/tableHeaderBackground.gif) repeat-x top left;
|
||||
border:1px solid #d2d6c6;
|
||||
color:#5a5b32;
|
||||
cursor:pointer;
|
||||
height:26px;
|
||||
margin:20px 4px 0 4px;
|
||||
padding:0 8px;
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
.buttonFocus {color:#f6faea; border:1px solid #666d51; background:#8a8f7a;}
|
||||
@@ -320,11 +372,7 @@ input[button], button, .button {
|
||||
width:200px;
|
||||
}
|
||||
|
||||
.inputText {
|
||||
width:80%;
|
||||
}
|
||||
|
||||
.inputTextLarge {
|
||||
input.large.text {
|
||||
font-size:130%;
|
||||
font-weight:500;
|
||||
}
|
||||
@@ -350,8 +398,8 @@ ol.actions {margin:20px 0 0 0;}
|
||||
ol.actions .button {margin:4px 4px 4px -8px;}
|
||||
|
||||
ol.actions label {
|
||||
margin:6px 0 0 0;
|
||||
}
|
||||
margin:9px 0 0;
|
||||
}
|
||||
|
||||
.filterActions {
|
||||
float:right;
|
||||
@@ -475,21 +523,16 @@ ul.horizontal li a, ul.horizontal li a:visited, ul.horizontal li a:active, ol.ho
|
||||
|
||||
.displayText {display:none;}
|
||||
|
||||
/*
|
||||
.separator {border-bottom:1px dashed #E4E7DC; margin-bottom:8px; padding-bottom:2px;}
|
||||
*/
|
||||
|
||||
/*TODO - Remove roundCorners class*/
|
||||
#content, #navigation li,
|
||||
table, textarea, .button, .inputText, .inputTextLarge,
|
||||
table, textarea, .button, input.text, .inputTextLarge,
|
||||
.inputTextPermalink, .linkButton, div.confirmation,
|
||||
div.warning, div.critical, .roundCorners {
|
||||
-moz-border-radius:4px;
|
||||
-webkit-border-top-radius:4px;
|
||||
}
|
||||
|
||||
|
||||
/* TinyMCE Overides
|
||||
----------------------------------------------------------*/
|
||||
.defaultSkin table.mceLayout {
|
||||
margin:0 0 20px 0 !important;
|
||||
width:90% !important;
|
||||
}
|
||||
border-radius:4px;
|
||||
}
|
@@ -2,15 +2,14 @@
|
||||
<%@ Import Namespace="Orchard.CmsPages.Models"%>
|
||||
<%@ Import Namespace="Orchard.Mvc.Html" %>
|
||||
<% Html.Include("Head"); %>
|
||||
<div class="yui-g">
|
||||
<h2><%=_Encoded("Edit Page")%></h2>
|
||||
<p class="bottomSpacer"><%=_Encoded("about setting up a page")%></p>
|
||||
<%=Html.ValidationSummary() %>
|
||||
</div>
|
||||
<div class="yui-gc">
|
||||
<h2><%=_Encoded("Edit Page")%></h2>
|
||||
<p class="bottomSpacer"><%=_Encoded("about setting up a page")%></p>
|
||||
<%=Html.ValidationSummary() %>
|
||||
<div class="sections">
|
||||
<%using (Html.BeginForm()) {%>
|
||||
<div class="yui-u first">
|
||||
<div class="primary">
|
||||
<h3><%=_Encoded("Page Content") %></h3>
|
||||
<%-- todo: (heskew) change the editors to be self-contained (fieldset > editor) --%>
|
||||
<ol>
|
||||
<%=Html.EditorFor(m => m.Revision.Title, "inputTextLarge")%>
|
||||
<%=Html.EditorFor(m => m.Revision.Slug, "inputTextPermalink")%>
|
||||
@@ -35,7 +34,7 @@
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="yui-u sideBar">
|
||||
<div class="secondary">
|
||||
<h3><%=_Encoded("Publish Settings")%></h3>
|
||||
<fieldset>
|
||||
<ol class="formList">
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<string>" %>
|
||||
<li>
|
||||
<%=Html.LabelForModel() %>
|
||||
<%=Html.TextBox("",Model,new{@class="inputText inputTextLarge"}) %>
|
||||
<%=Html.TextBox("",Model,new{@class="text large"}) %>
|
||||
<%=Html.ValidationMessage("","*")%>
|
||||
</li>
|
||||
|
@@ -7,8 +7,7 @@ Permalink:
|
||||
</label>
|
||||
<span class="floatLeft">
|
||||
<%--<input id="permalink" class="inputText floatLeft roundCorners" type="text" name="permalink"/>--%>
|
||||
<%=Html.TextBox("", Model, new { @class = "inputText floatLeft" })%>
|
||||
<p class="helperText smallText clearLayout">How to write a permalink.</p>
|
||||
<%=Html.TextBox("", Model, new { @class = "text" })%> <span class="helperText smallText clearLayout"> « How to write a permalink. » </span>
|
||||
</span>
|
||||
</li>
|
||||
<div class="clearLayout" />
|
@@ -2,7 +2,7 @@
|
||||
<%@ Import Namespace="Orchard.Utility"%>
|
||||
<%@ Import Namespace="Orchard.CmsPages.ViewModels"%>
|
||||
<%@ Import Namespace="Orchard.Mvc.Html" %>
|
||||
<%-- todo: (nheskew) not this --%>
|
||||
<%-- todo: (heskew) not this --%>
|
||||
<script runat="server">
|
||||
public string DefaultText(string valueText, string defaultText)
|
||||
{
|
||||
|
@@ -0,0 +1,6 @@
|
||||
.panel_wrapper {height:85px;}
|
||||
.panel_wrapper div.current {height:85px;}
|
||||
|
||||
/* IE */
|
||||
* html .panel_wrapper {height:100px;}
|
||||
* html .panel_wrapper div.current {height:100px;}
|
@@ -0,0 +1 @@
|
||||
(function(){tinymce.create("tinymce.plugins.SearchReplacePlugin",{init:function(a,c){function b(d){a.windowManager.open({file:c+"/searchreplace.htm",width:420+parseInt(a.getLang("searchreplace.delta_width",0)),height:160+parseInt(a.getLang("searchreplace.delta_height",0)),inline:1,auto_focus:0},{mode:d,search_string:a.selection.getContent({format:"text"}),plugin_url:c})}a.addCommand("mceSearch",function(){b("search")});a.addCommand("mceReplace",function(){b("replace")});a.addButton("search",{title:"searchreplace.search_desc",cmd:"mceSearch"});a.addButton("replace",{title:"searchreplace.replace_desc",cmd:"mceReplace"});a.addShortcut("ctrl+f","searchreplace.search_desc","mceSearch")},getInfo:function(){return{longname:"Search/Replace",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("searchreplace",tinymce.plugins.SearchReplacePlugin)})();
|
@@ -0,0 +1,54 @@
|
||||
/**
|
||||
* $Id: editor_plugin_src.js 686 2008-03-09 18:13:49Z spocke $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright <20> 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
*/
|
||||
|
||||
(function() {
|
||||
tinymce.create('tinymce.plugins.SearchReplacePlugin', {
|
||||
init : function(ed, url) {
|
||||
function open(m) {
|
||||
ed.windowManager.open({
|
||||
file : url + '/searchreplace.htm',
|
||||
width : 420 + parseInt(ed.getLang('searchreplace.delta_width', 0)),
|
||||
height : 160 + parseInt(ed.getLang('searchreplace.delta_height', 0)),
|
||||
inline : 1,
|
||||
auto_focus : 0
|
||||
}, {
|
||||
mode : m,
|
||||
search_string : ed.selection.getContent({format : 'text'}),
|
||||
plugin_url : url
|
||||
});
|
||||
};
|
||||
|
||||
// Register commands
|
||||
ed.addCommand('mceSearch', function() {
|
||||
open('search');
|
||||
});
|
||||
|
||||
ed.addCommand('mceReplace', function() {
|
||||
open('replace');
|
||||
});
|
||||
|
||||
// Register buttons
|
||||
ed.addButton('search', {title : 'searchreplace.search_desc', cmd : 'mceSearch'});
|
||||
ed.addButton('replace', {title : 'searchreplace.replace_desc', cmd : 'mceReplace'});
|
||||
|
||||
ed.addShortcut('ctrl+f', 'searchreplace.search_desc', 'mceSearch');
|
||||
},
|
||||
|
||||
getInfo : function() {
|
||||
return {
|
||||
longname : 'Search/Replace',
|
||||
author : 'Moxiecode Systems AB',
|
||||
authorurl : 'http://tinymce.moxiecode.com',
|
||||
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace',
|
||||
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
// Register plugin
|
||||
tinymce.PluginManager.add('searchreplace', tinymce.plugins.SearchReplacePlugin);
|
||||
})();
|
@@ -0,0 +1,126 @@
|
||||
tinyMCEPopup.requireLangPack();
|
||||
|
||||
var SearchReplaceDialog = {
|
||||
init : function(ed) {
|
||||
var f = document.forms[0], m = tinyMCEPopup.getWindowArg("mode");
|
||||
|
||||
this.switchMode(m);
|
||||
|
||||
f[m + '_panel_searchstring'].value = tinyMCEPopup.getWindowArg("search_string");
|
||||
|
||||
// Focus input field
|
||||
f[m + '_panel_searchstring'].focus();
|
||||
},
|
||||
|
||||
switchMode : function(m) {
|
||||
var f, lm = this.lastMode;
|
||||
|
||||
if (lm != m) {
|
||||
f = document.forms[0];
|
||||
|
||||
if (lm) {
|
||||
f[m + '_panel_searchstring'].value = f[lm + '_panel_searchstring'].value;
|
||||
f[m + '_panel_backwardsu'].checked = f[lm + '_panel_backwardsu'].checked;
|
||||
f[m + '_panel_backwardsd'].checked = f[lm + '_panel_backwardsd'].checked;
|
||||
f[m + '_panel_casesensitivebox'].checked = f[lm + '_panel_casesensitivebox'].checked;
|
||||
}
|
||||
|
||||
mcTabs.displayTab(m + '_tab', m + '_panel');
|
||||
document.getElementById("replaceBtn").style.display = (m == "replace") ? "inline" : "none";
|
||||
document.getElementById("replaceAllBtn").style.display = (m == "replace") ? "inline" : "none";
|
||||
this.lastMode = m;
|
||||
}
|
||||
},
|
||||
|
||||
searchNext : function(a) {
|
||||
var ed = tinyMCEPopup.editor, se = ed.selection, r = se.getRng(), f, m = this.lastMode, s, b, fl = 0, w = ed.getWin(), wm = ed.windowManager, fo = 0;
|
||||
|
||||
// Get input
|
||||
f = document.forms[0];
|
||||
s = f[m + '_panel_searchstring'].value;
|
||||
b = f[m + '_panel_backwardsu'].checked;
|
||||
ca = f[m + '_panel_casesensitivebox'].checked;
|
||||
rs = f['replace_panel_replacestring'].value;
|
||||
|
||||
if (s == '')
|
||||
return;
|
||||
|
||||
function fix() {
|
||||
// Correct Firefox graphics glitches
|
||||
r = se.getRng().cloneRange();
|
||||
ed.getDoc().execCommand('SelectAll', false, null);
|
||||
se.setRng(r);
|
||||
};
|
||||
|
||||
function replace() {
|
||||
if (tinymce.isIE)
|
||||
ed.selection.getRng().duplicate().pasteHTML(rs); // Needs to be duplicated due to selection bug in IE
|
||||
else
|
||||
ed.getDoc().execCommand('InsertHTML', false, rs);
|
||||
};
|
||||
|
||||
// IE flags
|
||||
if (ca)
|
||||
fl = fl | 4;
|
||||
|
||||
switch (a) {
|
||||
case 'all':
|
||||
// Move caret to beginning of text
|
||||
ed.execCommand('SelectAll');
|
||||
ed.selection.collapse(true);
|
||||
|
||||
if (tinymce.isIE) {
|
||||
while (r.findText(s, b ? -1 : 1, fl)) {
|
||||
r.scrollIntoView();
|
||||
r.select();
|
||||
replace();
|
||||
fo = 1;
|
||||
}
|
||||
|
||||
tinyMCEPopup.storeSelection();
|
||||
} else {
|
||||
while (w.find(s, ca, b, false, false, false, false)) {
|
||||
replace();
|
||||
fo = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (fo)
|
||||
tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.allreplaced'));
|
||||
else
|
||||
tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound'));
|
||||
|
||||
return;
|
||||
|
||||
case 'current':
|
||||
if (!ed.selection.isCollapsed())
|
||||
replace();
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
se.collapse(b);
|
||||
r = se.getRng();
|
||||
|
||||
// Whats the point
|
||||
if (!s)
|
||||
return;
|
||||
|
||||
if (tinymce.isIE) {
|
||||
if (r.findText(s, b ? -1 : 1, fl)) {
|
||||
r.scrollIntoView();
|
||||
r.select();
|
||||
} else
|
||||
tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound'));
|
||||
|
||||
tinyMCEPopup.storeSelection();
|
||||
} else {
|
||||
if (!w.find(s, ca, b, false, false, false, false))
|
||||
tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound'));
|
||||
else
|
||||
fix();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
tinyMCEPopup.onInit.add(SearchReplaceDialog.init, SearchReplaceDialog);
|
@@ -0,0 +1,16 @@
|
||||
tinyMCE.addI18n('en.searchreplace_dlg',{
|
||||
searchnext_desc:"Find again",
|
||||
notfound:"The search has been completed. The search string could not be found.",
|
||||
search_title:"Find",
|
||||
replace_title:"Find/Replace",
|
||||
allreplaced:"All occurrences of the search string were replaced.",
|
||||
findwhat:"Find what",
|
||||
replacewith:"Replace with",
|
||||
direction:"Direction",
|
||||
up:"Up",
|
||||
down:"Down",
|
||||
mcase:"Match case",
|
||||
findnext:"Find next",
|
||||
replace:"Replace",
|
||||
replaceall:"Replace all"
|
||||
});
|
@@ -0,0 +1,104 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>{#searchreplace_dlg.replace_title}</title>
|
||||
<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
|
||||
<script type="text/javascript" src="../../utils/mctabs.js"></script>
|
||||
<script type="text/javascript" src="../../utils/form_utils.js"></script>
|
||||
<script type="text/javascript" src="js/searchreplace.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="css/searchreplace.css" />
|
||||
</head>
|
||||
<body style="display:none;">
|
||||
<form onsubmit="SearchReplaceDialog.searchNext('none');return false;" action="#">
|
||||
<div class="tabs">
|
||||
<ul>
|
||||
<li id="search_tab"><span><a href="javascript:SearchReplaceDialog.switchMode('search');" onmousedown="return false;">{#searchreplace.search_desc}</a></span></li>
|
||||
<li id="replace_tab"><span><a href="javascript:SearchReplaceDialog.switchMode('replace');" onmousedown="return false;">{#searchreplace_dlg.replace}</a></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="panel_wrapper">
|
||||
<div id="search_panel" class="panel">
|
||||
<table border="0" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td><label for="search_panel_searchstring">{#searchreplace_dlg.findwhat}</label></td>
|
||||
<td><input type="text" id="search_panel_searchstring" name="search_panel_searchstring" style="width: 200px" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<table border="0" cellspacing="0" cellpadding="0" class="direction">
|
||||
<tr>
|
||||
<td><label>{#searchreplace_dlg.direction}</label></td>
|
||||
<td><input id="search_panel_backwardsu" name="search_panel_backwards" class="radio" type="radio" /></td>
|
||||
<td><label for="search_panel_backwardsu">{#searchreplace_dlg.up}</label></td>
|
||||
<td><input id="search_panel_backwardsd" name="search_panel_backwards" class="radio" type="radio" checked="checked" /></td>
|
||||
<td><label for="search_panel_backwardsd">{#searchreplace_dlg.down}</label></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<table border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td><input id="search_panel_casesensitivebox" name="search_panel_casesensitivebox" class="checkbox" type="checkbox" /></td>
|
||||
<td><label for="search_panel_casesensitivebox">{#searchreplace_dlg.mcase}</label></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="replace_panel" class="panel">
|
||||
<table border="0" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td><label for="replace_panel_searchstring">{#searchreplace_dlg.findwhat}</label></td>
|
||||
<td><input type="text" id="replace_panel_searchstring" name="replace_panel_searchstring" style="width: 200px" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="replace_panel_replacestring">{#searchreplace_dlg.replacewith}</label></td>
|
||||
<td><input type="text" id="replace_panel_replacestring" name="replace_panel_replacestring" style="width: 200px" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<table border="0" cellspacing="0" cellpadding="0" class="direction">
|
||||
<tr>
|
||||
<td><label>{#searchreplace_dlg.direction}</label></td>
|
||||
<td><input id="replace_panel_backwardsu" name="replace_panel_backwards" class="radio" type="radio" /></td>
|
||||
<td><label for="replace_panel_backwardsu">{#searchreplace_dlg.up}</label></td>
|
||||
<td><input id="replace_panel_backwardsd" name="replace_panel_backwards" class="radio" type="radio" checked="checked" /></td>
|
||||
<td><label for="replace_panel_backwardsd">{#searchreplace_dlg.down}</label></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<table border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td><input id="replace_panel_casesensitivebox" name="replace_panel_casesensitivebox" class="checkbox" type="checkbox" /></td>
|
||||
<td><label for="replace_panel_casesensitivebox">{#searchreplace_dlg.mcase}</label></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="mceActionPanel">
|
||||
<div style="float: left">
|
||||
<input type="submit" id="insert" name="insert" value="{#searchreplace_dlg.findnext}" />
|
||||
<input type="button" class="button" id="replaceBtn" name="replaceBtn" value="{#searchreplace_dlg.replace}" onclick="SearchReplaceDialog.searchNext('current');" />
|
||||
<input type="button" class="button" id="replaceAllBtn" name="replaceAllBtn" value="{#searchreplace_dlg.replaceall}" onclick="SearchReplaceDialog.searchNext('all');" />
|
||||
</div>
|
||||
|
||||
<div style="float: right">
|
||||
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
@@ -14,8 +14,20 @@ todo: (heskew) rework how/what pages are assembled when we get into theming --%>
|
||||
todo: (heskew) should have at the minimum something like, say, includeScript(scriptName[, releaseScriptName], scriptPath[, releaseScriptPath])
|
||||
--%><script src="<%=Page.ResolveClientUrl("~/Scripts/jquery-1.3.2.js") %>" type="text/javascript"></script>
|
||||
<%-- todo: (heskew) this should come from the admin "page" (partial)
|
||||
todo: (heskew) use the TinyMCE jQuery package instead?
|
||||
--%><script type="text/javascript" src="<%=ResolveUrl("~/Packages/TinyMce/Scripts/tiny_mce.js") %>"></script>
|
||||
<script type="text/javascript">tinyMCE.init({ theme: "advanced", mode: "textareas", plugins: "fullscreen,autoresize", theme_advanced_toolbar_location: "top", theme_advanced_toolbar_align: "left", theme_advanced_buttons3_add: "fullscreen" });</script>
|
||||
<script type="text/javascript">
|
||||
tinyMCE.init({
|
||||
theme: "advanced",
|
||||
mode: "textareas",
|
||||
plugins: "fullscreen,autoresize,searchreplace",
|
||||
theme_advanced_toolbar_location: "top",
|
||||
theme_advanced_toolbar_align: "left",
|
||||
theme_advanced_buttons1: "search,replace,|,cut,copy,paste,|,undo,redo,|,image,|,link,unlink,charmap,emoticon,codeblock,|,bold,italic,|,numlist,bullist,formatselect,|,code,fullscreen",
|
||||
theme_advanced_buttons2: "",
|
||||
theme_advanced_buttons3: ""
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="header" role="banner">
|
||||
|
Reference in New Issue
Block a user