blob: 56e3bbfa7cafe57c40d19083fbdeb38394d74f22 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
|
{* $Header: /cvsroot/bitweaver/_ckeditor/templates/header_inc.tpl,v 1.2 2010/02/02 17:54:17 dansut Exp $ *}
{*strip*}
{if $gBitUser->hasPermission( 'p_liberty_enter_html' ) && ( $gContent || $gComment ) && $gLibertySystem->mPlugins.bithtml && $gBitSystem->isPackageActive('ckeditor')}
{if ( $post_comment_request || $post_comment_preview || $comments_ajax ) && $gComment}
{assign var=contentObject value=$gComment}
{else}
{assign var=contentObject value=$gContent}
{/if}
<script type="text/javascript">/*<![CDATA[*/
BitCK = {ldelim}{rdelim};
BitCK.instances = [];
BitCK.CKify = function (name) {ldelim}
{* CKEDITOR.BasePath = "{$smarty.const.CKEDITOR_PKG_URL}jscripts/"; think this not needed *}
var oCKeditor = CKEDITOR.replace( name, {ldelim}customConfig:
{if $gBitSystem->isFeatureActive('ckeditor_custom_config')}
{if is_file($smarty.const.THEMES_STYLE_PATH|cat:"ckeditor/ckconfig.custom.js")}
'{$smarty.const.THEMES_STYLE_URL}ckeditor/ckconfig.custom.js'
{else}
'{$smarty.const.CKEDITOR_PKG_URL}ckconfig.custom.js'
{/if}
{else}
'{$smarty.const.CKEDITOR_PKG_URL}ckconfig.bitweaver.js'
{/if}
{rdelim} );
{if !$gBitSystem->isFeatureActive('ckedit_toolbars')}
oCKeditor.config.toolbar = "Basic";
{else}
oCKeditor.config.toolbar = "{$gBitSystem->getConfig('ckedit_toolbars')}";
{/if}
{if $gBitSystem->isFeatureActive('ckedit_skin')}
oCKeditor.config.skin = "{$gBitSystem->getConfig('ckedit_skin')}";
{/if}
{if $gBitSystem->isFeatureActive('ckedit_debug')}
oCKeditor.config.debug = 1;
{/if}
BitCK.instances.push(oCKeditor);
{rdelim};
BitCK.unCKifyAll = function (name){ldelim}
var n = BitCK.instances.length - 1;
while( n > -1 ){ldelim}
var ck = BitCK.instances.pop();
ck.destroy();
n--;
{rdelim}
{rdelim};
BitCK.CKprompt = function (textarea) {ldelim}
if (!textarea.promptedCK) {ldelim}
textarea.useCK=confirm("{tr}Would you like to use the HTML WYSIWYG editor for this text area?{/tr}");
textarea.promptedCK=1;
{rdelim}
if (textarea.useCK) {ldelim}
BitCK.CKify(textarea.name);
{rdelim}
{rdelim};
BitCK.CKall = function () {ldelim}
var allTextAreas = document.getElementsByTagName("textarea");
for (var i=0; i < allTextAreas.length; i++) {ldelim}
if (allTextAreas[i].className.substr(0,7) == 'wysiwyg') {ldelim}
{if $gBitSystem->isFeatureActive("ckeditor_ask") ||
$gBitSystem->isFeatureActive("ckeditor_on_click")}
allTextAreas[i].onclick = function() {ldelim} BitCK.CKprompt(this); {rdelim};
{if !$gBitSystem->isFeatureActive("ckeditor_ask")}
allTextAreas[i].promptedCK=1;
allTextAreas[i].useCK=1;
{/if}
{else}
var id;
if (typeof(allTextAreas[i].id) != 'undefined' && allTextAreas[i].id != null){ldelim}
id = allTextAreas[i].id;
{rdelim}else{ldelim}
id = allTextAreas[i].name;
{rdelim}
BitCK.CKify(id);
{/if}
{rdelim}
{rdelim}
BitCK.bindFormatListener();
{rdelim};
BitCK.bindFormatListener = function() {ldelim}
var radios = document.getElementsByName( 'format_guid' );
for( n in radios ){ldelim}
var el = radios[n];
if( el.type == 'radio' ){ldelim}
el.onclick = el.value == 'bithtml'?BitCK.CKall:BitCK.unCKifyAll;
{rdelim}
{rdelim}
{rdelim};
/* services */
BitCK.prepRequest = function(formid) {ldelim}
if( typeof( CKeditorAPI ) != 'undefined' ){ldelim}
var ck = CKeditorAPI.GetInstance( 'commentpost' );
if( ck ){ldelim}
ck.UpdateLinkedField();
{rdelim}
{rdelim}
{rdelim};
if ( typeof(LibertyComment) != 'undefined' ) {ldelim}
if( typeof(LibertyComment.prepRequestSrvc) != 'undefined' ) {ldelim}
LibertyComment.prepRequestSrvc.push( BitCK.prepRequest );
{rdelim}
{rdelim}
/* init */
{if ( $contentObject->isValid() && $contentObject->mInfo.format_guid eq 'bithtml' ) ||
(!$contentObject->isValid() && $gBitSystem->getConfig( 'default_format' ) eq 'bithtml')
}
BitBase.addLoadHook( BitCK.CKall );
{else}
BitBase.addLoadHook( BitCK.bindFormatListener );
{/if}
/*]]>*/</script>
{/if}
{*/strip*}
|