Commits

Anonymous committed fe70b06

show prim info in title and header. filter restyling. hide broken images

  • Participants
  • Parent commits 8b9e497

Comments (0)

Files changed (3)

       {{if thumb}}<img class="thumb" src="http://secondlife.com/app/image/${thumb}/1" />{{/if}}
     </div>
   </script>
-  <script type="text/html" charset="utf-8">
-    <h2>${name}</h2>
+  <script id="title_tmpl" type="text/html" charset="utf-8">
+    <h2>${objname}</h2>
   </script>
   <!--END TEMPLATES-->
   
 <div id="header">
   <div id="title"></div>
   <section id="options" class="clearfix"> 
-      <h3>Filters</h3> 
  
       <ul id="filters" class="option-set clearfix" data-option-key="filter"> 
         <li><a href="#filter" data-filter=":not(.hidden)" class="selected">default</a></li>

File schmarchive.css

 #options li a {
   display: block;
   padding: 0.4em 0.5em;
-  background-color: #DDD;
-  color: #222;
+  background-color: #222;
+  color: #DDD;
   font-weight: bold;
   text-decoration: none;
-  text-shadow: 0 1px hsla( 0, 0%, 100%, 0.5 );
+  text-shadow: 0 -1px hsla( 0, 0%, 0%, 0.5 );
   background-image: -moz-linear-gradient( -90deg, 
     hsla( 0, 0%, 100%, 0.5 ) , 
     hsla( 0, 0%, 100%, 0.0 ) 
 }
 
 #options li a:hover {
-  background-color: #5BF;
+  background-color: #256600;
   text-decoration: none;
 }
 
 #options li a:active {
   text-decoration: none;
-  background-color: #39D;
+  background-color: #256600;
   -webkit-box-shadow: inset 0 2px 8px hsla( 0, 0%, 0%, 0.6 );
      -moz-box-shadow: inset 0 2px 8px hsla( 0, 0%, 0%, 0.6 );
        -o-box-shadow: inset 0 2px 8px hsla( 0, 0%, 0%, 0.6 );
 }
 
 #options li:first-child a {
-  border-radius: 7px 0 0 7px;
+  border-radius: 3px 0 0 3px;
   border-left: none;
 }
 
 #options li:last-child a {
-  border-radius: 0 7px 7px 0;
+  border-radius: 0 3px 3px 0;
 }
 
 #options li a.selected {
-  background-color: #13F;
+  background-color: #eee;
   text-shadow: none;
-  color: white;
+  color: #222;
+  -webkit-box-shadow: inset 0 2px 8px hsla( 0, 0%, 0%, 0.6 );
+     -moz-box-shadow: inset 0 2px 8px hsla( 0, 0%, 0%, 0.6 );
+       -o-box-shadow: inset 0 2px 8px hsla( 0, 0%, 0%, 0.6 );
+          box-shadow: inset 0 2px 8px hsla( 0, 0%, 0%, 0.6 );
 }
 
 /* Combination filter options*/

File schmarchive.js

     invPath: '/inv/',
     givePath: '/give/',
     itemTmpl: '#item_tmpl',
+    titleTmpl: '#title_tmpl',
+    titleContainer: '#title',
     getButton: '.get',
     filters: '#filters a',
     init: function(frame_selector) {
 
               // request the prim info
               this.request(this.buildURL(this.infoPath), this.onInfo, this);
+
           },
     
     buildURL: function(path) {
         pane.data('info', item);
       }
 
+      // hide broken images (any SL image with alpha in it will have no
+      // search.secondlife.com thumbnail)
+      $('img.thumb').error(function(ev) {
+              //console.log(ev);
+              $(this).hide();
+          });
       // call the isotope plugin on the frame
       $(this.frame).isotope({
         // options
         // change highlighting on the filter bar
         $(self.filters + '.selected').removeClass('selected');
         $(this).addClass('selected');
+    },
+
+    onInfo: function(info) {
+      // update the header
+      $(this.titleTmpl).tmpl(info).appendTo(this.titleContainer);
+      // update the actual page title
+      $.tmpl('<title>${objname}</title>', info).appendTo('head');
+      console.log(info);
     }
 };