codemirror_shared_head

NAML documentation   Watch a video
Error Found
An error was found in the NAML code of this application – View Details | Go to NAML Editor
tag (custom_tweak:send_subscription_email:14) - <set_headers_for.local_node/> is not allowed here, only tags <cc>, , <html_part>, <text_part>, <bcc>, <attachments>, <aol_part>, <to_name>, <subject>, <bounce_to>, <from>, <to>, <from_name> are allowed here in tag element 'send'
  in send(custom_tweak:send_subscription_email:6) - <n.send> - public void nabble.view.web.template.EmailNamespace.send(nabble.naml.compiler.IPrintWriter,nabble.naml.compiler.Interpreter) throws nabble.model.ModelException$EmailFormat
  in new_email(custom_tweak:send_subscription_email:5) - <n.new_email.> - public void nabble.view.web.template.NabbleNamespace.new_email(nabble.naml.compiler.IPrintWriter,nabble.naml.compiler.ScopedInterpreter)
  in block(custom_tweak:send_subscription_email:4) - <n.block.> - public void nabble.naml.namespaces.BasicNamespace.block(nabble.naml.compiler.IPrintWriter,nabble.naml.compiler.ScopedInterpreter)
  in send_subscription_email(nabble:reply.naml:500) - <n.send_subscription_email node_attr="[n.node_attr/]">
  in send_node_as_email_to_user(nabble:reply.naml:488) - <n.send_node_as_email_to_user.local_node/>
  in subscription_for(nabble:reply.naml:487) - <n.subscription_for. email="[n.var name='email'/]"> - public void nabble.view.web.template.NodeNamespace.subscription_for(nabble.naml.compiler.IPrintWriter,nabble.naml.compiler.ScopedInterpreter) throws nabble.model.ModelException$EmailFormat
  in do(nabble:permissions.naml:139) - <n.topic_node.do/>
  in topic_node(nabble:permissions.naml:139) - <n.topic_node.do/> - public void nabble.view.web.template.NodeNamespace.topic_node(nabble.naml.compiler.IPrintWriter,nabble.naml.compiler.ScopedInterpreter)
  in do(nabble:utilities.naml:1107) - <n.do/>
  in get_node(nabble:utilities.naml:1107) - <n.get_node node="[n.uplevel_var name='local_node'/]" do="[n.do/]" /> - public void nabble.view.web.template.NabbleNamespace.get_node(nabble.naml.compiler.IPrintWriter,nabble.naml.compiler.ScopedInterpreter)
  in local_node(nabble:permissions.naml:139) - <then.local_node.topic_node.do/>
  in if(nabble:permissions.naml:138) - <n.if.local_node.is_post> - public static void nabble.naml.namespaces.BasicNamespace._if(nabble.naml.compiler.IPrintWriter,nabble.naml.compiler.Interpreter)
  in block(nabble:permissions.naml:137) - <n.block.> - public void nabble.naml.namespaces.BasicNamespace.block(nabble.naml.compiler.IPrintWriter,nabble.naml.compiler.ScopedInterpreter)
  in topic_or_app(nabble:reply.naml:487) - <n.topic_or_app.subscription_for. email="[n.var name='email'/]">
  in do(nabble:utilities.naml:1107) - <n.do/>
  in get_node(nabble:utilities.naml:1107) - <n.get_node node="[n.uplevel_var name='local_node'/]" do="[n.do/]" /> - public void nabble.view.web.template.NabbleNamespace.get_node(nabble.naml.compiler.IPrintWriter,nabble.naml.compiler.ScopedInterpreter)
  in local_node(nabble:reply.naml:487) - <then.local_node.topic_or_app.subscription_for. email="[n.var name='email'/]">
  in if(nabble:reply.naml:486) - <n.if.not.is_null.var name="email"> - public static void nabble.naml.namespaces.BasicNamespace._if(nabble.naml.compiler.IPrintWriter,nabble.naml.compiler.Interpreter)
  in do(nabble:utilities.naml:865) - <n.do/>
  in while(nabble:utilities.naml:863) - <n.while.next_element inc="[n.by/]"> - public void nabble.naml.namespaces.BasicNamespace._while(nabble.naml.compiler.IPrintWriter,nabble.naml.compiler.Interpreter)
  in loop(nabble:reply.naml:484) - <n.loop.>
  in get_parameter_values(nabble:reply.naml:483) - <then.get_parameter_values. name="email-to"> - public void nabble.view.web.template.RequestNamespace.get_parameter_values(nabble.naml.compiler.IPrintWriter,nabble.naml.compiler.ScopedInterpreter) throws java.io.IOException,javax.servlet.ServletException
  in if(nabble:reply.naml:482) - <n.if.visitor.is_registered> - public static void nabble.naml.namespaces.BasicNamespace._if(nabble.naml.compiler.IPrintWriter,nabble.naml.compiler.Interpreter)
  in block(nabble:reply.naml:481) - <n.block.> - public void nabble.naml.namespaces.BasicNamespace.block(nabble.naml.compiler.IPrintWriter,nabble.naml.compiler.ScopedInterpreter)
  in send_node_as_email(nabble:reply.naml:40) - <n.send_node_as_email/>
  in do(nabble:reply.naml:122) - <n.do/>
  in get_node(nabble:reply.naml:122) - <n.get_node node="[n.global_var name='new_node'/]" do="[n.do/]" /> - public void nabble.view.web.template.NabbleNamespace.get_node(nabble.naml.compiler.IPrintWriter,nabble.naml.compiler.ScopedInterpreter)
  in new_node(nabble:reply.naml:40) - <n.new_node.send_node_as_email/>
  in if(nabble:reply.naml:36) - <n.if.not.is_preview> - public static void nabble.naml.namespaces.BasicNamespace._if(nabble.naml.compiler.IPrintWriter,nabble.naml.compiler.Interpreter)
  in create_child_of_page_node(nabble:reply.naml:28) - <n.create_child_of_page_node commit="[n.not.is_preview/]"> - public void nabble.view.web.template.NodePageNamespace.create_child_of_page_node(nabble.naml.compiler.IPrintWriter,nabble.naml.compiler.ScopedInterpreter) throws nabble.model.ModelException,javax.servlet.ServletException
  in catch_exception(nabble:reply.naml:25) - <n.catch_exception. id="save-block"> - public void nabble.naml.namespaces.BasicNamespace.catch_exception(nabble.naml.compiler.IPrintWriter,nabble.naml.compiler.Interpreter)
  in if(nabble:reply.naml:18) - <n.if.not.is_submitted_form> - public static void nabble.naml.namespaces.BasicNamespace._if(nabble.naml.compiler.IPrintWriter,nabble.naml.compiler.Interpreter)
  in do(nabble:utilities.naml:936) - <n.as_node_page.do/>
  in as_node_page(nabble:utilities.naml:936) - <n.as_node_page.do/> - public void nabble.view.web.template.NodeNamespace.as_node_page(nabble.naml.compiler.IPrintWriter,nabble.naml.compiler.ScopedInterpreter)
  in do(nabble:utilities.naml:941) - <n.get_node_from_request_parameter.do/>
  in get_node_from_request_parameter(nabble:utilities.naml:941) - <n.get_node_from_request_parameter.do/> - public void nabble.view.web.template.ServletNamespace.get_node_from_request_parameter(nabble.naml.compiler.IPrintWriter,nabble.naml.compiler.ScopedInterpreter) throws java.io.IOException,javax.servlet.ServletException,nabble.naml.namespaces.TemplateException
  in catch_exception(nabble:utilities.naml:940) - <n.catch_exception. id="get-node-block"> - public void nabble.naml.namespaces.BasicNamespace.catch_exception(nabble.naml.compiler.IPrintWriter,nabble.naml.compiler.Interpreter)
  in get_node_from_parameter(nabble:utilities.naml:936) - <n.get_node_from_parameter.as_node_page.do/>
  in node_page(nabble:reply.naml:16) - <n.node_page.>
  in new_post(nabble:reply.naml:2) - <n.new_post>
  in (nabble:reply.naml:1) - <macro name="reply" requires="servlet">
   Usages of this macro
... in macro_viewer.naml
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
<macro name="codemirror_shared_head">
    <style type="text/css">
        .CodeMirror-line-numbers {
            font-family: verdana, arial, sans-serif;
            font-size: 11pt;
            width: 2.2em;
            text-align: right;
            padding-right: .3em;
            line-height: normal;
            border-right-width:2px;
            border-right-style:solid;
        }
        #resizebar {
            height:8px;
            background:url('/images/grip.png') #d8d8d8 repeat;
            border:1px solid #aaa;
            cursor:n-resize;
        }
    </style>
    <script src="/util/codemirror/js/codemirror.js"></script>
    <script src="/util/codemirror/js/highlight.js"></script>
    <script src="/util/codemirror/js/stringstream.js"></script>
    <script src="/util/codemirror/js/tokenize.js"></script>
    <script src="/util/codemirror/js/parsexml.js"></script>
    <script type="text/javascript">
        <![CDATA[
        function newEditor(height) {
            var e = CodeMirror.fromTextArea('txt_basic', {
                parserfile: "parsexml.js",
                stylesheet: "/util/codemirror/css/xmlcolors.css",
                path: "/util/codemirror/js/",
                lineNumbers: true,
                height: height,
                indentUnit: 4,
            });
            var $wrapping = $('#txt_basic').next();
            $wrapping.attr('id', 'wrapping_basic');
            $wrapping.css('margin-top', '.4em');
            $wrapping.addClass('medium-border-color border1');
            addResizeBar($wrapping);
            $('div.CodeMirror-line-numbers', $wrapping).addClass('shaded-bg-color medium-border-color');
            return e;
        };
 
        function addResizeBar($wrapping) {
            $wrapping.after('<div id="resizebar"></div>');
 
            var dragging = false;
            function startDrag(e) {
                if ($(e.target).attr('id') == 'resizebar')
                    dragging = true;
                if (dragging && typeof e.preventDefault != 'undefined')
                    e.preventDefault();
            };
            function endDrag(e) {
                dragging = false;
            };
            function drag(e, x, y) {
                e.stopPropagation();
                if (dragging) {
                    var h = y - $wrapping.offset().top - 5;
                    $wrapping.height(h < 100? 100 : h);
                }
            };
            function onSelectStart() {
                if (dragging) return false;
            };
 
            function isCorrectFrame(f) {
                try {
                    frame.document.location.href;
                    return true;
                } catch(err) {
                    return false;
                }
            }
            var index = 0;
            var frame = window.frames[index++];
            while (!isCorrectFrame(frame)) {
                frame = window.frames[index++];
            }
            $(frame.document)
                .mousemove(function(e) {
                    var x = e.pageX + $wrapping.offset().left;
                    var y = e.pageY + $wrapping.offset().top;
                    drag(e, x, y);
                })
                .mouseup(function(e) { endDrag(e); })
                .select(onSelectStart);
 
            $(document)
                .mousemove(function(e) { drag(e, e.pageX, e.pageY); })
                .mousedown(function(e) { startDrag(e); })
                .mouseup(function(e) { endDrag(e); })
                .select(onSelectStart);
        };
        var basicEditor;
        function inlineEditor(height, line, col) {
            if (!basicEditor)
                basicEditor = newEditor(height);
            function showCaret() {
                var $lines = $('#wrapping_basic div.CodeMirror-line-numbers').children();
                if (basicEditor.editor && $lines.size() > 5) {
                    if (line) {
                        if (col) {
                            var ln = basicEditor.nthLine(line);
                            basicEditor.selectLines(ln, col);
                        } else
                            basicEditor.jumpToLine(line);
                    } else
                        basicEditor.jumpToLine(1);
                } else
                    setTimeout(showCaret, 200);
            };
            showCaret();
        };
        function getLineNumber(s, token) {
            var line = 1;
            var pos = s.indexOf(token);
            for (var i=0; i < pos; i++) {
                if (s.charAt(i) == '\n')
                    line++;
            }
            return line;
        };
        function formatError(msg) {
            var h = msg.replace(/</g, "&lt;");
            h = h.replace(/>/g, "&gt;");
            h = h.replace(/\n/g, "<br/>");
            h = h.replace(/(\t)|([ ]{6})/g, "<span style='padding:0 2em'>&nbsp;</span>");
            h = '<img src="/images/icon_alert_sm.png" class="image16"/> ' + h;
            return h;
        };
        ]]>
    </script>
</macro>