Skip to content
This repository has been archived by the owner on Oct 27, 2019. It is now read-only.

Commit

Permalink
Added Specs. Moved PluginName.js into Plugins subfolder
Browse files Browse the repository at this point in the history
  • Loading branch information
subtleGradient committed Sep 12, 2008
1 parent c1912de commit 9098608
Show file tree
Hide file tree
Showing 10 changed files with 4,110 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Expand Up @@ -4,3 +4,9 @@ My Plugin Name
Description
-----------
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Getting Started
---------------

1. First, rename the PluginName.js files to whatever the name of your plugin is
2. Replace every occurrence of "PluginName" with your plugins actual name
File renamed without changes.
96 changes: 96 additions & 0 deletions Specs/Assets/Scripts/Builder.js
@@ -0,0 +1,96 @@
/*
Script: Builder.js
Automatically includes MooTools files right from the project folder.
License:
MIT-style license.
Note:
If you use this script in your own page, you must be out of your mind.
*/

var Builder = {

root: '../',

paths: {
source: 'Source',
specs: 'Specs'
},

included: {
source: {},
specs: {},
docs: {}
},

scripts: {
source: {
'../Demos': ['mootools'],
'Plugins' : ['PluginName']
},

specs: {
'Plugins' : ['PluginName']
}
},

initialize: function(root){
if (root) this.root = root;
this.includeType('source');
return this;
},

getFolder: function(type, file){
var scripts = this.scripts[type];
for (var folder in scripts){
for (var i = 0; i < scripts[folder].length; i++){
var script = scripts[folder][i];
if (script == file) return folder;
}
}
return false;
},

getRequest: function(){
var pairs = window.location.search.substring(1).split('&');
var obj = {};
for (var i = 0, l = pairs.length; i < l; i++){
var pair = pairs[i].split('=');
obj[pair[0]] = pair[1];
}
return obj;
},

includeFile: function(type, folder, file){
folder = folder || this.getFolder(type, file);
if (!folder) return false;
this.included[type][folder] = this.included[type][folder] || [];
var files = this.included[type][folder];
for (var i = 0; i < files.length; i++){
if (files[i] == file) return false;
}
this.included[type][folder].push(file);
return document.writeln('\t<script type="text/javascript" src="' + this.root + this.paths[type] + '/' + folder + '/' + file + '.js"></script>');
},

includeFolder: function(type, folder){
var scripts = this.scripts[type][folder];
for (var i = 0, l = scripts.length; i < l; i++) this.includeFile(type, folder, scripts[i]);
},

includeType: function(type){
for (var folder in this.scripts[type]) this.includeFolder(type, folder);
},

includeRequest: function(type){
var req = this.getRequest();
if (!req.files && !req.folders) return false;
var files = (req.files) ? req.files.split('+') : [];
var folders = (req.folders) ? req.folders.split('+') : [];
for (var j = 0; j < files.length; j++) this.includeFile(type, null, files[j]);
for (var i = 0; i < folders.length; i++) this.includeFolder(type, folders[i]);
return true;
}

};

0 comments on commit 9098608

Please sign in to comment.