旧)editBookpermOverlay.js 新)editBookpermOverlay.js
// bookpermProperties.js // bookpermProperties.js
   
var BookPO = { var BookPO = {
 P: ['images', 'metaredirects', 'plugins', 'javascript', 'subframes'],  P: ['images', 'metaredirects', 'plugins', 'javascript', 'subframes'],
 X: 'bookmarkProperties/allow',  X: 'bookmarkProperties/allow',
   
 _onLoad: function() {  _onLoad: function() {
   try {    try {
     eval("gEditItemOverlay._showHideRows ="+gEditItemOverlay._showHideRows.toString().replace(      eval("gEditItemOverlay._showHideRows ="+gEditItemOverlay._showHideRows.toString().replace(
       'TYPE_BOOKMARK;', '\        'TYPE_BOOKMARK;', '\
         $&\          $&\
         for (var j = 0; j < BookPO.P.length; j++) {\          for (var j = 0; j < BookPO.P.length; j++) {\
           this._element(BookPO.P[j] + "Row").collapsed =\            this._element(BookPO.P[j] + "Row").collapsed =\
             !isBookmark ||\              !isBookmark ||\
             this._hiddenRows.indexOf(BookPO.P[j]) != -1 ||\              this._hiddenRows.indexOf(BookPO.P[j]) != -1 ||\
             this._readOnly;\              this._readOnly;\
           this._element(BookPO.P[j] + "Radio").collapsed =\            this._element(BookPO.P[j] + "Radio").collapsed =\
             !isBookmark ||\              !isBookmark ||\
             this._hiddenRows.indexOf(BookPO.P[j]) != -1 ||\              this._hiddenRows.indexOf(BookPO.P[j]) != -1 ||\
             this._readOnly;\              this._readOnly;\
         }\          }\
       '         ' 
     ));      ));
   } catch (e) {    } catch (e) {
   }    }
   
   try {    try {
     eval("gEditItemOverlay.onLoadInSidebarCheckboxCommand ="+gEditItemOverlay.onLoadInSidebarCheckboxCommand.toString().replace(      eval("gEditItemOverlay.onLoadInSidebarCheckboxCommand ="+gEditItemOverlay.onLoadInSidebarCheckboxCommand.toString().replace(
.        'var loadInSidebarChecked', '\        'let annoObj', '\
         var perm = arguments[0];\          let perm = arguments[0];\
         if (perm) {\          if (perm) {\
.            var permstr = this._element(perm + "Radio").value;\            let permstr = this._element(perm + "Radio").value;\
           switch (permstr) {\            switch (permstr) {\
           case "true":\            case "true":\
             PlacesUtils.annotations.setItemAnnotation(this._itemId, BookPO.X + perm, true, 0, Ci.nsIAnnotationService.EXPIRE_NEVER);\              PlacesUtils.annotations.setItemAnnotation(this._itemId, BookPO.X + perm, true, 0, Ci.nsIAnnotationService.EXPIRE_NEVER);\
             break;\              break;\
           case "false":\            case "false":\
             PlacesUtils.annotations.setItemAnnotation(this._itemId, BookPO.X + perm, false, 0, Ci.nsIAnnotationService.EXPIRE_NEVER);\              PlacesUtils.annotations.setItemAnnotation(this._itemId, BookPO.X + perm, false, 0, Ci.nsIAnnotationService.EXPIRE_NEVER);\
             break;\              break;\
           default:\            default:\
             PlacesUtils.annotations.removeItemAnnotation(this._itemId, BookPO.X + perm);\              PlacesUtils.annotations.removeItemAnnotation(this._itemId, BookPO.X + perm);\
             break;\              break;\
           }\            }\
           return;\            return;\
         }\          }\
         $&\          $&\
       '         ' 
     ));      ));
   } catch (e) {    } catch (e) {
   }    }
   
   try {    try {
     eval("gEditItemOverlay.initPanel ="+gEditItemOverlay.initPanel.toString().replace(      eval("gEditItemOverlay.initPanel ="+gEditItemOverlay.initPanel.toString().replace(
       'LOAD_IN_SIDEBAR_ANNO);', '\        'LOAD_IN_SIDEBAR_ANNO);', '\
         $&\          $&\
         for (var j = 0; j < BookPO.P.length; j++) {\          for (var j = 0; j < BookPO.P.length; j++) {\
           var v = "null";\            var v = "null";\
           try {\            try {\
             v = (PlacesUtils.annotations.getItemAnnotation(this._itemId, BookPO.X + BookPO.P[j])) ? "true" : "false";\              v = (PlacesUtils.annotations.getItemAnnotation(this._itemId, BookPO.X + BookPO.P[j])) ? "true" : "false";\
           } catch (e) {\            } catch (e) {\
           }\            }\
           this._element(BookPO.P[j] + "Radio").value = v;\            this._element(BookPO.P[j] + "Radio").value = v;\
           this._element(BookPO.P[j] + "Radio").disabled = this._readOnly;\            this._element(BookPO.P[j] + "Radio").disabled = this._readOnly;\
         }\          }\
       '         ' 
     ));      ));
   } catch (e) {    } catch (e) {
   }    }
   
 }  }
} }
   
BookPO._onLoad(); BookPO._onLoad();