Skip to content

Commit

Permalink
add minified version, update markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
metallurgical committed May 8, 2015
1 parent bc6b7db commit b181b5c
Show file tree
Hide file tree
Showing 7 changed files with 105 additions and 11 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Specifies intentionally untracked files to ignore when using Git
# http://git-scm.com/docs/gitignore

node_modules/

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Simple plugin to clone DOM element.



- [**V1.0.0**](https://github.com/metallurgical/jquery-metal-clone/archive/v1.0.0.zip "V1.0.0")
- [**V1.0.1**](https://github.com/metallurgical/jquery-metal-clone/archive/v1.0.1.zip "V1.0.1")



Expand All @@ -31,8 +31,8 @@ Simple plugin to clone DOM element.

Installation is so very easy. Download the current stable and see the example in Demo page. Here is the manual step to follow :

1. Put `<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>` inside Head Section(using latest version).
2. Place `<script src="jquery.metalClone.js"></script>` after jQuery library.
1. Put `<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>` inside Head Section(**recommended using latest version**).
2. Place `<script src="jquery.metalClone.min.js"></script>` after jQuery library.
3. Done!!

# Available Options #
Expand Down
68 changes: 68 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@

// define all gulp plugin to used
// define plugin if required
// some of plugins can be used together with others plugin
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');

//this plugin for debug js file, will display error and correction into console
gulp.task('jshint', function(){

var srcJs = './jquery.metalClone.js'; // js source files
gulp.src(srcJs)
.pipe(jshint())
.pipe(jshint.reporter('default'));
});





//this function to concat(can be used to concat css file also) all js file and code, strip empty space js file
//This example passes an array of filenames to gulp.src(); I want scripts.js to appear at the top of the production file followed by all other JavaScript files in any order.
gulp.task('myJs', function(){

gulp.src(['./jquery.metalClone.js'])
.pipe(concat('jquery.metalClone.min.js'))
//.pipe(stripDebug())
.pipe(uglify())
.pipe(gulp.dest('./'));
});




//to run all the task sekaligus(sequence) guna code ni
//just run 'gulp' command on console to run the default task
gulp.task('default', ['jshint','myJs'], function(){



/********************************** optional buang kod dalm block ni shaja klu xse(to watch the changes realtime use this)**********/

// watch for HTML changes
gulp.watch('./src/*.html', function() {
gulp.run('minifyHtml');
});

// watch for JS changes
gulp.watch('./src/scripts/*.js', function() {
gulp.run('jshint', 'scripts');
});

// watch for CSS changes
gulp.watch('./src/styles/*.css', function() {
gulp.run('css');
});

/***************************** end optional **************************/

});






4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<link href="codeHighlighter/prism.css" rel="stylesheet">
<script src="jquery.min.js"></script>
<script src="codeHighlighter/prism.js"></script>
<script src="jquery.metalClone.js"></script>
<script src="jquery.metalClone.min.js"></script>
<style type="text/css">
.a{
border:1px solid green;
Expand Down Expand Up @@ -49,7 +49,7 @@ <h3>jQuery CheckAll - Demo</h3>
<pre>
<code class="language-markup">
<script type="prism-html-markup">
<script src="jquery.metalClone.js"></script>
<script src="jquery.metalClone.min.js"></script>
</script>
</code>
</pre>
Expand Down
12 changes: 6 additions & 6 deletions jquery.metalClone.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
var currentBtnRemoveText = opt.btnRemoveText;


console.log(currentBtnClone);
//console.log(currentBtnClone);
/*===============================================
| When Clone button was clicked
|================================================*/
Expand Down Expand Up @@ -134,7 +134,7 @@



})
});

/*===============================================
| Function to clone element(IF destination provided)
Expand Down Expand Up @@ -223,7 +223,7 @@
toClone.insertAfter(destination)
.append('<input type="button" value="'+currentBtnRemoveText+'" class="metalBtnRemove">');

if(currentCopyValue){ console.log('a');/* never copy */}else{clearForm(toClone);}
if(currentCopyValue){ /* never copy */}else{clearForm(toClone);}


}
Expand Down Expand Up @@ -268,7 +268,7 @@

container.find('input:not("input[type=button], input[type=submit]"), textarea, select').each(function(){
$(this).val('');
})
});
}


Expand Down Expand Up @@ -323,15 +323,15 @@
// Get the parent container
// Then remove including child
$(this).closest(typeSelector).remove();
})
});


return element.each(function(i,e){

var $elem = $(this);


})
});

};

Expand Down
1 change: 1 addition & 0 deletions jquery.metalClone.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "metalClone",
"version": "1.0.1",
"description": "jQuery plugin clone DOM element",
"main": "index.js",
"dependencies": {
"gulp": "^3.8.11",
"gulp-concat": "^2.5.2",
"gulp-jshint": "^1.9.0",
"gulp-uglify": "^1.0.2"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [
"hello"
],
"author": "norlihazmey@metallurgical",
"license": "MIT"
}

0 comments on commit b181b5c

Please sign in to comment.