Skip to content

Commit

Permalink
Use -moz-image-region, compine 14 PNG files to 3 PNG files.
Browse files Browse the repository at this point in the history
  • Loading branch information
littlebtc committed May 19, 2011
1 parent 3a6de29 commit 7cb83e1
Show file tree
Hide file tree
Showing 24 changed files with 42 additions and 21 deletions.
2 changes: 0 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ echo "Generating directories..."
mkdir build
mkdir build/content
mkdir build/skin
mkdir build/skin/tools
mkdir build/components
mkdir build/modules
mkdir build/defaults
Expand All @@ -22,7 +21,6 @@ echo "Copy files..."
cp install.rdf chrome.manifest LICENSE.md build/
cp content/*.js content/*.xul content/*.xml content/*.swf build/content/
cp skin/*.css skin/*.png build/skin/
cp skin/tools/*.png build/skin/tools/
cp components/*.js build/components/
cp modules/*.jsm build/modules/
cp defaults/preferences/*.js build/defaults/preferences/
Expand Down
2 changes: 1 addition & 1 deletion content/firefoxOverlay1.9.xul
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
</hbox>
<statusbarpanel id="nicofoxStatusbarContainer" onclick="event.stopPropagation(); document.getElementById('nicofox-library').hidden = false; document.getElementById('nicofox-library').openPopup(this, 'before_end', 0, 0, false, false);">
<!-- For rein skin compatibility -->
<image id="nicofox-icon" src="chrome://nicofox/skin/logo_16.png"/>
<image id="nicofox-icon" />
<label id="nicofoxStatusbarLabel" hidden="true" />
</statusbarpanel>
</statusbar>
Expand Down
7 changes: 4 additions & 3 deletions content/options.xul
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://mozapps/content/preferences/preferences.css"?>
<?xml-stylesheet href="chrome://browser/skin/preferences/preferences.css"?>
<?xml-stylesheet href="chrome://nicofox/skin/smilefox.css" type="text/css"?>
<!DOCTYPE prefwindow [
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd" >
%brandDTD;
Expand All @@ -11,7 +12,7 @@
<prefwindow id="nicofoxPreferences" xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="&prefwindow.title;" width="600" style="height: 45em;">
<prefpane id="pane1" label="&nicomonkey;" onpaneload="updatePanel1();" image="chrome://nicofox/skin/nicofox_content.png">
<prefpane id="pane1" label="&nicomonkey;" onpaneload="updatePanel1();">
<script type="application/x-javascript" src="chrome://nicofox/content/options_panel1.js" />
<preferences>
<preference id="pref-nicomonkey.sound_converter" name="extensions.nicofox.nicomonkey.sound_converter" type="string"/>
Expand All @@ -29,7 +30,7 @@
</menulist>
</hbox>
</prefpane>
<prefpane id="pane2" label="&downloader;" onpaneload="updatePanel2();" image="chrome://nicofox/skin/nicofox_downloader.png">
<prefpane id="pane2" label="&downloader;" onpaneload="updatePanel2();">
<script type="application/x-javascript" src="chrome://nicofox/content/options_panel2.js" />
<preferences>
<preference id="pref-save_path" name="extensions.nicofox.save_path" type="file"/>
Expand Down Expand Up @@ -121,7 +122,7 @@
</hbox>
</groupbox>
</prefpane>
<prefpane id="pane3" label="&video_player;" onpaneload="updatePanel3();" image="chrome://nicofox/skin/nicofox_player.png">
<prefpane id="pane3" label="&video_player;" onpaneload="updatePanel3();">
<script type="application/x-javascript" src="chrome://nicofox/content/options_panel3.js" />
<preferences>
<preference id="pref-external_video_player" name="extensions.nicofox.external_video_player" type="bool" onchange="updateVideoPlayer();"/>
Expand Down
26 changes: 13 additions & 13 deletions content/smilefoxPanel.xul
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
<description flex="1">When you enter the video page, download button, global sites and third-party tools will be displayed here.</description>
<label value="Go to Nico Nico Douga in the specific region:" />
<hbox id="nicofox-not-watching-toolbar">
<image src="chrome://nicofox/skin/tools/jp.png" class="smilefoxToolItem"
<image style="-moz-image-region: rect(0px 16px 11px 0px);" class="smilefoxToolItem"
onclick="nicofox.panel.videoTools.goSite(event, 'www');" />
<image src="chrome://nicofox/skin/tools/tw.png" class="smilefoxToolItem"
<image style="-moz-image-region: rect(0px 32px 11px 16px);" class="smilefoxToolItem"
onclick="nicofox.panel.videoTools.goSite(event, 'tw');" />
<image src="chrome://nicofox/skin/tools/es.png" class="smilefoxToolItem"
<image style="-moz-image-region: rect(0px 48px 11px 32px);" class="smilefoxToolItem"
onclick="nicofox.panel.videoTools.goSite(event, 'es');" />
<image src="chrome://nicofox/skin/tools/de.png" class="smilefoxToolItem"
<image style="-moz-image-region: rect(0px 64px 11px 48px);" class="smilefoxToolItem"
onclick="nicofox.panel.videoTools.goSite(event, 'de');" />
</hbox>
<description>Below are your recently download items.</description>
Expand All @@ -43,7 +43,7 @@
<vbox flex="1">
<label id="nicofox-watching-title" crop="end" />
<hbox>
<button id="nicofox-watching-download" label="Download" image="chrome://nicofox/skin/tools/download.png"
<button id="nicofox-watching-download" label="Download" style="list-style-image: url('chrome://nicofox/skin/toolbar_sprite.png'); -moz-image-region: rect(11px 60px 23px 48px);"
oncommand="nicofox.panel.videoTools.download();"/>
<!--<button id="nicofox-watching-add-tags" label="Add tags..." />-->
</hbox>
Expand All @@ -55,25 +55,25 @@
<rows>
<row>
<label value="This Video Worldwide:" />
<hbox>
<image src="chrome://nicofox/skin/tools/jp.png" class="smilefoxToolItem"
<hbox align="center">
<image style="-moz-image-region: rect(0px 16px 11px 0px);" class="smilefoxToolItem"
onclick="nicofox.panel.videoTools.goSite(event, 'www');" />
<image src="chrome://nicofox/skin/tools/tw.png" class="smilefoxToolItem"
<image style="-moz-image-region: rect(0px 32px 11px 16px);" class="smilefoxToolItem"
onclick="nicofox.panel.videoTools.goSite(event, 'tw');" />
<image src="chrome://nicofox/skin/tools/es.png" class="smilefoxToolItem"
<image style="-moz-image-region: rect(0px 48px 11px 32px);" class="smilefoxToolItem"
onclick="nicofox.panel.videoTools.goSite(event, 'es');" />
<image src="chrome://nicofox/skin/tools/de.png" class="smilefoxToolItem"
<image style="-moz-image-region: rect(0px 64px 11px 48px);" class="smilefoxToolItem"
onclick="nicofox.panel.videoTools.goSite(event, 'de');" />
</hbox>
</row>
<row>
<label value="Third-party Tools:" />
<hbox>
<image src="chrome://nicofox/skin/tools/music.png" class="smilefoxToolItem"
<image style="-moz-image-region: rect(11px 16px 27px 0px);" class="smilefoxToolItem"
onclick="nicofox.panel.videoTools.goThridPartyToolSite(event, 'sound');" />
<image src="chrome://nicofox/skin/tools/chart.png" class="smilefoxToolItem"
<image style="-moz-image-region: rect(11px 32px 27px 16px);" class="smilefoxToolItem"
onclick="nicofox.panel.videoTools.goThridPartyToolSite(event, 'chart');" />
<image src="chrome://nicofox/skin/tools/comment.png" class="smilefoxToolItem" id="nicofox-watching-comment-tool"
<image style="-moz-image-region: rect(11px 48px 27px 32px);" class="smilefoxToolItem" id="nicofox-watching-comment-tool"
onclick="nicofox.panel.videoTools.goThridPartyToolSite(event, 'comment');" />
</hbox>
</row>
Expand Down
Binary file removed skin/logo_16.png
Binary file not shown.
Binary file removed skin/logo_16_mac.png
Binary file not shown.
Binary file added skin/logo_16_sprite.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed skin/logo_16_win.png
Binary file not shown.
Binary file removed skin/nicofox_content.png
Binary file not shown.
Binary file removed skin/nicofox_downloader.png
Binary file not shown.
Binary file removed skin/nicofox_player.png
Binary file not shown.
Binary file added skin/options_sprite.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions skin/smilefox.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ richlistitem[type="smilefox"]:not([selected="true"]):nth-child(odd) {
richlistitem[type="smilefox"][sfstatus="7"] {
-moz-binding: url("chrome://nicofox/content/smilefoxPanel.xml#smilefox-download-downloading");
}
#nicofox-icon {
list-style-image: url("chrome://nicofox/skin/logo_16_sprite.png");
-moz-image-region: rect(0px 16px 16px 0px);
}

#nicofox-library {
list-style-image: none;
background: white;
Expand Down Expand Up @@ -51,6 +56,7 @@ richlistitem[type="smilefox"][sfstatus="7"] {
.smilefoxToolItem {
margin: 3px;
cursor: pointer;
list-style-image: url("chrome://nicofox/skin/toolbar_sprite.png");
}

.smilefoxDownloadThumbnail {
Expand All @@ -69,3 +75,17 @@ richlistitem[type="smilefox"][sfstatus="7"] {
background: InfoBackground;
color: InfoText;
}

radio[pane] {
list-style-image: url(chrome://nicofox/skin/options_sprite.png);
}

radio[pane=pane1] {
-moz-image-region: rect(0px 32px 32px 0px);
}
radio[pane=pane2] {
-moz-image-region: rect(0px 64px 32px 32px);
}
radio[pane=pane3] {
-moz-image-region: rect(0px 96px 32px 64px);
}
3 changes: 2 additions & 1 deletion skin/toolbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@

#nicofox-toolbar-button {
-moz-box-orient: horizontal;
list-style-image: url("chrome://nicofox/skin/logo_16_win.png");
list-style-image: url("chrome://nicofox/skin/logo_16_sprite.png");
-moz-image-region: rect(0px 48px 16px 32px);
}
3 changes: 2 additions & 1 deletion skin/toolbarMac.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@

#nicofox-toolbar-button {
-moz-box-orient: horizontal;
list-style-image: url("chrome://nicofox/skin/logo_16_mac.png");
list-style-image: url("chrome://nicofox/skin/logo_16_sprite.png");
-moz-image-region: rect(0px 48px 16px 32px);
}
Binary file added skin/toolbar_sprite.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed skin/tools/chart.png
Binary file not shown.
Binary file removed skin/tools/comment.png
Binary file not shown.
Binary file removed skin/tools/de.png
Binary file not shown.
Binary file removed skin/tools/download.png
Binary file not shown.
Binary file removed skin/tools/es.png
Binary file not shown.
Binary file removed skin/tools/jp.png
Binary file not shown.
Binary file removed skin/tools/music.png
Binary file not shown.
Binary file removed skin/tools/tw.png
Binary file not shown.

0 comments on commit 7cb83e1

Please sign in to comment.