Permalink
Browse files

NOTICE: Updated your build.conf. Renamed sources web.js to modern_bro…

…wser.js and plugincheck.js to plugincheck_ui.js, etc. Made build file more genereal. Renamed MOZILLA_COM to DIST_DIR
  • Loading branch information...
1 parent 04f2326 commit c2d48fffe5ace37902f8221f581679b32dfa9f48 Austin King committed Mar 11, 2010
View
@@ -1,30 +1,56 @@
-# PerFidieS of the Web
+# PerFidieS of the Web #
This is the client side of the PFS2 project, which updates how
-Mozilla tracks browser plugins. As new versions are released
+Mozilla tracks browser plugins. As new plugin versions are released
or vulnerabilities are discovered the PFS2 project will
encourage or alert the user to upgrade plugins.
-For maximum fun, setup mozilla.com, pfs2, and make this directory available
-via a local web server.
+http://mozilla.com/en-US/plugincheck/ - Uses this project and has more information
+
+## Structure of Perfidies ##
+Perfidies is broken down into several source files. Prepare for ASCII Art...
+ ___________________________________________
+ / \
+| plugincheck_ui.js | plugincheck_badge_ui.js |
+|-------------------| |
+| messages.js | |
+|-------------------------------------------- |
+| modern_browser.js, exploder.js |
+|-------------------------------------------- |
+| perfidies.js |
+\_____________________________________________/
+
+So the top layer is mozilla.com specific
+messages.js - Exists for L10n
-# Development
+The bottom two layers should be reusable.
+
+## Development ##
Edit js files run tests/unit.html, pfs2_json.html, via file system or local web server.
-# Integration test
-Setup PFS2 http://svn.mozilla.org/projects/pfs2/trunk/
+For maximum fun, setup mozilla.com, plugindir, and make this directory available
+via a local web server.
+
+## Integration test ##
+Setup the plugindir server, which has a PFS2 api http://github.com/lmorchard/plugindir
then run it's tests to populate the database with test data
In this project, run tests/integration.html via a local web server
-for end to end integration tests.
+for end to end integration tests. make sure your pfs2 database has the Foobar plugin data.
-# Mozilla.com PluginCheck
-Edit MOZILLA_COM and PERFIDIES env variables in build.sh
-./build.sh which produces $MOZILLA_COM/js/plugincheck.js
-Hit local instance of mozilla.com/en-US/plugincheck/
+## Building the project ##
+1) Edit DIST_DIR and PERFIDIES env variables in build.conf
+2) ./build.sh
+3) Produces $DIST_DIR/plugincheck.js and $DIST_DIR/plugincheck_badge.js
-Commit changes to this project as well as Mozilla.com js/plugincheck
+## Working on Mozilla.com? ##
+Set DIST_DIR to your moco checkout js directory.
+Example:
+ DIST_DIR=/some/path/mozilla.com/js/
+Build Project and then hit local instance of mozilla.com/en-US/plugincheck/
+Commit changes to this project as well as Mozilla.com js/plugincheck.js and js/plugincheck_badge.js
-# Contributors:
+## Contributors: ##
+* Pascal Chevrel
* Les Orchard
* Lloyd Hilaiel
* Reuses Eric Gerds' excellent PluginDetect v0.7 http://www.pinlady.net/PluginDetect
View
@@ -1,4 +1,4 @@
# Location of the mozilla.com/trunk
-export MOZILLA_COM=/home/aking/mozilla.com
+export DIST_DIR=/home/aking/mozilla.com/js
# Location of the Perfidies code
export PERFIDIES=/home/aking/mozilla.com/en-US/firefox/plugincheck/perfidies
View
@@ -3,53 +3,51 @@
# Builds 2 JavaScript files which are used by http://mozilla.com/en-US/plugincheck
# as well as the web badge version
#
-
source build.conf
-cd $MOZILLA_COM
+mkdir -p $DIST_DIR
+cd $DIST_DIR
echo "Checking for bad uses of jQuery"
# We shouldn't use $, we have Pfs.$ instead, Regex OK
grep "$." $PERFIDIES/*.js | grep -v "Pfs.$." | grep -v "$/"
echo "building plugincheck.js ================================================"
-rm -f js/plugincheck.js
-cp $PERFIDIES/notice.txt js/plugincheck.min.js
-echo -ne '// Version: ' >> js/plugincheck.min.js;
-echo `cat ${PERFIDIES}/*.js | md5sum` >> js/plugincheck.min.js
+rm -f plugincheck.js
+cp $PERFIDIES/notice.txt plugincheck.min.js
+echo -ne '// Version: ' >> plugincheck.min.js
+echo `cat ${PERFIDIES}/*.js | md5sum` >> plugincheck.min.js
-~/bin/jsmin < $PERFIDIES/lib/browserdetect.js >> js/plugincheck.min.js
+~/bin/jsmin < $PERFIDIES/lib/browserdetect.js >> plugincheck.min.js
# So it turns out that plugindetect can't be passed through jsmin or IE 7 will barf
-cat $PERFIDIES/lib/plugindetect.js >> js/plugincheck.min.js
+cat $PERFIDIES/lib/plugindetect.js >> plugincheck.min.js
# Bug#535030 use mozilla.com's jquery
# $PERFIDIES/lib/jquery-1.3.2.min.js
-~/bin/jsmin < $PERFIDIES/lib/jquery.jsonp-1.1.0.js >> js/plugincheck.min.js
-~/bin/jsmin < $PERFIDIES/perfidies.js >> js/plugincheck.min.js
-~/bin/jsmin < $PERFIDIES/messages.js >> js/plugincheck.min.js
-~/bin/jsmin < $PERFIDIES/web.js >> js/plugincheck.min.js
-~/bin/jsmin < $PERFIDIES/exploder.js >> js/plugincheck.min.js
-~/bin/jsmin < $PERFIDIES/plugincheck.js >> js/plugincheck.min.js
-
-mv js/plugincheck.min.js js/plugincheck.js
-
+~/bin/jsmin < $PERFIDIES/lib/jquery.jsonp-1.1.0.js >> plugincheck.min.js
+~/bin/jsmin < $PERFIDIES/perfidies.js >> plugincheck.min.js
+~/bin/jsmin < $PERFIDIES/messages.js >> plugincheck.min.js
+~/bin/jsmin < $PERFIDIES/modern_browser.js >> plugincheck.min.js
+~/bin/jsmin < $PERFIDIES/exploder.js >> plugincheck.min.js
+~/bin/jsmin < $PERFIDIES/plugincheck_ui.js >> plugincheck.min.js
+mv plugincheck.min.js plugincheck.js
echo "building plugincheck_badge.js ================================================"
-rm -f js/plugincheck_badge.js
-cp $PERFIDIES/notice.txt js/plugincheck_badge.min.js
-echo -ne '// Version: ' >> js/plugincheck_badge.min.js
+rm -f plugincheck_badge.js
+cp $PERFIDIES/notice.txt plugincheck_badge.min.js
+echo -ne '// Version: ' >> plugincheck_badge.min.js
-echo `cat ${PERFIDIES}/*.js | md5sum` >> js/plugincheck_badge.min.js
-~/bin/jsmin < $PERFIDIES/lib/browserdetect.js >> js/plugincheck_badge.min.js
+echo `cat ${PERFIDIES}/*.js | md5sum` >> plugincheck_badge.min.js
+~/bin/jsmin < $PERFIDIES/lib/browserdetect.js >> plugincheck_badge.min.js
# So it turns out that plugindetect can't be passed through jsmin or IE 7 will barf
-cat $PERFIDIES/lib/plugindetect.js >> js/plugincheck_badge.min.js
+cat $PERFIDIES/lib/plugindetect.js >> plugincheck_badge.min.js
-~/bin/jsmin < $PERFIDIES/lib/jquery-1.3.2.min.js >> js/plugincheck_badge.min.js
-~/bin/jsmin < $PERFIDIES/lib/jquery.jsonp-1.1.0.js >> js/plugincheck_badge.min.js
-~/bin/jsmin < $PERFIDIES/perfidies.js >> js/plugincheck_badge.min.js
+~/bin/jsmin < $PERFIDIES/lib/jquery-1.3.2.min.js >> plugincheck_badge.min.js
+~/bin/jsmin < $PERFIDIES/lib/jquery.jsonp-1.1.0.js >> plugincheck_badge.min.js
+~/bin/jsmin < $PERFIDIES/perfidies.js >> plugincheck_badge.min.js
# Badge uses images outside of JS, so no localization in messages.js
# $PERFIDIES/messages.js
-~/bin/jsmin < $PERFIDIES/web.js >> js/plugincheck_badge.min.js
-~/bin/jsmin < $PERFIDIES/exploder.js >> js/plugincheck_badge.min.js
-~/bin/jsmin < $PERFIDIES/plugincheck_badge.js >> js/plugincheck_badge.min.js
+~/bin/jsmin < $PERFIDIES/modern_browser.js >> plugincheck_badge.min.js
+~/bin/jsmin < $PERFIDIES/exploder.js >> plugincheck_badge.min.js
+~/bin/jsmin < $PERFIDIES/plugincheck_badge_ui.js >> plugincheck_badge.min.js
-mv js/plugincheck_badge.min.js js/plugincheck_badge.js
+mv plugincheck_badge.min.js plugincheck_badge.js
View
@@ -8,9 +8,9 @@
<script src="lib/jquery.jsonp-1.1.0.js"></script>
<script src="perfidies.js"></script>
<script src="messages.js"></script>
- <script src="web.js"></script>
+ <script src="modern_browser.js"></script>
<script src="exploder.js"></script>
- <script src="plugincheck.js"></script>
+ <script src="plugincheck_ui.js"></script>
<script src="lib/jquery-1.3.2.min.js"></script>
<script src="tools/json2.js"></script>
File renamed without changes.
View
@@ -38,8 +38,8 @@
* Plugin Finder Service Client Library.
* There are two layers to the mozilla.com/en-US/plugincheck/ page: The UI and the PFS2 API.
*
- * The UI JavaScript which uses this in plugincheck.js
- *
+ * This file is the lower level code that talks to PFS2.
+ *
* The main entry point into the PFS2 Client API is the findPluginInfos function.
* This funtion takes a NavigatorInfo, a list of PluginInfos, and a callback function.
*
@@ -155,11 +155,11 @@ Pfs = {
* during the incremental callback.
*
* @param {object} - navigatorInfo - A suitable navigatorInfo object is created via
- * the function browserInfo in plugincheck.js, but you can create one directly... {
+ * the function browserInfo in modern_browser.js, but you can create one directly... {
* clientOS: "Intel Mac OS X 10.5", chromeLocale: "en-US", appID: "...", appRelease: "3.5.3", appVersion: "20090824085414"
* }
* @param {object} - pluginInfos - A suitable pluginInfos array is created via
- * the function browserPlugins in plugincheck.js, but you can create one directly... [{
+ * the function browserPlugins in modern_browser.js, but you can create one directly... [{
* plugin: {}, mimes: ["mime1 mime2"], classified: false
* }]
*
@@ -1,3 +1,6 @@
+/**
+ * UI code for a web badge served up from mozilla.com
+ */
Pfs.$(document).ready(function(){
Pfs.endpoint = window.location.protocol + "//" + 'plugins.mozilla.org/en-us/pfs/v2';
Pfs.UI.navInfo = Pfs.UI.browserInfo();
File renamed without changes.
View
@@ -11,8 +11,8 @@
<script src="lib/jquery.jsonp-1.1.0.js"></script>
<script src="perfidies.js"></script>
<script src="messages.js"></script>
- <script src="web.js"></script>
- <script src="plugincheck.js"></script>
+ <script src="modern_browser.js"></script>
+ <script src="plugincheck_ui.js"></script>
<script src="tools/json2.js"></script>
<script>
@@ -10,7 +10,7 @@
<script src="../lib/plugindetect.js"></script>
<script src="../perfidies.js"></script>
<script src="../messages.js"></script>
- <script src="../web.js"></script>
+ <script src="../modern_browser.js"></script>
<script src="../exploder.js"></script>
<script src="../plugincheck.js"></script>
View
@@ -10,7 +10,7 @@
<script src="../lib/plugindetect.js"></script>
<script src="../perfidies.js"></script>
<script src="../messages.js"></script>
- <script src="../web.js"></script>
+ <script src="../modern_browser.js"></script>
<script src="../exploder.js"></script>
<script src="../plugincheck.js"></script>
View
@@ -8,7 +8,7 @@
<script src="../lib/plugindetect.js"></script>
<script src="../perfidies.js"></script>
<script src="../messages.js"></script>
- <script src="../web.js"></script>
+ <script src="../modern_browser.js"></script>
<script src="../exploder.js"></script>
<script src="../plugincheck.js"></script>

0 comments on commit c2d48ff

Please sign in to comment.