JavaScript-Writer

 view release on metacpan or  search on metacpan

doc/slides/takahashi.css  view on Meta::CPAN

        width: 0 !important;
        overflow: hidden !important;
}

#pages-list-button {
        min-width: 0;
}
#pages-list-button > label {
        display: none;
}
#pages-list-button menupopup {
        max-width: 20em;
}
#pages-list-button menuitem image {
        max-width: 32px;
        max-height: 32px;
}




doc/slides/takahashi.xul  view on Meta::CPAN

                                observes="canForward"/>
                        <toolbarseparator/>
                        <hbox align="center">
                                <textbox id="current_page" size="4"
                                        oninput="if (this.value) Presentation.showPage(parseInt(this.value)-1);"/>
                                <toolbarbutton id="pages-list-button"
                                        type="menu"
                                        label="Select Page"
                                        tooltiptext="Select Page"
                                        class="dropmarker-button">
                                        <menupopup id="pages-list"
                                                onpopupshowing="if (event.target == this) Presentation.preventToShowHideToolbar = true;"
                                                onpopuphiding="if (event.target == this) Presentation.preventToShowHideToolbar = false;"
                                                oncommand="Presentation.showPage(parseInt(event.target.value));"/>
                                </toolbarbutton>
                                <description value="/"/>
                                <description id="max_page"/>
                        </hbox>
                        <toolbarseparator/>
                        <vbox flex="2">
                                <spacer flex="1"/>
                                <scrollbar id="scroller"
                                        align="center" orient="horizontal"

doc/slides/takahashi.xul  view on Meta::CPAN

                        <toolbarseparator/>
                        <toolbarbutton label="Pen"
                                id="penButton"
                                type="checkbox"
                                autoCheck="false"
                                oncommand="StrokablePresentationService.toggleCheck();"/>
                        <spacer flex="1"/>
                        <toolbarbutton id="func-menu-button"
                                type="menu"
                                label="Function">
                                <menupopup
                                        onpopupshowing="Presentation.preventToShowHideToolbar = true;"
                                        onpopuphiding="Presentation.preventToShowHideToolbar = false;">
                                        <menuitem label="Set Timer"
                                                oncommand="Presentation.setTimer();" />
                                        <menuseparator/>
                                        <menuitem label="Start Auto-Cruise"
                                                id="autoButton"
                                                type="checkbox"
                                                autoCheck="false"
                                                oncommand="Presentation.toggleAutoCruiseMode();" />
                                        <menu id="auto-interval-button"
                                                label="Change Interval">
                                                <menupopup id="auto-interval-list"
                                                        onpopupshowing="(this.getElementsByAttribute('value', Presentation.autoCruiseInterval)[0] || this.lastChild).setAttribute('checked', true);"
                                                        oncommand="Presentation.changeAutoCruiseInterval(parseInt(event.target.value));">
                                                        <menuitem type="radio" radiogroup="autocruise-interval"
                                                                label="1 sec" value="1000"/>
                                                        <menuitem type="radio" radiogroup="autocruise-interval"
                                                                label="2 sec" value="2000"/>
                                                        <menuitem type="radio" radiogroup="autocruise-interval"
                                                                label="3 sec" value="3000"/>
                                                        <menuitem type="radio" radiogroup="autocruise-interval"
                                                                label="4 sec" value="4000"/>
                                                        <menuitem type="radio" radiogroup="autocruise-interval"

doc/slides/takahashi.xul  view on Meta::CPAN

                                                                        var current = Presentation.autoCruiseInterval;
                                                                        var val = parseInt(prompt('input interval (sec)', parseInt(current/1000)));
                                                                        if (isNaN(val)) {
                                                                                event.preventBubble();
                                                                                return;
                                                                        }
                                                                        else
                                                                                val = val * 1000;
                                                                        this.value = val;
                                                                "/>
                                                </menupopup>
                                        </menu>
                                        <menuseparator/>
                                        <menuitem oncommand="Presentation.print();" label="Print"/>
                                        <menu id="auto-interval-button"
                                                label="Thumbnail Format">
                                                <menupopup
                                                        onpopupshowing="(this.getElementsByAttribute('value', Presentation.imageType)[0] || this.firstChild).setAttribute('checked', true);"
                                                        oncommand="Presentation.imageType = event.target.value;">
                                                        <menuitem type="radio" radiogroup="print-image-type"
                                                                label="PNG" value="png"/>
                                                        <menuitem type="radio" radiogroup="print-image-type"
                                                                label="JPEG (50%)" value="jpeg"/>
                                                </menupopup>
                                        </menu>
                                        <menuseparator/>
                                        <menuitem id="toggleEva" label="Eva Mode"
                                                type="checkbox"
                                                autoCheck="false"
                                                oncommand="Presentation.toggleEvaMode();"/>
                                </menupopup>
                        </toolbarbutton>
                        <toolbarseparator/>
                        <toolbarbutton label="Edit"
                                oncommand="Presentation.toggleEditMode();"/>
                        <toolbarbutton oncommand="Presentation.reload();" label="Reload"/>
                </toolbar>
        </toolbox>
        <vbox flex="1" id="canvas">
                <stack flex="1">
                        <vbox flex="1">

doc/slides/takahashi.xul  view on Meta::CPAN

                </stack>
        </hbox>
</vbox>


<vbox flex="1" id="edit">
        <toolbox>
                <toolbar>
                        <menubar flex="1">
                                <menu label="File">
                                        <menupopup>
                                                <menuitem label="Save"
                                                        key="key_save"
                                                        oncommand="Presentation.output()"/>
                                                <menuitem label="Reload"
                                                        key="key_reload"
                                                        oncommand="Presentation.reload()"/>
                                        </menupopup>
                                </menu>
                                <menu label="Insert">
                                        <menupopup>
                                                <menuitem label="New Page"
                                                        key="key_insert_newpage"
                                                        oncommand="Presentation.insert('page')"/>
                                                <menuseparator/>
                                                <menuitem label="Header"
                                                        oncommand="Presentation.insert('header')"/>
                                                <menuitem label="Footer"
                                                        oncommand="Presentation.insert('footer')"/>
                                                <menuseparator/>
                                                <menuitem label="Link"
                                                        oncommand="Presentation.insert('link')"/>
                                                <menuitem label="Emphasis"
                                                        oncommand="Presentation.insert('em')"/>
                                                <menuitem label="Preformatted"
                                                        oncommand="Presentation.insert('pre')"/>
                                                <menuitem label="Monta"
                                                        oncommand="Presentation.insert('monta')"/>
                                                <menuitem label="Image"
                                                        oncommand="Presentation.insert('img')"/>
                                        </menupopup>
                                </menu>
                        </menubar>
                        <toolbarseparator/>
                        <toolbarbutton label="View"
                                oncommand="Presentation.toggleEditMode();"/>
                        <toolbarbutton oncommand="Presentation.reload();" label="Reload"/>
                </toolbar>
        </toolbox>
        <textbox id="textField" flex="1" multiline="true"
                oninput="Presentation.onEdit()"/>

doc/slides/takahashi.xul  view on Meta::CPAN

                var plainTextRegExp = this.makePhraseRegExp('(%O%O\#[^:]+:(.+)%C%C|%O%OEM:(.+)(:EM)?%C%C|%O%OPRE:(.+)(:PRE)?%C%C|%O%Oima?ge? +src="[^"]*"[^%C]+%C%C|%O%O([^\\|%C]+)(\\|[^%C]+)?%C%C|%O([^%O]+)%C)', 'gi');

                var hiddenRegExp = /^(HIDDEN|IGNORE)::true\n?/im;

                var loadRegExp = /^LOAD::(.+)\n?/im;

                var dataObj;
                var i, j,
                        max = this._data.length;
                var fragment = document.createDocumentFragment();
                var popup;
                var dataPath;
                for (i = 0; i < max; i++)
                {
                        image_src = null;
                        align     = null;
                        dataPath  = '';

                        this._data[i] = this._data[i]
                                .replace(regexp[0], '')
                                .replace(regexp[1], '')

doc/slides/takahashi.xul  view on Meta::CPAN

                                                        .replace(plainTextRegExp, '$2$3$5$7$9')
                                                        .split('\n');
                        if (title !== void(0))
                                this._data[i].title = title;

                        this._data[i].chapter = chapter || title || '';
                        if (lastChapter === void(0) ||
                                lastChapter != this._data[i].chapter) {
                                lastChapter = this._data[i].chapter;

                                if (popup && popup.childNodes.length == 1) {
                                        fragment.removeChild(fragment.lastChild);
                                        fragment.appendChild(popup.removeChild(popup.lastChild));
                                }

                                popup = document.createElement('menupopup');
                                fragment.appendChild(document.createElement('menu'));
                                fragment.lastChild.setAttribute('label', this._data[i].chapter);
                                fragment.lastChild.appendChild(popup);
                        }

                        popup.appendChild(document.createElement('menuitem'));
                        popup.lastChild.setAttribute('type', 'radio');
                        popup.lastChild.setAttribute('radiogroup', 'pages');
                        popup.lastChild.setAttribute('label', (i+1)+': '+(
                                (this._data[i].plain.join('') || this._data[i].text.join(' ')).replace(/\s+/g, ' ')
                        ));
                        popup.lastChild.setAttribute('value', i);

//                      if (image_src) {
//                              popup.lastChild.setAttribute('image', image_src);
//                              popup.lastChild.setAttribute('class', 'menuitem-iconic');
//                      }
                }

                if (fragment.childNodes.length == 1) {
                        range.selectNodeContents(fragment.firstChild.firstChild);
                        fragment = range.extractContents();
                }
                this.list.appendChild(fragment);

                range.detach();

doc/slides/yapcasia2008.css  view on Meta::CPAN

        width: 0 !important;
        overflow: hidden !important;
}

#pages-list-button {
        min-width: 0;
}
#pages-list-button > label {
        display: none;
}
#pages-list-button menupopup {
        max-width: 20em;
}
#pages-list-button menuitem image {
        max-width: 32px;
        max-height: 32px;
}




doc/slides/yapcasia2008.xul  view on Meta::CPAN

                                observes="canForward"/>
                        <toolbarseparator/>
                        <hbox align="center">
                                <textbox id="current_page" size="4"
                                        oninput="if (this.value) Presentation.showPage(parseInt(this.value)-1);"/>
                                <toolbarbutton id="pages-list-button"
                                        type="menu"
                                        label="Select Page"
                                        tooltiptext="Select Page"
                                        class="dropmarker-button">
                                        <menupopup id="pages-list"
                                                onpopupshowing="if (event.target == this) Presentation.preventToShowHideToolbar = true;"
                                                onpopuphiding="if (event.target == this) Presentation.preventToShowHideToolbar = false;"
                                                oncommand="Presentation.showPage(parseInt(event.target.value));"/>
                                </toolbarbutton>
                                <description value="/"/>
                                <description id="max_page"/>
                        </hbox>
                        <toolbarseparator/>
                        <vbox flex="2">
                                <spacer flex="1"/>
                                <scrollbar id="scroller"
                                        align="center" orient="horizontal"

doc/slides/yapcasia2008.xul  view on Meta::CPAN

                        <toolbarseparator/>
                        <toolbarbutton label="Pen"
                                id="penButton"
                                type="checkbox"
                                autoCheck="false"
                                oncommand="StrokablePresentationService.toggleCheck();"/>
                        <spacer flex="1"/>
                        <toolbarbutton id="func-menu-button"
                                type="menu"
                                label="Function">
                                <menupopup
                                        onpopupshowing="Presentation.preventToShowHideToolbar = true;"
                                        onpopuphiding="Presentation.preventToShowHideToolbar = false;">
                                        <menuitem label="Set Timer"
                                                oncommand="Presentation.setTimer();" />
                                        <menuseparator/>
                                        <menuitem label="Start Auto-Cruise"
                                                id="autoButton"
                                                type="checkbox"
                                                autoCheck="false"
                                                oncommand="Presentation.toggleAutoCruiseMode();" />
                                        <menu id="auto-interval-button"
                                                label="Change Interval">
                                                <menupopup id="auto-interval-list"
                                                        onpopupshowing="(this.getElementsByAttribute('value', Presentation.autoCruiseInterval)[0] || this.lastChild).setAttribute('checked', true);"
                                                        oncommand="Presentation.changeAutoCruiseInterval(parseInt(event.target.value));">
                                                        <menuitem type="radio" radiogroup="autocruise-interval"
                                                                label="1 sec" value="1000"/>
                                                        <menuitem type="radio" radiogroup="autocruise-interval"
                                                                label="2 sec" value="2000"/>
                                                        <menuitem type="radio" radiogroup="autocruise-interval"
                                                                label="3 sec" value="3000"/>
                                                        <menuitem type="radio" radiogroup="autocruise-interval"
                                                                label="4 sec" value="4000"/>
                                                        <menuitem type="radio" radiogroup="autocruise-interval"

doc/slides/yapcasia2008.xul  view on Meta::CPAN

                                                                        var current = Presentation.autoCruiseInterval;
                                                                        var val = parseInt(prompt('input interval (sec)', parseInt(current/1000)));
                                                                        if (isNaN(val)) {
                                                                                event.preventBubble();
                                                                                return;
                                                                        }
                                                                        else
                                                                                val = val * 1000;
                                                                        this.value = val;
                                                                "/>
                                                </menupopup>
                                        </menu>
                                        <menuseparator/>
                                        <menuitem oncommand="Presentation.print();" label="Print"/>
                                        <menu id="auto-interval-button"
                                                label="Thumbnail Format">
                                                <menupopup
                                                        onpopupshowing="(this.getElementsByAttribute('value', Presentation.imageType)[0] || this.firstChild).setAttribute('checked', true);"
                                                        oncommand="Presentation.imageType = event.target.value;">
                                                        <menuitem type="radio" radiogroup="print-image-type"
                                                                label="PNG" value="png"/>
                                                        <menuitem type="radio" radiogroup="print-image-type"
                                                                label="JPEG (50%)" value="jpeg"/>
                                                </menupopup>
                                        </menu>
                                        <menuseparator/>
                                        <menuitem id="toggleEva" label="Eva Mode"
                                                type="checkbox"
                                                autoCheck="false"
                                                oncommand="Presentation.toggleEvaMode();"/>
                                </menupopup>
                        </toolbarbutton>
                        <toolbarseparator/>
                        <toolbarbutton label="Edit"
                                oncommand="Presentation.toggleEditMode();"/>
                        <toolbarbutton oncommand="Presentation.reload();" label="Reload"/>
                </toolbar>
        </toolbox>
        <vbox flex="1" id="canvas">
                <stack flex="1">
                        <vbox flex="1">

doc/slides/yapcasia2008.xul  view on Meta::CPAN

                </stack>
        </hbox>
</vbox>


<vbox flex="1" id="edit">
        <toolbox>
                <toolbar>
                        <menubar flex="1">
                                <menu label="File">
                                        <menupopup>
                                                <menuitem label="Save"
                                                        key="key_save"
                                                        oncommand="Presentation.output()"/>
                                                <menuitem label="Reload"
                                                        key="key_reload"
                                                        oncommand="Presentation.reload()"/>
                                        </menupopup>
                                </menu>
                                <menu label="Insert">
                                        <menupopup>
                                                <menuitem label="New Page"
                                                        key="key_insert_newpage"
                                                        oncommand="Presentation.insert('page')"/>
                                                <menuseparator/>
                                                <menuitem label="Header"
                                                        oncommand="Presentation.insert('header')"/>
                                                <menuitem label="Footer"
                                                        oncommand="Presentation.insert('footer')"/>
                                                <menuseparator/>
                                                <menuitem label="Link"
                                                        oncommand="Presentation.insert('link')"/>
                                                <menuitem label="Emphasis"
                                                        oncommand="Presentation.insert('em')"/>
                                                <menuitem label="Preformatted"
                                                        oncommand="Presentation.insert('pre')"/>
                                                <menuitem label="Monta"
                                                        oncommand="Presentation.insert('monta')"/>
                                                <menuitem label="Image"
                                                        oncommand="Presentation.insert('img')"/>
                                        </menupopup>
                                </menu>
                        </menubar>
                        <toolbarseparator/>
                        <toolbarbutton label="View"
                                oncommand="Presentation.toggleEditMode();"/>
                        <toolbarbutton oncommand="Presentation.reload();" label="Reload"/>
                </toolbar>
        </toolbox>
        <textbox id="textField" flex="1" multiline="true"
                oninput="Presentation.onEdit()"/>

doc/slides/yapcasia2008.xul  view on Meta::CPAN

                var plainTextRegExp = this.makePhraseRegExp('(%O%O\#[^:]+:(.+)%C%C|%O%OEM:(.+)(:EM)?%C%C|%O%OPRE:(.+)(:PRE)?%C%C|%O%Oima?ge? +src="[^"]*"[^%C]+%C%C|%O%O([^\\|%C]+)(\\|[^%C]+)?%C%C|%O([^%O]+)%C)', 'gi');

                var hiddenRegExp = /^(HIDDEN|IGNORE)::true\n?/im;

                var loadRegExp = /^LOAD::(.+)\n?/im;

                var dataObj;
                var i, j,
                        max = this._data.length;
                var fragment = document.createDocumentFragment();
                var popup;
                var dataPath;
                for (i = 0; i < max; i++)
                {
                        image_src = null;
                        align     = null;
                        dataPath  = '';

                        this._data[i] = this._data[i]
                                .replace(regexp[0], '')
                                .replace(regexp[1], '')

doc/slides/yapcasia2008.xul  view on Meta::CPAN

                                                        .replace(plainTextRegExp, '$2$3$5$7$9')
                                                        .split('\n');
                        if (title !== void(0))
                                this._data[i].title = title;

                        this._data[i].chapter = chapter || title || '';
                        if (lastChapter === void(0) ||
                                lastChapter != this._data[i].chapter) {
                                lastChapter = this._data[i].chapter;

                                if (popup && popup.childNodes.length == 1) {
                                        fragment.removeChild(fragment.lastChild);
                                        fragment.appendChild(popup.removeChild(popup.lastChild));
                                }

                                popup = document.createElement('menupopup');
                                fragment.appendChild(document.createElement('menu'));
                                fragment.lastChild.setAttribute('label', this._data[i].chapter);
                                fragment.lastChild.appendChild(popup);
                        }

                        popup.appendChild(document.createElement('menuitem'));
                        popup.lastChild.setAttribute('type', 'radio');
                        popup.lastChild.setAttribute('radiogroup', 'pages');
                        popup.lastChild.setAttribute('label', (i+1)+': '+(
                                (this._data[i].plain.join('') || this._data[i].text.join(' ')).replace(/\s+/g, ' ')
                        ));
                        popup.lastChild.setAttribute('value', i);

//                      if (image_src) {
//                              popup.lastChild.setAttribute('image', image_src);
//                              popup.lastChild.setAttribute('class', 'menuitem-iconic');
//                      }
                }

                if (fragment.childNodes.length == 1) {
                        range.selectNodeContents(fragment.firstChild.firstChild);
                        fragment = range.extractContents();
                }
                this.list.appendChild(fragment);

                range.detach();



( run in 0.688 second using v1.01-cache-2.11-cpan-364913b4093 )