~ubuntu-branches/ubuntu/karmic/all-in-one-sidebar/karmic

« back to all changes in this revision

Viewing changes to content/viewsource.xul

  • Committer: Bazaar Package Importer
  • Author(s): Sveinung Kvilhaugsvik
  • Date: 2009-08-04 19:25:10 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090804192510-u4bm1ehm9ve4zdne
Tags: 0.7.10-0ubuntu1
* new upstream release (LP: #398535)
* list firefox-3.5 as alternate dependency
* depend on ${misc:Depends} to fix lintian warning
* changed maintainer field do to change in rules
* merged all-in-one-sidebar 0.7.4-0ubuntu2
   + replace current watchfile with the one from it
   + add the change log entry from it
   + discard it's other changes
* bump standards-version to 3.8.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0"?>
 
2
 
 
3
<!-- skin -->
 
4
<?xml-stylesheet href="chrome://aios/skin/viewsource.css"?>
 
5
<?xml-stylesheet href="chrome://aios/skin/_sbmanager.css"?>
 
6
 
 
7
<!-- locale -->
 
8
<!DOCTYPE overlay [
 
9
        <!ENTITY % aiosDTD SYSTEM "chrome://aios/locale/lib.dtd"> %aiosDTD;
 
10
]>
 
11
 
 
12
<overlay id="viewSourceOverlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
13
 
 
14
        <!-- scripts -->
 
15
        <script type="application/x-javascript" src="chrome://aios/content/_common.js" />
 
16
        <script type="application/x-javascript" src="chrome://aios/content/viewsource.js" />
 
17
 
 
18
        <script><![CDATA[
 
19
 
 
20
                if(top.document.getElementById('sidebar') || top.toString() == "[object Window]") {
 
21
 
 
22
                        window.addEventListener("load", aios_init, false);
 
23
 
 
24
                        var tab = (top.toString() == "[object Window]") ? true : false;
 
25
 
 
26
                        // im Tab vorlauefig nur den Quelltext anzeigen
 
27
                        if(tab) {
 
28
                                var loc = "view-source:" + aios_WIN.aiosLastSelTab.document.location.href;
 
29
                                aios_CONTENT.webNavigation.loadURI(loc, null, null, null, null);
 
30
                        }
 
31
 
 
32
                        // aus dem <browser> ein normales Element ohne 'content-primary' machen
 
33
                        document.getElementById('content').setAttribute('type', 'content');
 
34
 
 
35
                        // Status-Leiste unsichtbar
 
36
                        if(document.getElementById('status-bar')) document.getElementById('status-bar').hidden = true;
 
37
 
 
38
                        // Funktionen modifizieren, um die URL aus dem Browser anstatt einem übergebenem Argument zu entnehmen, ...
 
39
                        onLoadViewSource = function() {
 
40
                                // viewSource(window.arguments[0]);     // Firefox-Variante f. Fenster
 
41
                                aios_viewSource();
 
42
                          document.commandDispatcher.focusedWindow = content;
 
43
                          if(typeof initFindBar != "undefined") initFindBar();
 
44
                        }
 
45
 
 
46
                        // ... und um den 'content' korrekt aus der Sidebar heraus anzusprechen, ...
 
47
                        eval(aios_replaceString(viewSource));
 
48
                        eval(aios_replaceString(onLoadContent));
 
49
                        eval(aios_replaceString(goToLine));
 
50
                        eval(aios_replaceString(updateStatusBar));
 
51
                        eval(aios_replaceString(findLocation));
 
52
                        eval(aios_replaceString(wrapLongLines));
 
53
 
 
54
                        // ... und um die richtigen URLs zum Editieren und Speichern zu verwenden
 
55
                        ViewSourceEditPage = function() {
 
56
                                // editPage(window.content.location.href.substring(12), window, false); // Firefox-Variante f. Fenster
 
57
                                if(tab && aios_WIN.aiosLastSelTab) editPage(aios_WIN.aiosLastSelTab.location.href, window, false);
 
58
                                else editPage(window.content.location.href, window, false);
 
59
                        }
 
60
                        ViewSourceSavePage = function() {
 
61
                                 // saveURL(window.content.location.href.substring(12), null, "SaveLinkTitle"); // Firefox-Variante f. Fenster
 
62
                                 if(tab && aios_WIN.aiosLastSelTab) saveURL(window.content.location.href, null, "SaveLinkTitle");
 
63
                                 else saveURL(aios_WIN.aiosLastSelTab.location.href, null, "SaveLinkTitle");
 
64
                        }
 
65
 
 
66
                        // Listener für automatische Aktualisierung hinzufügen u. entfernen
 
67
                        if(!tab) {
 
68
                                window.addEventListener("load", function(e) {
 
69
                                        if(top.gBrowser.addProgressListener) top.gBrowser.addProgressListener(aiosProgListener, Components.interfaces.nsIWebProgress.NOTIFY_STATE_DOCUMENT);
 
70
                                }, false);
 
71
 
 
72
                                window.addEventListener("unload",function(e) {
 
73
                                        if(top.gBrowser.removeProgressListener) top.gBrowser.removeProgressListener(aiosProgListener);
 
74
                                }, false);
 
75
                        }
 
76
                }
 
77
 
 
78
                ]]>
 
79
        </script>
 
80
 
 
81
 
 
82
        <menubar id="viewSource-main-menubar">
 
83
 
 
84
                <toolbarbutton id="reload-button" class="toolbarbutton-1" type="menu-button" oncommand="aios_viewSource();"
 
85
                        label="&refresh.label;" tooltiptext="&refresh.label;" position="1">
 
86
 
 
87
            <menupopup>
 
88
                <menuitem id="autoReload-mitem" type="checkbox" checked="true" autocheck="false" persist="checked"
 
89
                        label="&refresh.auto.label;" tooltiptext="&refresh.auto.tooltip;"
 
90
                        oncommand="aios_toggleElement(this); aios_onLocationChange(); event.stopPropagation();" />
 
91
            </menupopup>
 
92
 
 
93
           </toolbarbutton>
 
94
 
 
95
           <toolbarseparator id="toolbar-sep" position="2" />
 
96
 
 
97
        </menubar>
 
98
 
 
99
        <menuitem id="menu_highlightSyntax" onmouseup="aios_viewSource();" />
 
100
 
 
101
</overlay>
 
 
b'\\ No newline at end of file'