Commit 66bf0b8a authored by daidekun's avatar daidekun
parents 83bf04c7 d26dd5b7

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

.idea/ .idea/
*.swp *.swp
*.swn
*.swo
*.swl
*.swm
*.swk
...@@ -23,6 +23,8 @@ if [ "$delete_business_data" = "true" ];then ...@@ -23,6 +23,8 @@ if [ "$delete_business_data" = "true" ];then
echo "CREATE DATABASE IF NOT EXISTS \`${database_name}\` DEFAULT CHARSET utf8 COLLATE utf8_general_ci;" | mysql -h $mysql_host -uqa -pqatest echo "CREATE DATABASE IF NOT EXISTS \`${database_name}\` DEFAULT CHARSET utf8 COLLATE utf8_general_ci;" | mysql -h $mysql_host -uqa -pqatest
fi fi
echo `pwd`
for entry in ./* for entry in ./*
do do
echo "mysql -h $mysql_host -u qa -pqatest $database_name < $entry" echo "mysql -h $mysql_host -u qa -pqatest $database_name < $entry"
......
...@@ -12,58 +12,74 @@ db_sub_backup_folder=$3 ...@@ -12,58 +12,74 @@ db_sub_backup_folder=$3
re_replace_ip=$4 re_replace_ip=$4
public_ip="www.q-gp.com" public_ip="www.q-gp.com"
ip_last=$5 ip_last=$5
pwd_path="/home/qa-deploy-utils/qa_shell_script"
config_server="$pwd_path/config_server"
project_path=`cat $config_server/project_path.sh`
config_path=`cat $config_server/config_path.sh`
echo $server_host echo $server_host
cd $db_sub_backup_folder cd $db_sub_backup_folder
file_count=`ls -l |grep "^-"|wc -l` file_count=`ls -l |grep "^-"|wc -l`
hosts=`node $config_server/get_project_config.js -type multi -attr port/url`
function transByPort()
{
if [ -n "$4" ];then
echo "sed -i \"s/\/$3/\/$1-$ip_last.q-gp.com/g\" $4"
sed -i "s/\/$3/\/$1-$ip_last.q-gp.com/g" $4
fi
}
function transByUrl()
{
if [ -n "$4" ];then
echo "sed -i \"s/\/$3/\/${server_host}:$2/g\" $4"
sed -i "s/\/$3/\/${server_host}:$2/g" $4
fi
}
echo "./* file count is $file_count" echo "./* file count is $file_count"
if [ "$file_count" -gt 0 ]; then if [ "$file_count" -gt 0 ]; then
for entry in ./* for entry in ./*
do do
echo "is replace ip for db_back_file $entry" sed -i "s/https\:/http\:/g" $entry
sed -i "s/http\:\/\/m.xyqb.com/http\:\/\/${server_host}:7001/g" $entry if [ "$re_replace_ip" = true ]; then
sed -i "s/https\:\/\/m.xyqb.com/http\:\/\/${server_host}:7001/g" $entry
sed -i "s/http\:\/\/bt.xyqb.com/http\:\/\/${server_host}:7050/g" $entry
sed -i "s/https\:\/\/bt.xyqb.com/http\:\/\/${server_host}:7050/g" $entry
sed -i "s/http\:\/\/api.xyqb.com/http\:\/\/${server_host}:7003/g" $entry
sed -i "s/https\:\/\/api.xyqb.com/http\:\/\/${server_host}:7003/g" $entry
sed -i "s/http\:\/\/r.xyqb.com/http\:\/\/${server_host}:7004/g" $entry
sed -i "s/https\:\/\/r.xyqb.com/http\:\/\/${server_host}:7004/g" $entry
sed -i "s/http\:\/\/rapi.xyqb.com/http\:\/\/${server_host}:7005/g" $entry
sed -i "s/https\:\/\/rapi.xyqb.com/http\:\/\/${server_host}:7005/g" $entry
sed -i "s/http\:\/\/payapi.xyqb.com/http\:\/\/${server_host}:7006/g" $entry
sed -i "s/https\:\/\/payapi.xyqb.com/http\:\/\/${server_host}:7006/g" $entry
sed -i "s/http\:\/\/pay.xyqb.com/http\:\/\/${server_host}:7007/g" $entry
sed -i "s/https\:\/\/pay.xyqb.com/http\:\/\/${server_host}:7007/g" $entry
sed -i "s/http\:\/\/off.xyqb.com/http\:\/\/${server_host}:7008/g" $entry
sed -i "s/https\:\/\/off.xyqb.com/http\:\/\/${server_host}:7008/g" $entry
sed -i "s/http\:\/\/offapi.xyqb.com/http\:\/\/${server_host}:7010/g" $entry
sed -i "s/https\:\/\/offapi.xyqb.com/http\:\/\/${server_host}:7010/g" $entry
sed -i "s/http\:\/\/financial.xyqb.com/http\:\/\/${server_host}:7011/g" $entry
sed -i "s/https\:\/\/financial.xyqb.com/http\:\/\/${server_host}:7011/g" $entry
sed -i "s/http\:\/\/fsapi.xyqb.com/http\:\/\/${server_host}:7012/g" $entry
sed -i "s/https\:\/\/fsapi.xyqb.com/http\:\/\/${server_host}:7012/g" $entry
sed -i "s/http\:\/\/auth.xyqb.com/http\:\/\/${server_host}:7013/g" $entry
sed -i "s/https\:\/\/auth.xyqb.com/http\:\/\/${server_host}:7013/g" $entry
sed -i "s/http\:\/\/qapi.xyqb.com/http\:\/\/${server_host}:7014/g" $entry
sed -i "s/https\:\/\/qapi.xyqb.com/http\:\/\/${server_host}:7014/g" $entry
sed -i "s/http\:\/\/mallapi.xyqb.com/http\:\/\/${server_host}:7019/g" $entry
sed -i "s/https\:\/\/mallapi.xyqb.com/http\:\/\/${server_host}:7019/g" $entry
sed -i "s/http\:\/\/scapi.xyqb.com/http\:\/\/${server_host}:7021/g" $entry
sed -i "s/https\:\/\/scapi.xyqb.com/http\:\/\/${server_host}:7021/g" $entry
sed -i "s/http\:\/\/gyxdapi.xyqb.com/http\:\/\/${server_host}:7029/g" $entry
sed -i "s/https\:\/\/gyxdapi.xyqb.com/http\:\/\/${server_host}:7029/g" $entry
sed -i "s/http\:\/\/btapi.xyqb.com/http\:\/\/${server_host}:7025/g" $entry
sed -i "s/https\:\/\/btapi.xyqb.com/http\:\/\/${server_host}:7025/g" $entry
done
if [ "$re_replace_ip" = true ]; then
for entry in ./*
do
echo "is replace public ip for $entry" echo "is replace public ip for $entry"
sed -i "s/${server_host}/${public_ip}/g" $entry for host in $hosts
sed -i "s/\:70/:${ip_last}/g" $entry do
done arr=${host//|/ }
fi transByPort $arr $entry
done
else
echo "is replace ip for db_back_file $entry"
for host in $hosts
do
arr=${host//|/ }
transByUrl $arr $entry
done
fi
done
fi fi
# sed -i "s/\/m.xyqb.com/\/xyqb-ui-$ip_last.q-gp.com/g" $entry
# sed -i "s/\/bt.xyqb.com/\/${server_host}:7050/g" $entry
# sed -i "s/\/api.xyqb.com/\/${server_host}:7003/g" $entry
# sed -i "s/\/r.xyqb.com/\/${server_host}:7004/g" $entry
# sed -i "s/\/rapi.xyqb.com/\/${server_host}:7005/g" $entry
# sed -i "s/\/payapi.xyqb.com/\/${server_host}:7006/g" $entry
# sed -i "s/\/pay.xyqb.com/\/${server_host}:7007/g" $entry
# sed -i "s/\/off.xyqb.com/\/${server_host}:7008/g" $entry
# sed -i "s/\/offapi.xyqb.com/\/${server_host}:7010/g" $entry
# sed -i "s/\/financial.xyqb.com/\/${server_host}:7011/g" $entry
# sed -i "s/\/fsapi.xyqb.com/\/${server_host}:7012/g" $entry
# sed -i "s/\/auth.xyqb.com/\/${server_host}:7013/g" $entry
# sed -i "s/\/qapi.xyqb.com/\/${server_host}:7014/g" $entry
# sed -i "s/\/mallapi.xyqb.com/\/${server_host}:7019/g" $entry
# sed -i "s/\/scapi.xyqb.com/\/${server_host}:7021/g" $entry
# sed -i "s/\/gyxdapi.xyqb.com/\/${server_host}:7029/g" $entry
# sed -i "s/\/btapi.xyqb.com/\/${server_host}:7025/g" $entry
\ No newline at end of file
...@@ -18,14 +18,15 @@ if [ -n "$project_folder" ];then ...@@ -18,14 +18,15 @@ if [ -n "$project_folder" ];then
sh $config_server/show_info.sh $project_name pull代码 $desc $3 sh $config_server/show_info.sh $project_name pull代码 $desc $3
cd ./$project_name cd ./$project_name
git checkout ./ git checkout ./
git fetch git fetch -p
#git pull #git pull
if [ -n "$git_branch" ]; then if [ -n "$git_branch" ]; then
echo "checkout specified branch $git_branch" echo "checkout specified branch $git_branch"
git checkout -f $git_branch git checkout -f $git_branch
if [ $? = 0 ]; then if [ $? = 0 ]; then
echo "checkout branch $git_branch is ok". echo "checkout branch $git_branch is ok".
git pull # git pull
else else
echo "Fail to checkout branch $git_branch". echo "Fail to checkout branch $git_branch".
exit -1 exit -1
...@@ -35,8 +36,11 @@ if [ -n "$project_folder" ];then ...@@ -35,8 +36,11 @@ if [ -n "$project_folder" ];then
#git checkout -f master #git checkout -f master
git_branch=`git branch | grep '*' | awk '{print $2}'` git_branch=`git branch | grep '*' | awk '{print $2}'`
echo "current branch: $git_branch" echo "current branch: $git_branch"
git pull # git pull
fi fi
git fetch -p
echo "git reset FETCH_HEAD --hard"
git reset FETCH_HEAD --hard
else else
desc=`node $config_server/get_project_config.js -name $project_name -attr desc` desc=`node $config_server/get_project_config.js -name $project_name -attr desc`
sh $config_server/show_info.sh $project_name clone代码 $desc $3 sh $config_server/show_info.sh $project_name clone代码 $desc $3
......
...@@ -24,14 +24,13 @@ function getCode() ...@@ -24,14 +24,13 @@ function getCode()
echo "sh $config_server/show_info.sh $project pull代码 $desc $3" echo "sh $config_server/show_info.sh $project pull代码 $desc $3"
sh $config_server/show_info.sh $project pull代码 $desc $3 sh $config_server/show_info.sh $project pull代码 $desc $3
cd ./$project cd ./$project
echo "git reset --hard"
git reset --hard
echo "git checkout ./" echo "git checkout ./"
git checkout ./ git checkout ./
echo "git fetch" echo "git fetch"
git fetch git fetch
echo "git pull" # echo "git pull"
git pull # git pull
#如果拉代码失败,则获取现在所处分支,然后删掉现在的项目,重新clone #如果拉代码失败,则获取现在所处分支,然后删掉现在的项目,重新clone
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "error: Pulling is not possible because you have unmerged files" echo "error: Pulling is not possible because you have unmerged files"
...@@ -50,6 +49,8 @@ function getCode() ...@@ -50,6 +49,8 @@ function getCode()
git_branch=$2 git_branch=$2
fi fi
git pull git pull
echo "git reset FETCH_HEAD --hard"
git reset FETCH_HEAD --hard
git branch git branch
else else
sh $config_server/show_info.sh $project clone代码 $desc $3 sh $config_server/show_info.sh $project clone代码 $desc $3
......
...@@ -27,16 +27,32 @@ then ...@@ -27,16 +27,32 @@ then
then then
echo "-------link-$project--$config_path/public/$project_type/$project.*----/home/quant_group/$project/$file " echo "-------link-$project--$config_path/public/$project_type/$project.*----/home/quant_group/$project/$file "
cp -r $config_path/public/$project_type/${project}.* /home/quant_group/${project}/$file cp -r $config_path/public/$project_type/${project}.* /home/quant_group/${project}/$file
if [ $? != 0 ];then
exit -1
fi
else else
echo "-------link-$project--$config_path/$project_type/$project.*----/home/quant_group/$project/$file " echo "-------link-$project--$config_path/$project_type/$project.*----/home/quant_group/$project/$file "
cp -r $config_path/$project_type/${project}.* /home/quant_group/${project}/$file cp -r $config_path/$project_type/${project}.* /home/quant_group/${project}/$file
if [ $? != 0 ];then
exit -1
fi
fi fi
else else
if $is_public_ip && [ -n "$is_public_ip" ] if $is_public_ip && [ -n "$is_public_ip" ]
then then
echo "ln -s $config_path/public/$project_type/${project}.* /home/quant_group/${project}/$file"
ln -s $config_path/public/$project_type/${project}.* /home/quant_group/${project}/$file ln -s $config_path/public/$project_type/${project}.* /home/quant_group/${project}/$file
if [ $? != 0 ];then
echo "link config file fail"
exit -1
fi
else else
ln -s $config_path/$project_type/${project}.* /home/quant_group/${project}/$file echo "ln -s $config_path/$project_type/${project}.* /home/quant_group/${project}/$file"
ln -s "$config_path/$project_type/${project}.*" /home/quant_group/${project}/$file
if [ $? != 0 ];then
echo "link config file fail"
exit -1
fi
fi fi
if [ "$project" = "xyqb-mall" ] if [ "$project" = "xyqb-mall" ]
......
...@@ -6,10 +6,8 @@ config_server="$pwd_path/config_server" ...@@ -6,10 +6,8 @@ config_server="$pwd_path/config_server"
project_path=`cat $config_server/project_path.sh` project_path=`cat $config_server/project_path.sh`
project_type=`node $config_server/get_project_config.js -name $project_name -attr type` project_type=`node $config_server/get_project_config.js -name $project_name -attr type`
config_path=`cat $config_server/config_path.sh` config_path=`cat $config_server/config_path.sh`
node4_path=`cat $config_server/node_4_path.sh`
node7_path=`cat $config_server/node_7_path.sh`
profile=test
profile=test
host=`/sbin/ifconfig -a|grep inet|grep -v 127.0.0.1|grep -v inet6|awk '{print $2}'|tr -d "addr:"` host=`/sbin/ifconfig -a|grep inet|grep -v 127.0.0.1|grep -v inet6|awk '{print $2}'|tr -d "addr:"`
echo "host=$host" echo "host=$host"
...@@ -17,141 +15,17 @@ hosts=(${host//\./ }) ...@@ -17,141 +15,17 @@ hosts=(${host//\./ })
suffix=${hosts[3]} suffix=${hosts[3]}
function buildJavaProject()
{
project=$1
desc=`node $config_server/get_project_config.js -name $project -attr desc`
target_path=`node $config_server/get_project_config.js -name $project -attr target_path`
sh $config_server/show_info.sh $project BUILD $desc $2
cd $project_path/$project
rm -rf $target_path
rm -rf $project.jar
if [[ "$project" = "xyqb" || "$project" = "gu-bei" || "$project" = "han-gu-guan" || "$project" = "di-ting" || "$project" = "xyqb-offline" || "$project" = "xyqb-user2" ]]; then
echo "module is $project, need replace sms jar version from 1.0.x to 1.0.2"
num=`grep -n -A12 "<id>test</id>" $project_path/$project/pom.xml| grep "<version>" | awk -F- '{print $1}'`
echo "----$project-----pom.xml file line: $num------------"
sed -i "${num}s/1.0.[0-9]-SNAPSHOT/1.0.6.3-SNAPSHOT/" $project_path/$project/pom.xml
fi
if [[ "$project" = "du-jiang-yan" ]]; then
num=`grep -n -A3 "<artifactId>fund-manage-sdk</artifactId>" $project_path/$project/pom.xml| grep "<version>" | awk -F- '{print $1}'`
echo "----$project-----pom.xml file line: $num------------"
sed -i "${num}s/1.0.[0-9]-SNAPSHOT/1.0.0.${suffix}-SNAPSHOT/" $project_path/$project/pom.xml
sed -i "${num}s/1.0.[0-9].[0-9]/1.0.0.${suffix}-SNAPSHOT/" $project_path/$project/pom.xml
fi
if [[ "$project" = "finance-api" || "$project" = "financial-system" ]]; then
num=`grep -n -A1 "<artifactId>quantgroup-sms-sdk</artifactId>" $project_path/$project/pom.xml| grep "<version>" | awk -F- '{print $1}'`
echo "----$project-----pom.xml file line: $num------------"
sed -i "${num}s/1.0.6.3/1.0.6.3-SNAPSHOT/" $project_path/$project/pom.xml
fi
echo "mvn clean package -P${profile} -Dmaven.test.skip=true"
mvn clean package -P${profile} -Dmaven.test.skip=true
if [ $? = 0 ]; then
echo "${project} build ok"
else
echo "${project} build fail"
exit -1
fi
echo "$target_path"
mv $project_path/$project/$target_path/*.jar $project_path/$project/$project.jar
}
function buildUiProject()
{
project=$1
desc=`node $config_server/get_project_config.js -name $project -attr desc`
sh $config_server/show_info.sh $project BUILD $desc $2
config_file=`node $config_server/get_project_config.js -name $project -attr config_file`
command=`node $config_server/get_project_config.js -name $project -attr command`
node_version=`node $config_server/get_project_config.js -name $project -attr node_version`
# 第一步 将nginx项目的所有文件进行打包
cd $project_path/$project
# rm -rf ./$config_file
# if $is_public_ip && [ -n "$is_public_ip" ]
# then
# cp -r $config_path/public/ui/$project.* $project_path/$project/$config_file
# else
# cp -r $config_path/ui/$project.* $project_path/$project/$config_file
# fi
#imagemin_dist=`grep -n -A3 "imagemin" *.js|awk '{print $1}'`
#if [ -n "$imagemin_dist" ];then
# echo "npm install gruntjs/grunt-contrib-imagemin"
#${node4_path}/
# npm install gruntjs/grunt-contrib-imagemin
#${node4_path}/npm --registry http://192.168.3.7:4873 install async
#else
# echo "dont install imagemin"
#fi
# --registry http://192.168.3.7:4873
if [ "$node_version" = "node4" ] ;then
echo "----node-V4---${node4_path}/npm install"
${node4_path}/npm install
else
npm --registry http://172.16.3.15:4873 install
fi
bower_json=`find ./ -maxdepth 1 -name "bower.json"`
if [ -n "$bower_json" ];then
echo "bower install --allow-root"
bower install --allow-root
else
echo "don't have bower.json"
fi
$command
# 第二步 不关机使得nginx生效
nginx -t; nginx -s reload
}
function buildNodeProject()
{
project=$1
desc=`node $config_server/get_project_config.js -name $project -attr desc`
sh $config_server/show_info.sh $project BUILD $desc $2
config_file=`node $config_server/get_project_config.js -name $project -attr config_file`
command=`node $config_server/get_project_config.js -name $project -attr command`
node_version=`node $config_server/get_project_config.js -name $project -attr node_version`
# 第一步 将nginx项目的所有文件进行打包
cd $project_path/$project
#第二步 关联配置文件
rm -rf ./$config_file
echo "------ln -s $config_path/node/$project.* ./$config_file"
ln -s $config_path/node/$project.* ./$config_file
npm config set "@types:registry" http://registry.npmjs.org/
npm --registry http://172.16.3.15:4873 install
}
function buildPythonProject()
{
project=$1
desc=`node $config_server/get_project_config.js -name $project -attr desc`
sh $config_server/show_info.sh $project BUILD $desc $2
config_file=`node $config_server/get_project_config.js -name $project -attr config_file`
cd $project_path/$project
setup_path_temp=`find ./ -name "setup.py"`
python ${setup_path_temp} install
#第四步 关联配置文件
rm -rf $config_file
ln -s $config_path/python/$project.* $config_file
}
if [ "$project_type" = "java" ]; then if [ "$project_type" = "java" ]; then
buildJavaProject $project_name $3 sh $pwd_path/base_script/buildJava.sh $project_name $config_server $project_path
# buildJavaProject $project_name $3
elif [ "$project_type" = "ui" ]; then elif [ "$project_type" = "ui" ]; then
buildUiProject $project_name $3 sh $pwd_path/base_script/buildUi.sh $project_name $config_server $project_path
# buildUiProject $project_name $3
elif [ "$project_type" = "node" ]; then elif [ "$project_type" = "node" ]; then
buildNodeProject $project_name $3 sh $pwd_path/base_script/buildNode.sh $project_name $config_server $project_path
# buildNodeProject $project_name $3
elif [ "$project_type" = "python" ]; then elif [ "$project_type" = "python" ]; then
buildPythonProject $project_name $3 sh $pwd_path/base_script/buildPython.sh $project_name $config_server $project_path
# buildPythonProject $project_name $3
fi fi
...@@ -6,97 +6,8 @@ pwd_path="/home/qa-deploy-utils/qa_shell_script" ...@@ -6,97 +6,8 @@ pwd_path="/home/qa-deploy-utils/qa_shell_script"
config_server="$pwd_path/config_server" config_server="$pwd_path/config_server"
project_path=`cat $config_server/project_path.sh` project_path=`cat $config_server/project_path.sh`
config_path=`cat $config_server/config_path.sh` config_path=`cat $config_server/config_path.sh`
node4_path=`cat $config_server/node_4_path.sh`
node7_path=`cat $config_server/node_7_path.sh`
profile=test
host=`/sbin/ifconfig -a|grep inet|grep -v 127.0.0.1|grep -v inet6|awk '{print $2}'|tr -d "addr:"`
hosts=(${host//\./ })
suffix=${hosts[3]}
function buildJavaProject()
{
project=$1
desc=`node $config_server/get_project_config.js -name $project -attr desc`
target_path=`node $config_server/get_project_config.js -name $project -attr target_path`
sh $config_server/show_info.sh $project "打包BUILD" $desc $2
cd $project_path/$project
rm -rf $target_path
rm -rf $project.jar
if [[ "$project" = "xyqb" || "$project" = "gu-bei" || "$project" = "han-gu-guan" || "$project" = "di-ting" || "$project" = "xyqb-offline" || "$project" = "xyqb-user2" ]]; then
echo "module is $project, need replace sms jar version from 1.0.x to 1.0.2"
num=`grep -n -A12 "<id>test</id>" $project_path/$project/pom.xml| grep "<version>" | awk -F- '{print $1}'`
sed -i "${num}s/1.0.[0-9]-SNAPSHOT/1.0.6.3-SNAPSHOT/" $project_path/$project/pom.xml
fi
if [[ "$project" = "du-jiang-yan" ]]; then
num=`grep -n -A3 "<artifactId>fund-manage-sdk</artifactId>" $project_path/$project/pom.xml| grep "<version>" | awk -F- '{print $1}'`
sed -i "${num}s/1.0.[0-9]-SNAPSHOT/1.0.0.${suffix}-SNAPSHOT/" $project_path/$project/pom.xml
sed -i "${num}s/1.0.[0-9].[0-9]/1.0.0.${suffix}-SNAPSHOT/" $project_path/$project/pom.xml
fi
if [[ "$project" = "finance-api" || "$project" = "financial-system" ]]; then
num=`grep -n -A1 "<artifactId>quantgroup-sms-sdk</artifactId>" $project_path/$project/pom.xml| grep "<version>" | awk -F- '{print $1}'`
echo "----$project-----pom.xml file line: $num------------"
sed -i "${num}s/1.0.6.3/1.0.6.3-SNAPSHOT/" $project_path/$project/pom.xml
fi
echo "mvn clean package -P${profile} -Dmaven.test.skip=true"
mvn clean package -P${profile} -Dmaven.test.skip=true
mv $project_path/$project/$target_path/*.jar $project_path/$project/$project.jar
}
function buildUiProject()
{
project=$1
desc=`node $config_server/get_project_config.js -name $project -attr desc`
echo
sh $config_server/show_info.sh $project "打包BUILD" $desc $2
config_file=`node $config_server/get_project_config.js -name $project -attr config_file`
command=`node $config_server/get_project_config.js -name $project -attr command`
node_version=`node $config_server/get_project_config.js -name $project -attr node_version`
# 第一步 将nginx项目的所有文件进行打包
cd $project_path/$project
rm -rf ./$config_file
if $is_public_ip && [ -n "$is_public_ip" ]
then
cp $config_path/public/ui/$project.* $project_path/$project/$config_file
else
cp $config_path/ui/$project.* $project_path/$project/$config_file
fi
imagemin_dist=`grep -n -A3 "imagemin" *.js|awk '{print $1}'`
if [ -n "$imagemin_dist" ];then
echo "npm install gruntjs/grunt-contrib-imagemin"
#${node4_path}/
npm install gruntjs/grunt-contrib-imagemin
#
else
echo "dont install imagemin"
fi
if [ "$node_version" = "node4" ] ;then
echo "----node-V4---${node4_path}/npm install"
${node4_path}/npm install
else
npm --registry http://172.16.3.15:4873 install
fi
bower_json=`find ./ -maxdepth 1 -name "bower.json"`
if [ -n "$bower_json" ];then
echo "bower install --allow-root"
bower install --allow-root
else
echo "don't have bower.json"
fi
$command
}
function buildNginx() function buildNginx()
{ {
...@@ -105,85 +16,59 @@ function buildNginx() ...@@ -105,85 +16,59 @@ function buildNginx()
nginx -t; nginx -s reload nginx -t; nginx -s reload
} }
function buildNodeProject()
{
project=$1
desc=`node $config_server/get_project_config.js -name $project -attr desc`
echo
sh $config_server/show_info.sh $project "打包BUILD" $desc $2
config_file=`node $config_server/get_project_config.js -name $project -attr config_file`
command=`node $config_server/get_project_config.js -name $project -attr command`
node_version=`node $config_server/get_project_config.js -name $project -attr node_version`
# 第一步 将nginx项目的所有文件进行打包
cd $project_path/$project
#第二步 关联配置文件
rm -rf ./$config_file
echo " ------------ln -s $config_path/node/$project.* ./$config_file"
ln -s $config_path/node/$project.* ./$config_file
npm config set "@types:registry" http://registry.npmjs.org/
npm --registry http://172.16.3.15:4873 install
}
function buildPythonProject()
{
project=$1
desc=`node $config_server/get_project_config.js -name $project -attr desc`
sh $config_server/show_info.sh $project BUILD $desc $2
config_file=`node $config_server/get_project_config.js -name $project -attr config_file`
cd $project_path/$project
setup_path_temp=`find ./ -name "setup.py"`
python ${setup_path_temp} install
#第四步 关联配置文件
rm -rf $config_file
ln -s $config_path/python/$project.* $config_file
}
if [ "$project_type" = "java" ]; then if [ "$project_type" = "java" ]; then
java_projects=(`node $config_server/get_project_config.js -type java -attr name`) java_projects=(`node $config_server/get_project_config.js -type java -attr name`)
for project in ${java_projects[@]} for project_name in ${java_projects[@]}
do do
buildJavaProject $project sh $pwd_path/base_script/buildJava.sh $project_name $config_server $project_path
# buildJavaProject $project
done done
elif [ "$project_type" = "ui" ]; then elif [ "$project_type" = "ui" ]; then
ui_projects=(`node $config_server/get_project_config.js -type ui -attr name`) ui_projects=(`node $config_server/get_project_config.js -type ui -attr name`)
for project in ${ui_projects[@]} for project_name in ${ui_projects[@]}
do do
buildUiProject $project sh $pwd_path/base_script/buildUi.sh $project_name $config_server $project_path
# buildUiProject $project
done done
buildNginx buildNginx
elif [ "$project_type" = "node" ]; then elif [ "$project_type" = "node" ]; then
node_projects=(`node $config_server/get_project_config.js -type node -attr name`) node_projects=(`node $config_server/get_project_config.js -type node -attr name`)
for project in ${node_projects[@]} for project_name in ${node_projects[@]}
do do
buildNodeProject $project sh $pwd_path/base_script/buildNode.sh $project_name $config_server $project_path
# buildNodeProject $project
done done
elif [ "$project_type" = "python" ]; then elif [ "$project_type" = "python" ]; then
python_projects=(`node $config_server/get_project_config.js -type python -attr name`) python_projects=(`node $config_server/get_project_config.js -type python -attr name`)
for project in ${python_projects[@]} for project_name in ${python_projects[@]}
do do
buildPythonProject $project sh $pwd_path/base_script/buildPython.sh $project_name $config_server $project_path
# buildPythonProject $project
done done
else else
java_projects=(`node $config_server/get_project_config.js -type java -attr name`) java_projects=(`node $config_server/get_project_config.js -type java -attr name`)
for project in ${java_projects[@]} for project_name in ${java_projects[@]}
do do
buildJavaProject $project $ip sh $pwd_path/base_script/buildJava.sh $project_name $config_server $project_path
# buildJavaProject $project $ip
done done
python_projects=(`node $config_server/get_project_config.js -type python -attr name`) python_projects=(`node $config_server/get_project_config.js -type python -attr name`)
for project in ${python_projects[@]} for project_name in ${python_projects[@]}
do do
buildPythonProject $project $ip sh $pwd_path/base_script/buildPython.sh $project_name $config_server $project_path
# buildPythonProject $project $ip
done done
node_projects=(`node $config_server/get_project_config.js -type node -attr name`) node_projects=(`node $config_server/get_project_config.js -type node -attr name`)
for project in ${node_projects[@]} for project_name in ${node_projects[@]}
do do
buildNodeProject $project $ip sh $pwd_path/base_script/buildNode.sh $project_name $config_server $project_path
# buildNodeProject $project $ip
done done
ui_projects=(`node $config_server/get_project_config.js -type ui -attr name`) ui_projects=(`node $config_server/get_project_config.js -type ui -attr name`)
for project in ${ui_projects[@]} for project_name in ${ui_projects[@]}
do do
buildUiProject $project $ip sh $pwd_path/base_script/buildUi.sh $project_name $config_server $project_path
# buildUiProject $project $ip
done done
buildNginx buildNginx
fi fi
...@@ -7,174 +7,17 @@ config_server="$pwd_path/config_server" ...@@ -7,174 +7,17 @@ config_server="$pwd_path/config_server"
project_type=`node $config_server/get_project_config.js -name $project_name -attr type` project_type=`node $config_server/get_project_config.js -name $project_name -attr type`
project_path=`cat $config_server/project_path.sh` project_path=`cat $config_server/project_path.sh`
config_path=`cat $config_server/config_path.sh` config_path=`cat $config_server/config_path.sh`
node4_path=`cat $config_server/node_4_path.sh`
node7_path=`cat $config_server/node_7_path.sh`
profile=test
time=`date +%Y_%m_%d_%H_%M_%S`
function restartJavaProject()
{
max_wait_log_generate_time=50
max_wait_ack_time=500
ack_phrase="Started\ Bootstrap"
project=$1
desc=`node $config_server/get_project_config.js -name $project -attr desc`
run_command=`node $config_server/get_project_config.js -name $project -attr command`
sh $config_server/show_info.sh $project 重新启动 $desc $2
cd $project_path/$project
P_UUID=`ps -ef|grep ${project}.jar |grep -v 'grep'|awk '{print $2}'`
if [ -n "${P_UUID}" ];then
echo "-----KILL $project PPID=${P_UUID}"
echo `kill -9 ${P_UUID}`
sleep 2s
fi
config_file=`find ./ -maxdepth 2 -name "application.properties"`
if [ -n "$config_file" ]
then
echo "have"
else
echo "no have"
if $is_public_ip && [ -n "$is_public_ip" ]
then
rm -rf /home/quant_group/${project}/application.properties
echo "ln -s $config_path/public/java/${project}.* /home/quant_group/${project}/application.properties"
ln -s $config_path/public/java/${project}.* /home/quant_group/${project}/application.properties
else
rm -rf /home/quant_group/${project}/application.properties
echo "ln -s $config_path/java/${project}.* /home/quant_group/${project}/application.properties"
ln -s $config_path/java/${project}.* /home/quant_group/${project}/application.properties
fi
fi
echo "-----project:$project while be start"
log_name=`node $config_server/get_project_config.js -name $project -attr log_name`
mv $project_path/logs/$log_name $project_path/logs/$project.log.$time
echo "$run_command"
if [[ $project == "redpacket" ]]; then
echo `java -Xmx512m -XX:PermSize64m -Xloggc:/tmp/${project}.log -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -jar ${project}.jar --worker 1 --currentWorker 1 -t -ts > /dev/null 2>&1 &`
else
echo `java -Xmx512m -XX:PermSize64m -Xloggc:/tmp/${project}.log -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -jar ${project}.jar --worker 1 --currentWorker 1 -t > /dev/null 2>&1 &`
fi
ack "$ack_phrase" $project_path/logs/$log_name ${max_wait_log_generate_time} ${max_wait_ack_time}
if [ $? -ne 0 ]
then
echo "Fail to start"
exit -1
fi
}
function restartNodeProject()
{
project=$1
desc=`node $config_server/get_project_config.js -name $project -attr desc`
stop_command=`node $config_server/get_project_config.js -name $project -attr command2`
sh $config_server/show_info.sh $project 重新启动 $desc $2
cd $project_path/$project
$stop_command
# forever stop $project
# forever stop $project-www
# pm2 stop $project
start_command=`node $config_server/get_project_config.js -name $project -attr command`
$start_command
if [ $? -ne 0 ]
then
echo "Fail to start"
exit -1
fi
# setup_path_temp=`find ./ -maxdepth 2 -path "./node_modules" -prune -o -type f -name "app.js" -print`
# echo "------setup_path_temp:$setup_path_temp"
#
# echo `forever start -a -s --uid $project ${setup_path_temp}`
#
# setup_path_temp_for_appbackent=`find ./ -maxdepth 2 -path "./node_modules" -prune -o -type f -name "www" -print`
# if [ -n "$setup_path_temp_for_appbackent" ];then
# echo "-----project:$project while be run command: python $python_project_path --mode=beta --port=$port > /dev/null 2>&1 &"
# echo `forever start -a -s --uid $project-www ${setup_path_temp_for_appbackent}`
# fi
}
function restartPythonProject()
{
project=$1
desc=`node $config_server/get_project_config.js -name $project -attr desc`
port=`node $config_server/get_project_config.js -name $project -attr port`
sh $config_server/show_info.sh $project 重新启动 $desc $2
cd $project_path/$project
setup_path_temp=`find ./ -name "run.py"`
python_project_path=$project_path/$project${setup_path_temp/\.\//\/}
P_UUID=`ps -ef|grep port=$port |grep -v 'grep'|awk '{print $2}'`
if [[ "${P_UUID}" != "" ]];then
echo "-----KILL $project PPID=${P_UUID}"
echo `kill -9 ${P_UUID}`
sleep 3
fi
echo "-----project:$project while be run command: python $python_project_path --mode=beta --port=$port > /dev/null 2>&1 &"
echo `python $python_project_path --mode=beta --port=$port > /dev/null 2>&1 &`
}
function restartUiProject()
{
nginx -t; nginx -s reload
}
#acknowledge whether the deploy start OK
function ack()
{
ack_phrase="$1"
log_path="$2"
max_wait_log_generate_time="$3"
max_wait_ack_time="$4"
wait_log_generate_time=0
wait_ack_time=0
echo "begin acknowledge whether the deploy start OK, ACK_PHRASE=${ack_phrase}, log_path=${log_path}"
while [ ! -f ${log_path} ]
do
echo "wait_log_generate_time is ${wait_log_generate_time}, max_wait_log_generate_time is ${max_wait_log_generate_time} "
if ((${wait_log_generate_time}>${max_wait_log_generate_time}))
then
echo "the log generated time exceed the limit"
exit -1
fi
echo 'the log does not exist, wait for 5 seconds'
sleep 5
let "wait_log_generate_time+=5"
done
echo "listen for the log ack..."
for ((i=0;;))
do
bootstrap_flag=`cat ${log_path} |grep "${ack_phrase}"| wc -l`
if [ "${bootstrap_flag}" = 0 ] && [ "${max_wait_ack_time}" -gt "${wait_ack_time}" ]
then
sleep 5
let "wait_ack_time+=5"
echo "waiting for bootstrap flag for ${wait_ack_time}"
elif [ "${bootstrap_flag}" = 1 ]
then
echo "server is start~"
exit 0
else
echo "server not startup in ${max_wait_ack_time} seconds..."
exit -1
fi
done
}
if [ "$project_type" = "java" ]; then if [ "$project_type" = "java" ]; then
restartJavaProject $project_name $3 sh $pwd_path/base_script/restartJava.sh $project_name $config_server $project_path
# restartJavaProject $project_name $3
elif [ "$project_type" = "node" ]; then elif [ "$project_type" = "node" ]; then
restartNodeProject $project_name $3 sh $pwd_path/base_script/restartNode.sh $project_name $config_server $project_path
# restartNodeProject $project_name $3
elif [ "$project_type" = "python" ]; then elif [ "$project_type" = "python" ]; then
restartPythonProject $project_name $3 sh $pwd_path/base_script/restartPython.sh $project_name $config_server $project_path
# restartPythonProject $project_name $3
elif [ "$project_type" = "ui" ]; then elif [ "$project_type" = "ui" ]; then
restartUiProject $project_name $3 sh $pwd_path/base_script/restartUi.sh $project_name $config_server $project_path
# restartUiProject $project_name $3
fi fi
...@@ -7,115 +7,34 @@ config_shell_path="$pwd_path" ...@@ -7,115 +7,34 @@ config_shell_path="$pwd_path"
config_server="$pwd_path/config_server" config_server="$pwd_path/config_server"
project_path=`cat $config_server/project_path.sh` project_path=`cat $config_server/project_path.sh`
config_path=`cat $config_server/config_path.sh` config_path=`cat $config_server/config_path.sh`
node4_path=`cat $config_server/node_4_path.sh`
node7_path=`cat $config_server/node_7_path.sh`
profile=test
max_wait_log_generate_time=50
max_wait_ack_time=500
ack_phrase="Started\ Bootstrap"
time=`date +%Y_%m_%d_%H_%M_%S`
function restartJavaProject() function restartJavaProject()
{ {
projects=(`node $config_server/get_project_config.js -type java -attr name`) projects=(`node $config_server/get_project_config.js -type java -attr name`)
echo ${projects[@]} for project_name in ${projects[@]}
for project in ${projects[@]}
do do
desc=`node $config_server/get_project_config.js -name $project -attr desc` echo "$config_server"
run_command=`node $config_server/get_project_config.js -name $project -attr command` echo "$project_path"
sh $config_server/show_info.sh $project 重新启动 $desc $1 sh $pwd_path/base_script/restartJava.sh $project_name $config_server $project_path 1
cd $project_path/$project sleep 10s
P_UUID=`ps -ef|grep ${project}.jar |grep -v 'grep'|awk '{print $2}'`
if [ -n "${P_UUID}" ];then
echo "KILL $project PPID=${P_UUID}"
echo `kill -9 ${P_UUID}`
sleep 2s
fi
log_name=`node $config_server/get_project_config.js -name $project -attr log_name`
mv $project_path/logs/$log_name $project_path/logs/$project.log.$time
config_file=`find ./ -maxdepth 2 -name "application.properties"`
if [ -n "$config_file" ]
then
echo "already have application.properties"
else
echo "no have application.properties"
if $is_public_ip && [ -n "$is_public_ip" ]
then
echo "ln -s $config_path/public/java/${project}.* /home/quant_group/${project}/application.properties"
ln -s $config_path/public/java/${project}.* /home/quant_group/${project}/application.properties
else
echo "ln -s $config_path/java/${project}.* /home/quant_group/${project}/application.properties"
ln -s $config_path/java/${project}.* /home/quant_group/${project}/application.properties
fi
fi
echo "$run_command"
if [[ $project == "redpacket" ]]; then
echo `java -Xmx512m -XX:PermSize64m -Xloggc:/tmp/${project}.log -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -jar ${project}.jar --worker 1 --currentWorker 1 -t -ts > /dev/null 2>&1 &`
else
echo `java -Xmx512m -XX:PermSize64m -Xloggc:/tmp/${project}.log -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -jar ${project}.jar --worker 1 --currentWorker 1 -t > /dev/null 2>&1 &`
fi
sleep 10s
#ack "$ack_phrase" $project_path/logs/$log_name ${max_wait_log_generate_time} ${max_wait_ack_time}
done done
} }
function restartNodeProject() function restartNodeProject()
{ {
projects=(`node $config_server/get_project_config.js -type node -attr name`) projects=(`node $config_server/get_project_config.js -type node -attr name`)
for project in ${projects[@]} for project_name in ${projects[@]}
do do
desc=`node $config_server/get_project_config.js -name $project -attr desc` sh $pwd_path/base_script/restartNode.sh $project_name $config_server $project_path
stop_command=`node $config_server/get_project_config.js -name $project -attr command2`
sh $config_server/show_info.sh $project 重新启动 $desc $1
cd $project_path/$project
$stop_command
# forever stop $project
# forever stop $project-www
# pm2 stop $project
start_command=`node $config_server/get_project_config.js -name $project -attr command`
$start_command
# setup_path_temp=`find ./ -maxdepth 2 -path "./node_modules" -prune -o -type f -name "app.js" -print`
# echo "------setup_path_temp:$setup_path_temp"
#
# echo `forever start -a -s --uid $project ${setup_path_temp}`
#
# setup_path_temp_for_appbackent=`find ./ -maxdepth 2 -path "./node_modules" -prune -o -type f -name "www" -print`
# if [ -n "$setup_path_temp_for_appbackent" ];then
# echo "-----project:$project while be run command: python $python_project_path --mode=beta --port=$port > /dev/null 2>&1 &"
# echo `forever start -a -s --uid $project-www ${setup_path_temp_for_appbackent}`
# fi
done done
} }
function restartPythonProject() function restartPythonProject()
{ {
projects=(`node $config_server/get_project_config.js -type python -attr name`) projects=(`node $config_server/get_project_config.js -type python -attr name`)
for project in ${projects[@]} for project_name in ${projects[@]}
do do
desc=`node $config_server/get_project_config.js -name $project -attr desc` sh $pwd_path/base_script/restartPython.sh $project_name $config_server $project_path
port=`node $config_server/get_project_config.js -name $project -attr port`
sh $config_server/show_info.sh $project 重新启动 $desc $1
cd $project_path/$project
setup_path_temp=`find ./ -name "run.py"`
python_project_path=$project_path/$project${setup_path_temp/\.\//\/}
P_UUID=`ps -ef|grep port=$port |grep -v 'grep'|awk '{print $2}'`
if [[ "${P_UUID}" != "" ]];then
echo "KILL $project PPID=${P_UUID}"
echo `kill -9 ${P_UUID}`
sleep 3
fi
echo "-----project:$project while be run command: python $python_project_path --mode=beta --port=$port > /dev/null 2>&1 &"
echo `python $python_project_path --mode=beta --port=$port > /dev/null 2>&1 &`
done done
} }
...@@ -124,63 +43,21 @@ function restartUiProject() ...@@ -124,63 +43,21 @@ function restartUiProject()
nginx -t; nginx -s reload nginx -t; nginx -s reload
} }
#acknowledge whether the deploy start OK
function ack()
{
ack_phrase="$1"
log_path="$2"
max_wait_log_generate_time="$3"
max_wait_ack_time="$4"
wait_log_generate_time=0
wait_ack_time=0
echo "begin acknowledge whether the deploy start OK, ACK_PHRASE=${ack_phrase}, log_path=${log_path}"
while [ ! -f ${log_path} ]
do
echo "wait_log_generate_time is ${wait_log_generate_time}, max_wait_log_generate_time is ${max_wait_log_generate_time} "
if ((${wait_log_generate_time}>${max_wait_log_generate_time}))
then
echo "the log generated time exceed the limit"
exit -1
fi
echo 'the log does not exist, wait for 5 seconds'
sleep 5
let "wait_log_generate_time+=5"
done
echo "listen for the log ack..."
for ((i=0;;))
do
bootstrap_flag=`cat ${log_path} |grep "${ack_phrase}"| wc -l`
if [ "${bootstrap_flag}" = 0 ] && [ "${max_wait_ack_time}" -gt "${wait_ack_time}" ]
then
sleep 5
let "wait_ack_time+=5"
echo "waiting for bootstrap flag for ${wait_ack_time}"
elif [ "${bootstrap_flag}" = 1 ]
then
echo "server is start~ log_path:$log_path"
break
else
echo "server not startup in ${max_wait_ack_time} seconds.. log_path:$log_path"
exit -1
fi
done
}
if [ "$project_type" = "java" ]; then if [ "$project_type" = "java" ]; then
restartJavaProject restartJavaProject pwd_path
elif [ "$project_type" = "node" ]; then elif [ "$project_type" = "node" ]; then
restartNodeProject restartNodeProject pwd_path
elif [ "$project_type" = "python" ]; then elif [ "$project_type" = "python" ]; then
restartPythonProject restartPythonProject pwd_path
elif [ "$project_type" = "ui" ]; then elif [ "$project_type" = "ui" ]; then
restartUiProject restartUiProject pwd_path
else else
echo "***restart java***" echo "***restart java***"
restartJavaProject $ip restartJavaProject pwd_path
echo "***restart python***" echo "***restart python***"
restartPythonProject $ip restartPythonProject pwd_path
echo "***restart node***" echo "***restart node***"
restartNodeProject $ip restartNodeProject pwd_path
echo "***restart ui***" echo "***restart ui***"
restartUiProject $ip restartUiProject pwd_path
fi fi
...@@ -15,7 +15,7 @@ function restartJavaProject() ...@@ -15,7 +15,7 @@ function restartJavaProject()
{ {
max_wait_log_generate_time=50 max_wait_log_generate_time=50
max_wait_ack_time=500 max_wait_ack_time=500
ack_phrase="Started\ Bootstrap" ack_phrase="JVM\ running\ for"
project=$1 project=$1
desc=`node $config_server/get_project_config.js -name $project -attr desc` desc=`node $config_server/get_project_config.js -name $project -attr desc`
sh $config_server/show_info.sh $project 重新启动 $desc sh $config_server/show_info.sh $project 重新启动 $desc
......
{
"name": "angular-animate",
"version": "1.4.14",
"license": "MIT",
"main": "./angular-animate.js",
"ignore": [],
"dependencies": {
"angular": "1.4.14"
},
"homepage": "https://github.com/angular/bower-angular-animate",
"_release": "1.4.14",
"_resolution": {
"type": "version",
"tag": "v1.4.14",
"commit": "e7f778fc054a086ba3326d898a00fa1bc78650a8"
},
"_source": "https://github.com/angular/bower-angular-animate.git",
"_target": "~1.4.3",
"_originalSource": "angular-animate"
}
\ No newline at end of file
The MIT License (MIT)
Copyright (c) 2016 Angular
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
# packaged angular-animate
This repo is for distribution on `npm` and `bower`. The source for this module is in the
[main AngularJS repo](https://github.com/angular/angular.js/tree/master/src/ngAnimate).
Please file issues and pull requests against that repo.
## Install
You can install this package either with `npm` or with `bower`.
### npm
```shell
npm install angular-animate
```
Then add `ngAnimate` as a dependency for your app:
```javascript
angular.module('myApp', [require('angular-animate')]);
```
### bower
```shell
bower install angular-animate
```
Then add a `<script>` to your `index.html`:
```html
<script src="/bower_components/angular-animate/angular-animate.js"></script>
```
Then add `ngAnimate` as a dependency for your app:
```javascript
angular.module('myApp', ['ngAnimate']);
```
## Documentation
Documentation is available on the
[AngularJS docs site](http://docs.angularjs.org/api/ngAnimate).
## License
The MIT License
Copyright (c) 2010-2015 Google, Inc. http://angularjs.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
{
"name": "angular-animate",
"version": "1.4.14",
"license": "MIT",
"main": "./angular-animate.js",
"ignore": [],
"dependencies": {
"angular": "1.4.14"
}
}
require('./angular-animate');
module.exports = 'ngAnimate';
{
"name": "angular-animate",
"version": "1.4.14",
"description": "AngularJS module for animations",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://github.com/angular/angular.js.git"
},
"keywords": [
"angular",
"framework",
"browser",
"animation",
"client-side"
],
"author": "Angular Core Team <angular-core+npm@google.com>",
"license": "MIT",
"bugs": {
"url": "https://github.com/angular/angular.js/issues"
},
"homepage": "http://angularjs.org",
"jspm": {
"shim": {
"angular-animate": {
"deps": ["angular"]
}
}
}
}
{
"author": {
"name": "https://github.com/angular-ui/bootstrap/graphs/contributors"
},
"name": "angular-bootstrap",
"keywords": [
"angular",
"angular-ui",
"bootstrap"
],
"license": "MIT",
"ignore": [],
"description": "Native AngularJS (Angular) directives for Bootstrap.",
"version": "0.13.4",
"main": [
"./ui-bootstrap-tpls.js"
],
"dependencies": {
"angular": ">=1.3.0"
},
"homepage": "https://github.com/angular-ui/bootstrap-bower",
"_release": "0.13.4",
"_resolution": {
"type": "version",
"tag": "0.13.4",
"commit": "a5f2d4bdcbbbae9cc6bd34a0a79f24e9aacc8ab9"
},
"_source": "https://github.com/angular-ui/bootstrap-bower.git",
"_target": "~0.13.0",
"_originalSource": "angular-bootstrap"
}
\ No newline at end of file
### UI Bootstrap - [AngularJS](http://angularjs.org/) directives specific to [Bootstrap](http://getbootstrap.com)
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/angular-ui/bootstrap?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build Status](https://secure.travis-ci.org/angular-ui/bootstrap.svg)](http://travis-ci.org/angular-ui/bootstrap)
[![devDependency Status](https://david-dm.org/angular-ui/bootstrap/dev-status.svg?branch=master)](https://david-dm.org/angular-ui/bootstrap#info=devDependencies)
### Quick links
- [Demo](#demo)
- [Installation](#installation)
- [NPM](#install-with-npm)
- [Bower](#install-with-bower)
- [NuGet](#install-with-nuget)
- [Custom](#custom-build)
- [Manual](#manual-download)
- [Support](#support)
- [FAQ](#faq)
- [Supported browsers](#supported-browsers)
- [Need help?](#need-help)
- [Found a bug?](#found-a-bug)
- [Contributing to the project](#contributing-to-the-project)
- [Development, meeting minutes, roadmap and more.](#development-meeting-minutes-roadmap-and-more)
# Demo
Do you want to see directives in action? Visit http://angular-ui.github.io/bootstrap/!
# Installation
Installation is easy as UI Bootstrap has minimal dependencies - only the AngularJS and Twitter Bootstrap's CSS are required.
Note: Since version 0.13.0, UI Bootstrap depends on [ngAnimate](https://docs.angularjs.org/api/ngAnimate) for transitions and animations, such as the accordion, carousel, etc. Include `ngAnimate` in the module dependencies for your app in order to enable animation.
#### Install with NPM
```sh
$ npm install angular-ui-bootstrap
```
This will install AngularJS and Bootstrap NPM packages.
#### Install with Bower
```sh
$ bower install angular-bootstrap
```
Note: do not install 'angular-ui-bootstrap'. A separate repository - [bootstrap-bower](https://github.com/angular-ui/bootstrap-bower) - hosts the compiled javascript file and bower.json.
#### Install with NuGet
To install AngularJS UI Bootstrap, run the following command in the Package Manager Console
```sh
PM> Install-Package Angular.UI.Bootstrap
```
#### Custom build
Head over to http://angular-ui.github.io/bootstrap/ and hit the *Custom build* button to create your own custom UI Bootstrap build, just the way you like it.
#### Manual download
After downloading dependencies (or better yet, referencing them from your favorite CDN) you need to download build version of this project. All the files and their purposes are described here:
https://github.com/angular-ui/bootstrap/tree/gh-pages#build-files
Don't worry, if you are not sure which file to take, opt for `ui-bootstrap-tpls-[version].min.js`.
### Adding dependency to your project
When you are done downloading all the dependencies and project files the only remaining part is to add dependencies on the `ui.bootstrap` AngularJS module:
```js
angular.module('myModule', ['ui.bootstrap']);
```
If you're a Browserify or Webpack user, you can do:
```js
var uibs = require('angular-ui-bootstrap');
angular.module('myModule', [uibs]);
```
# Support
## FAQ
https://github.com/angular-ui/bootstrap/wiki/FAQ
## Supported browsers
Directives from this repository are automatically tested with the following browsers:
* Chrome (stable and canary channel)
* Firefox
* IE 9 and 10
* Opera
* Safari
Modern mobile browsers should work without problems.
## Need help?
Need help using UI Bootstrap?
* Live help in the IRC (`#angularjs` channel at the `freenode` network). Use this [webchat](https://webchat.freenode.net/) or your own IRC client.
* Ask a question in [StackOverflow](http://stackoverflow.com/) under the [angular-ui-bootstrap](http://stackoverflow.com/questions/tagged/angular-ui-bootstrap) tag.
**Please do not create new issues in this repository to ask questions about using UI Bootstrap**
## Found a bug?
Please take a look at [CONTRIBUTING.md](CONTRIBUTING.md#you-think-youve-found-a-bug) and submit your issue [here](https://github.com/angular-ui/bootstrap/issues/new).
----
# Contributing to the project
We are always looking for the quality contributions! Please check the [CONTRIBUTING.md](CONTRIBUTING.md) for the contribution guidelines.
# Development, meeting minutes, roadmap and more.
Head over to the [Wiki](https://github.com/angular-ui/bootstrap/wiki) for notes on development for UI Bootstrap, meeting minutes from the UI Bootstrap team, roadmap plans, project philosophy and more.
{
"author": {
"name": "https://github.com/angular-ui/bootstrap/graphs/contributors"
},
"name": "angular-bootstrap",
"keywords": [
"angular",
"angular-ui",
"bootstrap"
],
"license": "MIT",
"ignore": [],
"description": "Native AngularJS (Angular) directives for Bootstrap.",
"version": "0.13.4",
"main": ["./ui-bootstrap-tpls.js"],
"dependencies": {
"angular": ">=1.3.0"
}
}
require('./ui-bootstrap-tpls');
module.exports = 'ui.bootstrap';
{
"name": "angular-ui-bootstrap",
"version": "0.13.4",
"description": "Bootstrap widgets for Angular",
"main": "index.js",
"homepage": "http://angular-ui.github.io/bootstrap/",
"repository": {
"type": "git",
"url": "https://github.com/angular-ui/bootstrap.git"
},
"keywords": [
"angular",
"bootstrap",
"angular-ui",
"components",
"client-side"
],
"author": "https://github.com/angular-ui/bootstrap/graphs/contributors",
"peerDependencies": {
"angular": "^1.3.x || >= 1.4.0-beta.0 || >= 1.5.0-beta.0",
"bootstrap": "^3.x"
},
"license": "MIT"
}
/* Include this file in your html if you are using the CSP mode. */
.ng-animate.item:not(.left):not(.right) {
-webkit-transition: 0s ease-in-out left;
transition: 0s ease-in-out left
}
\ No newline at end of file
{
"name": "angular-cookies",
"version": "1.6.1",
"license": "MIT",
"main": "./angular-cookies.js",
"ignore": [],
"dependencies": {
"angular": "1.6.1"
},
"homepage": "https://github.com/angular/bower-angular-cookies",
"_release": "1.6.1",
"_resolution": {
"type": "version",
"tag": "v1.6.1",
"commit": "7abd6b5182e5a477799bd731f5dcf74ec713e855"
},
"_source": "https://github.com/angular/bower-angular-cookies.git",
"_target": ">=1.2.*",
"_originalSource": "angular-cookies"
}
\ No newline at end of file
The MIT License (MIT)
Copyright (c) 2016 Angular
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
# packaged angular-cookies
This repo is for distribution on `npm` and `bower`. The source for this module is in the
[main AngularJS repo](https://github.com/angular/angular.js/tree/master/src/ngCookies).
Please file issues and pull requests against that repo.
## Install
You can install this package either with `npm` or with `bower`.
### npm
```shell
npm install angular-cookies
```
Then add `ngCookies` as a dependency for your app:
```javascript
angular.module('myApp', [require('angular-cookies')]);
```
### bower
```shell
bower install angular-cookies
```
Add a `<script>` to your `index.html`:
```html
<script src="/bower_components/angular-cookies/angular-cookies.js"></script>
```
Then add `ngCookies` as a dependency for your app:
```javascript
angular.module('myApp', ['ngCookies']);
```
## Documentation
Documentation is available on the
[AngularJS docs site](http://docs.angularjs.org/api/ngCookies).
## License
The MIT License
Copyright (c) 2010-2015 Google, Inc. http://angularjs.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
/*
AngularJS v1.6.1
(c) 2010-2016 Google, Inc. http://angularjs.org
License: MIT
*/
(function(n,c){'use strict';function l(b,a,g){var d=g.baseHref(),k=b[0];return function(b,e,f){var g,h;f=f||{};h=f.expires;g=c.isDefined(f.path)?f.path:d;c.isUndefined(e)&&(h="Thu, 01 Jan 1970 00:00:00 GMT",e="");c.isString(h)&&(h=new Date(h));e=encodeURIComponent(b)+"="+encodeURIComponent(e);e=e+(g?";path="+g:"")+(f.domain?";domain="+f.domain:"");e+=h?";expires="+h.toUTCString():"";e+=f.secure?";secure":"";f=e.length+1;4096<f&&a.warn("Cookie '"+b+"' possibly not set or overflowed because it was too large ("+
f+" > 4096 bytes)!");k.cookie=e}}c.module("ngCookies",["ng"]).provider("$cookies",[function(){var b=this.defaults={};this.$get=["$$cookieReader","$$cookieWriter",function(a,g){return{get:function(d){return a()[d]},getObject:function(d){return(d=this.get(d))?c.fromJson(d):d},getAll:function(){return a()},put:function(d,a,m){g(d,a,m?c.extend({},b,m):b)},putObject:function(d,b,a){this.put(d,c.toJson(b),a)},remove:function(a,k){g(a,void 0,k?c.extend({},b,k):b)}}}]}]);c.module("ngCookies").factory("$cookieStore",
["$cookies",function(b){return{get:function(a){return b.getObject(a)},put:function(a,c){b.putObject(a,c)},remove:function(a){b.remove(a)}}}]);l.$inject=["$document","$log","$browser"];c.module("ngCookies").provider("$$cookieWriter",function(){this.$get=l})})(window,window.angular);
//# sourceMappingURL=angular-cookies.min.js.map
{
"version":3,
"file":"angular-cookies.min.js",
"lineCount":8,
"mappings":"A;;;;;aAKC,SAAQ,CAACA,CAAD,CAASC,CAAT,CAAkB,CAmR3BC,QAASA,EAAc,CAACC,CAAD,CAAYC,CAAZ,CAAkBC,CAAlB,CAA4B,CACjD,IAAIC,EAAaD,CAAAE,SAAA,EAAjB,CACIC,EAAcL,CAAA,CAAU,CAAV,CAmClB,OAAO,SAAQ,CAACM,CAAD,CAAOC,CAAP,CAAcC,CAAd,CAAuB,CAjCW,IAC3CC,CAD2C,CACrCC,CACVF,EAAA,CAgCoDA,CAhCpD,EAAqB,EACrBE,EAAA,CAAUF,CAAAE,QACVD,EAAA,CAAOX,CAAAa,UAAA,CAAkBH,CAAAC,KAAlB,CAAA,CAAkCD,CAAAC,KAAlC,CAAiDN,CACpDL,EAAAc,YAAA,CAAoBL,CAApB,CAAJ,GACEG,CACA,CADU,+BACV,CAAAH,CAAA,CAAQ,EAFV,CAIIT,EAAAe,SAAA,CAAiBH,CAAjB,CAAJ,GACEA,CADF,CACY,IAAII,IAAJ,CAASJ,CAAT,CADZ,CAIIK,EAAAA,CAAMC,kBAAA,CAqB6BV,CArB7B,CAANS,CAAiC,GAAjCA,CAAuCC,kBAAA,CAAmBT,CAAnB,CAE3CQ,EAAA,CADAA,CACA,EADON,CAAA,CAAO,QAAP,CAAkBA,CAAlB,CAAyB,EAChC,GAAOD,CAAAS,OAAA,CAAiB,UAAjB,CAA8BT,CAAAS,OAA9B,CAA+C,EAAtD,CACAF,EAAA,EAAOL,CAAA,CAAU,WAAV,CAAwBA,CAAAQ,YAAA,EAAxB,CAAgD,EACvDH,EAAA,EAAOP,CAAAW,OAAA,CAAiB,SAAjB,CAA6B,EAMhCC,EAAAA,CAAeL,CAAAM,OAAfD,CAA4B,CACb,KAAnB,CAAIA,CAAJ,EACEnB,CAAAqB,KAAA,CAAU,UAAV,CASqChB,CATrC,CACE,6DADF;AAEEc,CAFF,CAEiB,iBAFjB,CASFf,EAAAkB,OAAA,CAJOR,CAG6B,CArCW,CAjQnDjB,CAAA0B,OAAA,CAAe,WAAf,CAA4B,CAAC,IAAD,CAA5B,CAAAC,SAAA,CAOY,UAPZ,CAOwB,CAAaC,QAAyB,EAAG,CAkC7D,IAAIC,EAAW,IAAAA,SAAXA,CAA2B,EAiC/B,KAAAC,KAAA,CAAY,CAAC,gBAAD,CAAmB,gBAAnB,CAAqC,QAAQ,CAACC,CAAD,CAAiBC,CAAjB,CAAiC,CACxF,MAAO,CAWLC,IAAKA,QAAQ,CAACC,CAAD,CAAM,CACjB,MAAOH,EAAA,EAAA,CAAiBG,CAAjB,CADU,CAXd,CAyBLC,UAAWA,QAAQ,CAACD,CAAD,CAAM,CAEvB,MAAO,CADHzB,CACG,CADK,IAAAwB,IAAA,CAASC,CAAT,CACL,EAAQlC,CAAAoC,SAAA,CAAiB3B,CAAjB,CAAR,CAAkCA,CAFlB,CAzBpB,CAuCL4B,OAAQA,QAAQ,EAAG,CACjB,MAAON,EAAA,EADU,CAvCd,CAuDLO,IAAKA,QAAQ,CAACJ,CAAD,CAAMzB,CAAN,CAAaC,CAAb,CAAsB,CACjCsB,CAAA,CAAeE,CAAf,CAAoBzB,CAApB,CAAuCC,CAvFpC,CAAUV,CAAAuC,OAAA,CAAe,EAAf,CAAmBV,CAAnB,CAuF0BnB,CAvF1B,CAAV,CAAkDmB,CAuFrD,CADiC,CAvD9B,CAuELW,UAAWA,QAAQ,CAACN,CAAD,CAAMzB,CAAN,CAAaC,CAAb,CAAsB,CACvC,IAAA4B,IAAA,CAASJ,CAAT,CAAclC,CAAAyC,OAAA,CAAehC,CAAf,CAAd,CAAqCC,CAArC,CADuC,CAvEpC,CAsFLgC,OAAQA,QAAQ,CAACR,CAAD,CAAMxB,CAAN,CAAe,CAC7BsB,CAAA,CAAeE,CAAf,CAAoBS,IAAAA,EAApB,CAA2CjC,CAtHxC,CAAUV,CAAAuC,OAAA,CAAe,EAAf,CAAmBV,CAAnB,CAsH8BnB,CAtH9B,CAAV,CAAkDmB,CAsHrD,CAD6B,CAtF1B,CADiF,CAA9E,CAnEiD,CAAzC,CAPxB,CAwKA7B,EAAA0B,OAAA,CAAe,WAAf,CAAAkB,QAAA,CA+BS,cA/BT;AA+ByB,CAAC,UAAD,CAAa,QAAQ,CAACC,CAAD,CAAW,CAErD,MAAO,CAWLZ,IAAKA,QAAQ,CAACC,CAAD,CAAM,CACjB,MAAOW,EAAAV,UAAA,CAAmBD,CAAnB,CADU,CAXd,CAyBLI,IAAKA,QAAQ,CAACJ,CAAD,CAAMzB,CAAN,CAAa,CACxBoC,CAAAL,UAAA,CAAmBN,CAAnB,CAAwBzB,CAAxB,CADwB,CAzBrB,CAsCLiC,OAAQA,QAAQ,CAACR,CAAD,CAAM,CACpBW,CAAAH,OAAA,CAAgBR,CAAhB,CADoB,CAtCjB,CAF8C,CAAhC,CA/BzB,CAmIAjC,EAAA6C,QAAA,CAAyB,CAAC,WAAD,CAAc,MAAd,CAAsB,UAAtB,CAEzB9C,EAAA0B,OAAA,CAAe,WAAf,CAAAC,SAAA,CAAqC,gBAArC,CAAoEoB,QAA+B,EAAG,CACpG,IAAAjB,KAAA,CAAY7B,CADwF,CAAtG,CA/T2B,CAA1B,CAAD,CAoUGF,MApUH,CAoUWA,MAAAC,QApUX;",
"sources":["angular-cookies.js"],
"names":["window","angular","$$CookieWriter","$document","$log","$browser","cookiePath","baseHref","rawDocument","name","value","options","path","expires","isDefined","isUndefined","isString","Date","str","encodeURIComponent","domain","toUTCString","secure","cookieLength","length","warn","cookie","module","provider","$CookiesProvider","defaults","$get","$$cookieReader","$$cookieWriter","get","key","getObject","fromJson","getAll","put","extend","putObject","toJson","remove","undefined","factory","$cookies","$inject","$$CookieWriterProvider"]
}
{
"name": "angular-cookies",
"version": "1.6.1",
"license": "MIT",
"main": "./angular-cookies.js",
"ignore": [],
"dependencies": {
"angular": "1.6.1"
}
}
require('./angular-cookies');
module.exports = 'ngCookies';
{
"name": "angular-cookies",
"version": "1.6.1",
"description": "AngularJS module for cookies",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://github.com/angular/angular.js.git"
},
"keywords": [
"angular",
"framework",
"browser",
"cookies",
"client-side"
],
"author": "Angular Core Team <angular-core+npm@google.com>",
"license": "MIT",
"bugs": {
"url": "https://github.com/angular/angular.js/issues"
},
"homepage": "http://angularjs.org",
"jspm": {
"shim": {
"angular-cookies": {
"deps": ["angular"]
}
}
}
}
{
"name": "angular-elastic",
"version": "2.5.1",
"main": "elastic.js",
"ignore": [
"**/.*",
"node_modules",
"components"
],
"dependencies": {
"angular": ">=1.0.6"
},
"homepage": "https://github.com/monospaced/angular-elastic",
"_release": "2.5.1",
"_resolution": {
"type": "version",
"tag": "v2.5.1",
"commit": "4c2c75e413e668b4117bf2b3741272b2ab9e24c5"
},
"_source": "https://github.com/monospaced/angular-elastic.git",
"_target": "~2.5.0",
"_originalSource": "angular-elastic"
}
\ No newline at end of file
The MIT License (MIT)
Copyright (c) 2014 Monospaced
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
\ No newline at end of file
Angular Elastic
===============
Elastic (autosize) textareas for AngularJS, without jQuery dependency.
[See it in action](http://monospaced.github.io/angular-elastic).
Usage
-----
as attribute
<textarea msd-elastic ng-model="foo">
...
</textarea>
as class
<textarea class="msd-elastic" ng-model="bar">
...
</textarea>
optionally append whitespace to the end of the height calculation (an extra newline improves the apperance when animating)
<textarea msd-elastic="\n" ng-model="foo">
...
</textarea>
<textarea class="msd-elastic: \n;" ng-model="bar">
...
</textarea>
or configure whitespace globally
app.config(['msdElasticConfig', function(msdElasticConfig) {
msdElasticConfig.append = '\n';
}])
the directive also emits an `elastic:resize` event which you can listen for
$scope.$on('elastic:resize', function(event, element, oldHeight, newHeight) {
// do stuff
});
Single line textareas
--------------
Set the `rows` attribute to `1`, as browsers default to `2`.
<textarea rows="1" msd-elastic ng-model="foo">
...
</textarea>
Install
-------
bower install angular-elastic
npm install angular-elastic
Include the `elastic.js` script provided by this component in your app.
Make sure to add `monospaced.elastic` to your app’s module dependencies.
```
angular
.module('yourApp', [
'monospaced.elastic'
]);
````
Support
-------
__Modern browsers__ only—Internet Explorer 6, 7 & 8 retain their default textarea behaviour.
Demo
----------------
* [monospaced.github.io/angular-elastic](http://monospaced.github.io/angular-elastic)
* [plunker](http://plnkr.co/edit/9y6YLriAwsK9hqdu72WT?p=preview)
How it works
------------
By creating a hidden textarea that mirrors the textarea to which the directive was applied, Angular Elastic can measure the required height and adjust the textarea accordingly. Adjustments are done on:
* Keystroke events
* Window resize events
* Model changes
This works well in most cases with no additional code required other than described in the Usage section above. However, it may occur that the adjustment must be invoked manually at a time that is not covered by the events listed above. E.g. textareas with the style `display: none;` may not have a valid width in Safari which produces incorrect adjustments. In this case the adjustment needs to be invoked once these textareas become visible. For that Angular Elastic listens to the `elastic:adjust` event on its scope. To invoke the adjustment for all textareas covered by Angular Elastic use:
$rootScope.$broadcast('elastic:adjust');
Inspiration
----------------
* [jQuery Autosize](http://www.jacklmoore.com/autosize/)
* [jQuery Elastic](http://unwrongest.com/projects/elastic/)
{
"name": "angular-elastic",
"version": "2.5.1",
"main": "elastic.js",
"ignore": [
"**/.*",
"node_modules",
"components"
],
"dependencies": {
"angular": ">=1.0.6"
}
}
\ No newline at end of file
/*
* angular-elastic v2.5.1
* (c) 2014 Monospaced http://monospaced.com
* License: MIT
*/
if (typeof module !== 'undefined' &&
typeof exports !== 'undefined' &&
module.exports === exports){
module.exports = 'monospaced.elastic';
}
angular.module('monospaced.elastic', [])
.constant('msdElasticConfig', {
append: ''
})
.directive('msdElastic', [
'$timeout', '$window', 'msdElasticConfig',
function($timeout, $window, config) {
'use strict';
return {
require: 'ngModel',
restrict: 'A, C',
link: function(scope, element, attrs, ngModel) {
// cache a reference to the DOM element
var ta = element[0],
$ta = element;
// ensure the element is a textarea, and browser is capable
if (ta.nodeName !== 'TEXTAREA' || !$window.getComputedStyle) {
return;
}
// set these properties before measuring dimensions
$ta.css({
'overflow': 'hidden',
'overflow-y': 'hidden',
'word-wrap': 'break-word'
});
// force text reflow
var text = ta.value;
ta.value = '';
ta.value = text;
var append = attrs.msdElastic ? attrs.msdElastic.replace(/\\n/g, '\n') : config.append,
$win = angular.element($window),
mirrorInitStyle = 'position: absolute; top: -999px; right: auto; bottom: auto;' +
'left: 0; overflow: hidden; -webkit-box-sizing: content-box;' +
'-moz-box-sizing: content-box; box-sizing: content-box;' +
'min-height: 0 !important; height: 0 !important; padding: 0;' +
'word-wrap: break-word; border: 0;',
$mirror = angular.element('<textarea aria-hidden="true" tabindex="-1" ' +
'style="' + mirrorInitStyle + '"/>').data('elastic', true),
mirror = $mirror[0],
taStyle = getComputedStyle(ta),
resize = taStyle.getPropertyValue('resize'),
borderBox = taStyle.getPropertyValue('box-sizing') === 'border-box' ||
taStyle.getPropertyValue('-moz-box-sizing') === 'border-box' ||
taStyle.getPropertyValue('-webkit-box-sizing') === 'border-box',
boxOuter = !borderBox ? {width: 0, height: 0} : {
width: parseInt(taStyle.getPropertyValue('border-right-width'), 10) +
parseInt(taStyle.getPropertyValue('padding-right'), 10) +
parseInt(taStyle.getPropertyValue('padding-left'), 10) +
parseInt(taStyle.getPropertyValue('border-left-width'), 10),
height: parseInt(taStyle.getPropertyValue('border-top-width'), 10) +
parseInt(taStyle.getPropertyValue('padding-top'), 10) +
parseInt(taStyle.getPropertyValue('padding-bottom'), 10) +
parseInt(taStyle.getPropertyValue('border-bottom-width'), 10)
},
minHeightValue = parseInt(taStyle.getPropertyValue('min-height'), 10),
heightValue = parseInt(taStyle.getPropertyValue('height'), 10),
minHeight = Math.max(minHeightValue, heightValue) - boxOuter.height,
maxHeight = parseInt(taStyle.getPropertyValue('max-height'), 10),
mirrored,
active,
copyStyle = ['font-family',
'font-size',
'font-weight',
'font-style',
'letter-spacing',
'line-height',
'text-transform',
'word-spacing',
'text-indent'];
// exit if elastic already applied (or is the mirror element)
if ($ta.data('elastic')) {
return;
}
// Opera returns max-height of -1 if not set
maxHeight = maxHeight && maxHeight > 0 ? maxHeight : 9e4;
// append mirror to the DOM
if (mirror.parentNode !== document.body) {
angular.element(document.body).append(mirror);
}
// set resize and apply elastic
$ta.css({
'resize': (resize === 'none' || resize === 'vertical') ? 'none' : 'horizontal'
}).data('elastic', true);
/*
* methods
*/
function initMirror() {
var mirrorStyle = mirrorInitStyle;
mirrored = ta;
// copy the essential styles from the textarea to the mirror
taStyle = getComputedStyle(ta);
angular.forEach(copyStyle, function(val) {
mirrorStyle += val + ':' + taStyle.getPropertyValue(val) + ';';
});
mirror.setAttribute('style', mirrorStyle);
}
function adjust() {
var taHeight,
taComputedStyleWidth,
mirrorHeight,
width,
overflow;
if (mirrored !== ta) {
initMirror();
}
// active flag prevents actions in function from calling adjust again
if (!active) {
active = true;
mirror.value = ta.value + append; // optional whitespace to improve animation
mirror.style.overflowY = ta.style.overflowY;
taHeight = ta.style.height === '' ? 'auto' : parseInt(ta.style.height, 10);
taComputedStyleWidth = getComputedStyle(ta).getPropertyValue('width');
// ensure getComputedStyle has returned a readable 'used value' pixel width
if (taComputedStyleWidth.substr(taComputedStyleWidth.length - 2, 2) === 'px') {
// update mirror width in case the textarea width has changed
width = parseInt(taComputedStyleWidth, 10) - boxOuter.width;
mirror.style.width = width + 'px';
}
mirrorHeight = mirror.scrollHeight;
if (mirrorHeight > maxHeight) {
mirrorHeight = maxHeight;
overflow = 'scroll';
} else if (mirrorHeight < minHeight) {
mirrorHeight = minHeight;
}
mirrorHeight += boxOuter.height;
ta.style.overflowY = overflow || 'hidden';
if (taHeight !== mirrorHeight) {
scope.$emit('elastic:resize', $ta, taHeight, mirrorHeight);
ta.style.height = mirrorHeight + 'px';
}
// small delay to prevent an infinite loop
$timeout(function() {
active = false;
}, 1, false);
}
}
function forceAdjust() {
active = false;
adjust();
}
/*
* initialise
*/
// listen
if ('onpropertychange' in ta && 'oninput' in ta) {
// IE9
ta['oninput'] = ta.onkeyup = adjust;
} else {
ta['oninput'] = adjust;
}
$win.bind('resize', forceAdjust);
scope.$watch(function() {
return ngModel.$modelValue;
}, function(newValue) {
forceAdjust();
});
scope.$on('elastic:adjust', function() {
initMirror();
forceAdjust();
});
$timeout(adjust, 0, false);
/*
* destroy
*/
scope.$on('$destroy', function() {
$mirror.remove();
$win.unbind('resize', forceAdjust);
});
}
};
}
]);
<!DOCTYPE html>
<html lang="en-gb" data-ng-app="elasticDemo" id="ng-app">
<head>
<meta charset="utf-8">
<title>Angular Elastic</title>
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="//necolas.github.io/normalize.css/2.1.1/normalize.css">
<style>
html {
background: #e7f3ff;
color: #1c000e;
text-shadow: 0 1px 0 #fff;
}
body {
margin: 8px auto;
max-width: 90%;
width: 480px;
}
h1 {
margin: 0 0 8px;
font-weight: normal;
font-size: 30px;
}
a {
color: #0074e7;
text-decoration: none;
-webkit-transition: all 250ms ease-in-out;
-moz-transition: all 250ms ease-in-out;
-o-transition: all 250ms ease-in-out;
transition: all 250ms ease-in-out;
}
a:hover,
a:focus,
a:active {
color: #0067ce;
-webkit-transition: none;
-moz-transition: none;
-o-transition: none;
transition: none;
}
textarea {
padding: 10px;
width: 300px;
max-width: 90%;
}
.animate:focus {
-webkit-transition: height 50ms ease-in-out;
-moz-transition: height 50ms ease-in-out;
-o-transition: height 50ms ease-in-out;
transition: height 50ms ease-in-out;
}
.msd-elastic {
max-height: 400px;
}
#first {
font-size: 30px;
}
</style>
</head>
<body data-ng-controller="elasticDemoController">
<h1>Angular Elastic</h1>
<form data-ng-submit="submit()">
<p>
<textarea class="msd-elastic" data-ng-model="foo" id="first" data-ng-show="show" data-ng-controller="elasticCallbackController"></textarea>
</p>
<small data-ng-show="show"><a href data-ng-click="show = false">Hide</a> | </small>
<small data-ng-show="!show"><a href data-ng-click="show = true">Show</a> | </small>
<small><a href data-ng-click="foo = 'Model changed'">Change model</a></small>
<p>
<textarea class="animate msd-elastic: \n;" data-ng-model="bar"></textarea>
</p>
<p>
<input type="submit" value="Submit and reset">
</p>
</form>
<small>
<a href="https://github.com/monospaced/angular-elastic">https://github.com/monospaced/angular-elastic</a> <br>
<a href="http://monospaced.github.io/">Monospaced Labs</a>
</small>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.6/angular.min.js"></script>
<script src="elastic.js"></script>
<script>
angular.module('elasticDemo', ['monospaced.elastic'])
.controller('elasticDemoController', ['$scope', '$log', function($scope, $log){
'use strict';
$scope.foo = 'This textarea is going to grow when you fill it with text. Just type a few more words in it and you will see. This textarea is going to grow when you fill it with text.';
$scope.bar = 'Elastic with a CSS transition. Try typing something...';
$scope.submit = function(){
$scope.bar = '';
};
$scope.show = true;
}])
.controller('elasticCallbackController', ['$scope', '$log', function($scope, $log){
'use strict';
$scope.$on('elastic:resize', function(){
$log.log('Height was adjusted!');
});
}]);
</script>
</body>
</html>
\ No newline at end of file
{
"name": "angular-elastic",
"version": "2.5.1",
"description": "Elastic (autosize) textareas for AngularJS, without jQuery dependency.",
"keywords": [
"angular",
"angularjs",
"textarea",
"elastic",
"autosize"
],
"homepage": "http://monospaced.github.io/angular-elastic/",
"main": "elastic",
"bugs": "http://github.com/monospaced/angular-elastic/issues",
"license" : "MIT",
"repository" : {
"type" : "git",
"url" : "http://github.com/monospaced/angular-elastic"
},
"author": {
"name" : "Scott Boyle",
"email" : "scott@monospaced.com",
"url" : "http://scottboyle.co.uk/about"
},
"files": [
"elastic.js",
"package.json"
],
"dependencies": {
"angular": ">=1.0.6"
}
}
\ No newline at end of file
{
"name": "angular-file-upload",
"main": "dist/angular-file-upload.min.js",
"homepage": "https://github.com/nervgh/angular-file-upload",
"ignore": [
"examples"
],
"dependencies": {
"angular": "^1.1.5"
},
"devDependencies": {
"es5-shim": ">=3.4.0"
},
"keywords": [
"angular",
"file",
"upload",
"module"
],
"version": "2.1.4",
"_release": "2.1.4",
"_resolution": {
"type": "version",
"tag": "v2.1.4",
"commit": "888127c60b2946196784a3af474931ae48a8afca"
},
"_source": "https://github.com/nervgh/angular-file-upload.git",
"_target": "~2.1.0",
"_originalSource": "angular-file-upload"
}
\ No newline at end of file
{
"camelcase" : true,
"indent": 4,
"strict": true,
"undef": true,
"unused": true,
"quotmark": "single",
"maxlen": 120,
"trailing": true,
"curly": true,
"devel": true,
"browser":true,
"jquery":true,
"predef": [
"angular",
"define",
"require",
"app"
]
}
\ No newline at end of file
# Angular File Upload
---
## About
**Angular File Upload** is a module for the [AngularJS](http://angularjs.org/) framework. Supports drag-n-drop upload, upload progress, validation filters and a file upload queue. It supports native HTML5 uploads, but degrades to a legacy iframe upload method for older browsers. Works with any server side platform which supports standard HTML form uploads.
When files are selected or dropped into the component, one or more filters are applied. Files which pass all filters are added to the queue. When file is added to the queue, for him is created instance of `{FileItem}` and uploader options are copied into this object. After, items in the queue (FileItems) are ready for uploading.
## Package managers
### Bower
```
bower install angular-file-upload
```
You could find this module in bower like [_angular file upload_](http://bower.io/search/?q=angular%20file%20upload).
### NPM
```
npm install angular-file-upload
```
You could find this module in npm like [_angular file upload_](https://www.npmjs.com/search?q=angular%20file%20upload).
## Demos
1. [Simple example](http://nervgh.github.io/pages/angular-file-upload/examples/simple)
2. [Uploads only images (with canvas preview)](http://nervgh.github.io/pages/angular-file-upload/examples/image-preview)
3. [Without bootstrap example](http://nervgh.github.io/pages/angular-file-upload/examples/without-bootstrap)
## More Info
1. [Introduction](https://github.com/nervgh/angular-file-upload/wiki/Introduction)
2. [Module API](https://github.com/nervgh/angular-file-upload/wiki/Module-API)
3. [FAQ](https://github.com/nervgh/angular-file-upload/wiki/FAQ)
4. [Migrate from 0.x.x to 1.x.x](https://github.com/nervgh/angular-file-upload/wiki/Migrate-from-0.x.x-to-1.x.x)
5. [RubyGem](https://github.com/marthyn/angularjs-file-upload-rails)
{
"name": "angular-file-upload",
"main": "dist/angular-file-upload.min.js",
"homepage": "https://github.com/nervgh/angular-file-upload",
"ignore": ["examples"],
"dependencies": {
"angular": "^1.1.5"
},
"devDependencies": {
"es5-shim": ">=3.4.0"
},
"keywords": [
"angular",
"file",
"upload",
"module"
]
}
var pkg = require('./package.json');
// https://github.com/gulpjs/gulp/blob/master/docs/README.md
var gulp = require('gulp');
// http://webpack.github.io/docs/
var webpack = require('webpack');
// https://github.com/shama/webpack-stream
var webpackStream = require('webpack-stream');
gulp.task(
pkg.name + '/build',
function() {
return gulp
.src('./src/index.js')
.pipe(webpackStream({
module: {
loaders: [
// https://github.com/babel/babel-loader
{test: /\.js$/, loader: 'babel'},
// https://github.com/webpack/json-loader
{test: /\.json$/, loader: 'json'},
// https://github.com/webpack/html-loader
{test: /\.html$/, loader: 'html'}
]
},
plugins: [
// http://webpack.github.io/docs/list-of-plugins.html#uglifyjsplugin
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
}),
// http://webpack.github.io/docs/list-of-plugins.html#bannerplugin
new webpack.BannerPlugin(
'/*\n' +
' ' + pkg.name + ' v' + pkg.version + '\n' +
' ' + pkg.homepage + '\n' +
'*/\n'
, {
entryOnly: true,
raw: true
})
],
devtool: 'source-map',
debug: true,
output: {
library: pkg.name,
libraryTarget: 'umd',
filename: pkg.name + '.min.js'
}
}))
.pipe(gulp.dest('./dist'));
}
);
gulp.task(
pkg.name + '/watch', function() {
return gulp
.watch(
[
'./src/**/*.js',
'./src/**/*.json',
'./src/**/*.html'
],
[
pkg.name + '/build'
]
);
}
);
The MIT License
Copyright (c) 2013 nerv. https://github.com/nervgh
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
{
"name": "angular-file-upload",
"version": "2.1.4",
"homepage": "https://github.com/nervgh/angular-file-upload",
"description": "Angular File Upload is a module for the AngularJS framework",
"author": {
"name": "nerv",
"url": "https://github.com/nervgh"
},
"main": "dist/angular-file-upload.min.js",
"devDependencies": {
"babel": "^4.7.16",
"babel-loader": "^4.0.0",
"json-loader": "^0.5.1",
"html-loader": "^0.2.3",
"gulp": "^3.9.0",
"webpack": "^1.10.1",
"webpack-stream": "^2.0.0"
}
}
{
"name": "angularFileUpload"
}
\ No newline at end of file
'use strict';
import CONFIG from './../config.json';
export default ($parse, FileUploader, FileDrop) => {
return {
link: (scope, element, attributes) => {
var uploader = scope.$eval(attributes.uploader);
if (!(uploader instanceof FileUploader)) {
throw new TypeError('"Uploader" must be an instance of FileUploader');
}
if (!uploader.isHTML5) return;
var object = new FileDrop({
uploader: uploader,
element: element
});
object.getOptions = $parse(attributes.options).bind(object, scope);
object.getFilters = () => attributes.filters;
}
};
}
module.exports.$inject = [
'$parse',
'FileUploader',
'FileDrop'
];
\ No newline at end of file
'use strict';
import CONFIG from './../config.json';
export default (FileUploader, FileOver) => {
return {
link: (scope, element, attributes) => {
var uploader = scope.$eval(attributes.uploader);
if (!(uploader instanceof FileUploader)) {
throw new TypeError('"Uploader" must be an instance of FileUploader');
}
var object = new FileOver({
uploader: uploader,
element: element
});
object.getOverClass = () => attributes.overClass || object.overClass;
}
};
}
module.exports.$inject = [
'FileUploader',
'FileOver'
];
\ No newline at end of file
'use strict';
import CONFIG from './../config.json';
export default ($parse, FileUploader, FileSelect) => {
return {
link: (scope, element, attributes) => {
var uploader = scope.$eval(attributes.uploader);
if (!(uploader instanceof FileUploader)) {
throw new TypeError('"Uploader" must be an instance of FileUploader');
}
var object = new FileSelect({
uploader: uploader,
element: element
});
object.getOptions = $parse(attributes.options).bind(object, scope);
object.getFilters = () => attributes.filters;
}
};
}
module.exports.$inject = [
'$parse',
'FileUploader',
'FileSelect'
];
\ No newline at end of file
'use strict';
import CONFIG from './config.json';
import options from './values/options'
import serviceFileUploader from './services/FileUploader';
import serviceFileLikeObject from './services/FileLikeObject';
import serviceFileItem from './services/FileItem';
import serviceFileDirective from './services/FileDirective';
import serviceFileSelect from './services/FileSelect';
import serviceFileDrop from './services/FileDrop';
import serviceFileOver from './services/FileOver';
import directiveFileSelect from './directives/FileSelect';
import directiveFileDrop from './directives/FileDrop';
import directiveFileOver from './directives/FileOver';
angular
.module(CONFIG.name, [])
.value('fileUploaderOptions', options)
.factory('FileUploader', serviceFileUploader)
.factory('FileLikeObject', serviceFileLikeObject)
.factory('FileItem', serviceFileItem)
.factory('FileDirective', serviceFileDirective)
.factory('FileSelect', serviceFileSelect)
.factory('FileDrop', serviceFileDrop)
.factory('FileOver', serviceFileOver)
.directive('nvFileSelect', directiveFileSelect)
.directive('nvFileDrop', directiveFileDrop)
.directive('nvFileOver', directiveFileOver)
.run([
'FileUploader',
'FileLikeObject',
'FileItem',
'FileDirective',
'FileSelect',
'FileDrop',
'FileOver',
function(FileUploader, FileLikeObject, FileItem, FileDirective, FileSelect, FileDrop, FileOver) {
// only for compatibility
FileUploader.FileLikeObject = FileLikeObject;
FileUploader.FileItem = FileItem;
FileUploader.FileDirective = FileDirective;
FileUploader.FileSelect = FileSelect;
FileUploader.FileDrop = FileDrop;
FileUploader.FileOver = FileOver;
}
]);
'use strict';
import CONFIG from './../config.json';
let {
extend
} = angular;
export default () => {
class FileDirective {
/**
* Creates instance of {FileDirective} object
* @param {Object} options
* @param {Object} options.uploader
* @param {HTMLElement} options.element
* @param {Object} options.events
* @param {String} options.prop
* @constructor
*/
constructor(options) {
extend(this, options);
this.uploader._directives[this.prop].push(this);
this._saveLinks();
this.bind();
}
/**
* Binds events handles
*/
bind() {
for(var key in this.events) {
var prop = this.events[key];
this.element.bind(key, this[prop]);
}
}
/**
* Unbinds events handles
*/
unbind() {
for(var key in this.events) {
this.element.unbind(key, this.events[key]);
}
}
/**
* Destroys directive
*/
destroy() {
var index = this.uploader._directives[this.prop].indexOf(this);
this.uploader._directives[this.prop].splice(index, 1);
this.unbind();
// this.element = null;
}
/**
* Saves links to functions
* @private
*/
_saveLinks() {
for(var key in this.events) {
var prop = this.events[key];
this[prop] = this[prop].bind(this);
}
}
}
/**
* Map of events
* @type {Object}
*/
FileDirective.prototype.events = {};
return FileDirective;
}
module.exports.$inject = [
];
\ No newline at end of file
'use strict';
import CONFIG from './../config.json';
let {
extend,
forEach
} = angular;
export default (FileDirective) => {
class FileDrop extends FileDirective {
/**
* Creates instance of {FileDrop} object
* @param {Object} options
* @constructor
*/
constructor(options) {
let extendedOptions = extend(options, {
// Map of events
events: {
$destroy: 'destroy',
drop: 'onDrop',
dragover: 'onDragOver',
dragleave: 'onDragLeave'
},
// Name of property inside uploader._directive object
prop: 'drop'
});
super(extendedOptions);
}
/**
* Returns options
* @return {Object|undefined}
*/
getOptions() {
}
/**
* Returns filters
* @return {Array<Function>|String|undefined}
*/
getFilters() {
}
/**
* Event handler
*/
onDrop(event) {
var transfer = this._getTransfer(event);
if(!transfer) return;
var options = this.getOptions();
var filters = this.getFilters();
this._preventAndStop(event);
forEach(this.uploader._directives.over, this._removeOverClass, this);
this.uploader.addToQueue(transfer.files, options, filters);
}
/**
* Event handler
*/
onDragOver(event) {
var transfer = this._getTransfer(event);
if(!this._haveFiles(transfer.types)) return;
transfer.dropEffect = 'copy';
this._preventAndStop(event);
forEach(this.uploader._directives.over, this._addOverClass, this);
}
/**
* Event handler
*/
onDragLeave(event) {
if(event.currentTarget === this.element[0]) return;
this._preventAndStop(event);
forEach(this.uploader._directives.over, this._removeOverClass, this);
}
/**
* Helper
*/
_getTransfer(event) {
return event.dataTransfer ? event.dataTransfer : event.originalEvent.dataTransfer; // jQuery fix;
}
/**
* Helper
*/
_preventAndStop(event) {
event.preventDefault();
event.stopPropagation();
}
/**
* Returns "true" if types contains files
* @param {Object} types
*/
_haveFiles(types) {
if(!types) return false;
if(types.indexOf) {
return types.indexOf('Files') !== -1;
} else if(types.contains) {
return types.contains('Files');
} else {
return false;
}
}
/**
* Callback
*/
_addOverClass(item) {
item.addOverClass();
}
/**
* Callback
*/
_removeOverClass(item) {
item.removeOverClass();
}
}
return FileDrop;
}
module.exports.$inject = [
'FileDirective'
];
\ No newline at end of file
'use strict';
import CONFIG from './../config.json';
let {
copy,
extend,
element,
isElement
} = angular;
export default ($compile, FileLikeObject) => {
class FileItem {
/**
* Creates an instance of FileItem
* @param {FileUploader} uploader
* @param {File|HTMLInputElement|Object} some
* @param {Object} options
* @constructor
*/
constructor(uploader, some, options) {
var isInput = isElement(some);
var input = isInput ? element(some) : null;
var file = !isInput ? some : null;
extend(this, {
url: uploader.url,
alias: uploader.alias,
headers: copy(uploader.headers),
formData: copy(uploader.formData),
removeAfterUpload: uploader.removeAfterUpload,
withCredentials: uploader.withCredentials,
method: uploader.method
}, options, {
uploader: uploader,
file: new FileLikeObject(some),
isReady: false,
isUploading: false,
isUploaded: false,
isSuccess: false,
isCancel: false,
isError: false,
progress: 0,
index: null,
_file: file,
_input: input
});
if (input) this._replaceNode(input);
}
/**********************
* PUBLIC
**********************/
/**
* Uploads a FileItem
*/
upload() {
try {
this.uploader.uploadItem(this);
} catch(e) {
this.uploader._onCompleteItem(this, '', 0, []);
this.uploader._onErrorItem(this, '', 0, []);
}
}
/**
* Cancels uploading of FileItem
*/
cancel() {
this.uploader.cancelItem(this);
}
/**
* Removes a FileItem
*/
remove() {
this.uploader.removeFromQueue(this);
}
/**
* Callback
* @private
*/
onBeforeUpload() {
}
/**
* Callback
* @param {Number} progress
* @private
*/
onProgress(progress) {
}
/**
* Callback
* @param {*} response
* @param {Number} status
* @param {Object} headers
*/
onSuccess(response, status, headers) {
}
/**
* Callback
* @param {*} response
* @param {Number} status
* @param {Object} headers
*/
onError(response, status, headers) {
}
/**
* Callback
* @param {*} response
* @param {Number} status
* @param {Object} headers
*/
onCancel(response, status, headers) {
}
/**
* Callback
* @param {*} response
* @param {Number} status
* @param {Object} headers
*/
onComplete(response, status, headers) {
}
/**********************
* PRIVATE
**********************/
/**
* Inner callback
*/
_onBeforeUpload() {
this.isReady = true;
this.isUploading = true;
this.isUploaded = false;
this.isSuccess = false;
this.isCancel = false;
this.isError = false;
this.progress = 0;
this.onBeforeUpload();
}
/**
* Inner callback
* @param {Number} progress
* @private
*/
_onProgress(progress) {
this.progress = progress;
this.onProgress(progress);
}
/**
* Inner callback
* @param {*} response
* @param {Number} status
* @param {Object} headers
* @private
*/
_onSuccess(response, status, headers) {
this.isReady = false;
this.isUploading = false;
this.isUploaded = true;
this.isSuccess = true;
this.isCancel = false;
this.isError = false;
this.progress = 100;
this.index = null;
this.onSuccess(response, status, headers);
}
/**
* Inner callback
* @param {*} response
* @param {Number} status
* @param {Object} headers
* @private
*/
_onError(response, status, headers) {
this.isReady = false;
this.isUploading = false;
this.isUploaded = true;
this.isSuccess = false;
this.isCancel = false;
this.isError = true;
this.progress = 0;
this.index = null;
this.onError(response, status, headers);
}
/**
* Inner callback
* @param {*} response
* @param {Number} status
* @param {Object} headers
* @private
*/
_onCancel(response, status, headers) {
this.isReady = false;
this.isUploading = false;
this.isUploaded = false;
this.isSuccess = false;
this.isCancel = true;
this.isError = false;
this.progress = 0;
this.index = null;
this.onCancel(response, status, headers);
}
/**
* Inner callback
* @param {*} response
* @param {Number} status
* @param {Object} headers
* @private
*/
_onComplete(response, status, headers) {
this.onComplete(response, status, headers);
if(this.removeAfterUpload) this.remove();
}
/**
* Destroys a FileItem
*/
_destroy() {
if(this._input) this._input.remove();
if(this._form) this._form.remove();
delete this._form;
delete this._input;
}
/**
* Prepares to uploading
* @private
*/
_prepareToUploading() {
this.index = this.index || ++this.uploader._nextIndex;
this.isReady = true;
}
/**
* Replaces input element on his clone
* @param {JQLite|jQuery} input
* @private
*/
_replaceNode(input) {
var clone = $compile(input.clone())(input.scope());
clone.prop('value', null); // FF fix
input.css('display', 'none');
input.after(clone); // remove jquery dependency
}
}
return FileItem;
}
module.exports.$inject = [
'$compile',
'FileLikeObject'
];
\ No newline at end of file
'use strict';
import CONFIG from './../config.json';
let {
copy,
isElement,
isString
} = angular;
export default () => {
class FileLikeObject {
/**
* Creates an instance of FileLikeObject
* @param {File|HTMLInputElement|Object} fileOrInput
* @constructor
*/
constructor(fileOrInput) {
var isInput = isElement(fileOrInput);
var fakePathOrObject = isInput ? fileOrInput.value : fileOrInput;
var postfix = isString(fakePathOrObject) ? 'FakePath' : 'Object';
var method = '_createFrom' + postfix;
this[method](fakePathOrObject);
}
/**
* Creates file like object from fake path string
* @param {String} path
* @private
*/
_createFromFakePath(path) {
this.lastModifiedDate = null;
this.size = null;
this.type = 'like/' + path.slice(path.lastIndexOf('.') + 1).toLowerCase();
this.name = path.slice(path.lastIndexOf('/') + path.lastIndexOf('\\') + 2);
}
/**
* Creates file like object from object
* @param {File|FileLikeObject} object
* @private
*/
_createFromObject(object) {
this.lastModifiedDate = copy(object.lastModifiedDate);
this.size = object.size;
this.type = object.type;
this.name = object.name;
}
}
return FileLikeObject;
}
module.exports.$inject = [
];
\ No newline at end of file
'use strict';
import CONFIG from './../config.json';
let {
extend
} = angular;
export default (FileDirective) => {
class FileOver extends FileDirective {
/**
* Creates instance of {FileDrop} object
* @param {Object} options
* @constructor
*/
constructor(options) {
let extendedOptions = extend(options, {
// Map of events
events: {
$destroy: 'destroy'
},
// Name of property inside uploader._directive object
prop: 'over',
// Over class
overClass: 'nv-file-over'
});
super(extendedOptions);
}
/**
* Adds over class
*/
addOverClass() {
this.element.addClass(this.getOverClass());
}
/**
* Removes over class
*/
removeOverClass() {
this.element.removeClass(this.getOverClass());
}
/**
* Returns over class
* @returns {String}
*/
getOverClass() {
return this.overClass;
}
}
return FileOver;
}
module.exports.$inject = [
'FileDirective'
];
\ No newline at end of file
'use strict';
import CONFIG from './../config.json';
let {
extend
} = angular;
export default (FileDirective) => {
class FileSelect extends FileDirective {
/**
* Creates instance of {FileSelect} object
* @param {Object} options
* @constructor
*/
constructor(options) {
let extendedOptions = extend(options, {
// Map of events
events: {
$destroy: 'destroy',
change: 'onChange'
},
// Name of property inside uploader._directive object
prop: 'select'
});
super(extendedOptions);
if(!this.uploader.isHTML5) {
this.element.removeAttr('multiple');
}
this.element.prop('value', null); // FF fix
}
/**
* Returns options
* @return {Object|undefined}
*/
getOptions() {
}
/**
* Returns filters
* @return {Array<Function>|String|undefined}
*/
getFilters() {
}
/**
* If returns "true" then HTMLInputElement will be cleared
* @returns {Boolean}
*/
isEmptyAfterSelection() {
return !!this.element.attr('multiple');
}
/**
* Event handler
*/
onChange() {
var files = this.uploader.isHTML5 ? this.element[0].files : this.element[0];
var options = this.getOptions();
var filters = this.getFilters();
if(!this.uploader.isHTML5) this.destroy();
this.uploader.addToQueue(files, options, filters);
if(this.isEmptyAfterSelection()) {
this.element.prop('value', null);
this.element.replaceWith(this.element = this.element.clone(true)); // IE fix
}
}
}
return FileSelect;
}
module.exports.$inject = [
'FileDirective'
];
'use strict';
export default {
url: '/',
alias: 'file',
headers: {},
queue: [],
progress: 0,
autoUpload: false,
removeAfterUpload: false,
method: 'POST',
filters: [],
formData: [],
queueLimit: Number.MAX_VALUE,
withCredentials: false
};
\ No newline at end of file
{
"name": "angular-promise-buttons",
"description": "Fabulous helper to help you with your daily form coding.",
"version": "0.1.19",
"authors": [
"Johannes Millan <johannes.millan@gmail.com>"
],
"repository": {
"type": "git",
"url": "https://github.com/johannesjo/angular-promise-buttons.git"
},
"homepage": "http://johannesjo.github.io/angular-promise-buttons/",
"license": "LGPL-2.1",
"main": "dist/angular-promise-buttons.js",
"keywords": [
"angular",
"AngularJS",
"form",
"forms",
"form helper",
"buttons",
"button",
"loading-button"
],
"ignore": [
"gh-pages",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {
"angular": ">=1.3.0 <2.0.0"
},
"devDependencies": {
"angular-animate": ">=1.3.0 <2.0.0",
"angular-mocks": ">=1.3.0 <2.0.0"
},
"_release": "0.1.19",
"_resolution": {
"type": "version",
"tag": "v0.1.19",
"commit": "9660e6c5d32eb14a45b467768e71c4c5273d4fe7"
},
"_source": "https://github.com/johannesjo/angular-promise-buttons.git",
"_target": "~0.1.6",
"_originalSource": "angular-promise-buttons"
}
\ No newline at end of file
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org
root = true
[*]
# Change these settings to your own preference
indent_style = space
indent_size = 4
# We recommend you to keep these unchanged
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false
node_modules
.tmp
.sass-cache
.grunt
bower_components
dist/example
.idea/
*.DS_*
npm-debug.log
coverage
{
"newcap": false,
"eqeqeq": false,
"node": true,
"browser": true,
"esnext": true,
"bitwise": true,
"camelcase": true,
"boss": true,
"curly": true,
"immed": true,
"indent": 4,
"latedef": true,
"noarg": true,
"quotmark": "single",
"regexp": true,
"undef": true,
"unused": false,
"strict": true,
"trailing": true,
"smarttabs": true,
"globals": {
"_": false,
"angular": false,
"$": false,
"moment": false,
"jasmine": false,
"spyOn": false,
"describe": false,
"it": false,
"before": false,
"beforeEach": false,
"after": false,
"afterEach": false,
"expect": false,
"inject": false
}
}
language: node_js
before_install:
- "set -e"
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- sleep 3
node_js:
- 'v5.11.1'
before_script:
- 'npm install -g bower grunt-cli karma'
- 'bower install'
script: grunt test:all
The MIT License (MIT)
Copyright (c) 2016 Johannes Millan
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWAR
[![Stories in Ready](https://badge.waffle.io/johannesjo/angular-promise-buttons.svg?label=ready&title=Ready)](http://waffle.io/johannesjo/angular-promise-buttons)
[![Stories in progress](https://badge.waffle.io/johannesjo/angular-promise-buttons.svg?label=in%20progress&title=In%20Progress)](http://waffle.io/johannesjo/angular-promise-buttons)
[![Build Status](https://travis-ci.org/johannesjo/angular-promise-buttons.svg)](https://travis-ci.org/johannesjo/angular-promise-buttons?branch=master)
[![Coverage Status](https://coveralls.io/repos/johannesjo/angular-promise-buttons/badge.svg?branch=master)](https://coveralls.io/r/johannesjo/angular-promise-buttons?branch=master)
angular-promise-buttons
===========
*Chilled Buttons for AngularJS*
There are cool loading buttons out there for angular. Only thing which annoys me, is that you (most of the times) have to manually trigger their loading state via a boolean which leads to a bit of repetition, declaring those again and again. ```angular-promise-buttons``` exists to take away some of that, by handling the loading state directly by passing the promise. Saves you at least two lines of code every time. Check out the [DEMO](http://johannesjo.github.io/angular-promise-buttons/#demo)!
Also you can play with the code on [Plnkr](http://plnkr.co/edit/yKrlohXVL15fRjTjZHBJ?p=preview).
[Bug-reports or feature request](https://github.com/johannesjo/angular-promise-buttons/issues) as well as any other kind of **feedback is highly welcome!**
## getting started
Install it via bower
```
bower install angular-promise-buttons -S
```
and add `angularPromiseButtons` as dependency in your main module:
```
angular.module('yourApp',[
'angularPromiseButtons'
]);
```
Using the buttons is easy. Just return the promise in question in your service caller and you're good to go:
You can also directly return the promise via the function passed to `ng-click`:
```html
<button ng-click="yourServiceCaller()"
promise-btn>Click me to spin!</button>
```
```javascript
// inside some controller
$scope.yourServiceCaller = function ()
{
return fakeFactory.method().then(...);
};
```
### using it for forms
For using the promise buttons with `ng-submit` you need to apply them to the form directive and add `type="submit" to the buttons you want to show a loader for:
```html
<form ng-submit="yourServiceCaller()"
promise-btn>
<button type="submit">MyBtn</button>
</form>
```
```javascript
// inside some controller
$scope.yourServiceCaller = function ()
{
return fakeFactory.method().then(...);
};
```
### alternative syntax
There is also an alternative syntax, which allows you to share promises between buttons (and possibly other directives):
```html
<button ng-click="yourServiceCaller()"
promise-btn="yourPromise">MyBtn</button>
```
Now you just have to assign a promise to ```yourPromise```:
```javascript
// inside some controller
$scope.yourServiceCaller = function ()
{
$scope.yourPromise = fakeFactory.method().then(...);
};
```
## styling the button
The base-styles might not be overwhelmingly sexy, but it is easy to fix that! There are lots of free css-spinners out there. Just find one of your liking and add the css.
**Ressources:**
* http://cssload.net/
* http://projects.lukehaas.me/css-loaders/
* http://tobiasahlin.com/spinkit/
## configuration
There are also some defaults for you to set, if you like. You can do this by using the ```angularPromiseButtonsProvider```:
```javascript
angular.module('exampleApp', [
'angularPromiseButtons'
])
.config(function (angularPromiseButtonsProvider)
{
angularPromiseButtonsProvider.extendConfig({
spinnerTpl: '<span class="btn-spinner"></span>',
disableBtn: true,
btnLoadingClass: 'is-loading',
addClassToCurrentBtnOnly: false,
disableCurrentBtnOnly: false,
minDuration: false,
CLICK_EVENT: 'click',
CLICK_ATTR: 'ngClick',
SUBMIT_EVENT: 'submit',
SUBMIT_ATTR: 'ngSubmit',
BTN_SELECTOR: 'button'
});
});
```
## change options via `promise-btn-options`
You can also change all the options (**but not the spinner template**) by specifying the options via `promise-btn-options`:
```html
<button class="btn"
ng-click="yourServiceCaller()"
promise-btn-options="options"
promise-btn="yourPromise">MyBtn <span>Look I'm nested content</span>
</button>
```
Now you just have to assign a promise to ```yourPromise```:
```javascript
// inside some controller
$scope.options = {
disableBtn: false,
btnLoadingClass: 'is-spinning'
};
$scope.yourServiceCaller = function ()
{
$scope.yourPromise = fakeFactory.method().then(...);
};
```
Thats all the logic there is (for now). Adjusting the look and feel of the spinner can be done using your own styles.
## ❤ contribute ❤
I'm happy for any [issue or feature request](https://github.com/johannesjo/angular-promise-buttons/issues), you might encounter or want to have. Even a one liner is better, than no feedback at all. Pull requests are also highly welcome. Just fork the repository, clone it and run `grunt serve` for development. Another important factor is the number of developers using and thus testing `angular-promise-buttons`. Tell your fellow programmers, [say that you use it on ng-modules](http://ngmodules.org/modules/angular-promise-buttons), tweet or even blog about it.
`angular-promise-buttons` is published under the [The GNU Lesser General Public License V2.1](https://github.com/johannesjo/angular-promise-buttons/blob/master/LICENSE).
## (possible) promising future features
* [your feature request](https://github.com/johannesjo/angular-promise-buttons/issues)!
{
"name": "angular-promise-buttons",
"description": "Fabulous helper to help you with your daily form coding.",
"version": "0.1.19",
"authors": [
"Johannes Millan <johannes.millan@gmail.com>"
],
"repository": {
"type": "git",
"url": "https://github.com/johannesjo/angular-promise-buttons.git"
},
"homepage": "http://johannesjo.github.io/angular-promise-buttons/",
"license": "LGPL-2.1",
"main": "dist/angular-promise-buttons.js",
"keywords": [
"angular",
"AngularJS",
"form",
"forms",
"form helper",
"buttons",
"button",
"loading-button"
],
"ignore": [
"gh-pages",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {
"angular": ">=1.3.0 <2.0.0"
},
"devDependencies": {
"angular-animate": ">=1.3.0 <2.0.0",
"angular-mocks": ">=1.3.0 <2.0.0"
}
}
angular.module("angularPromiseButtons",[]),angular.module("angularPromiseButtons").directive("promiseBtn",["angularPromiseButtons","$parse","$timeout","$compile",function(a,b,c,d){"use strict";return{restrict:"EA",priority:a.config.priority,scope:{promiseBtn:"=",promiseBtnOptions:"=?"},link:function(e,f,g){function h(a){t.btnLoadingClass&&!t.addClassToCurrentBtnOnly&&a.addClass(t.btnLoadingClass),t.disableBtn&&!t.disableCurrentBtnOnly&&a.attr("disabled","disabled")}function i(a){t.minDuration&&!r||!s||(t.btnLoadingClass&&a.removeClass(t.btnLoadingClass),t.disableBtn&&a.removeAttr("disabled"))}function j(a,b){e.$watch(a,function(a){r=!1,s=!1,t.minDuration&&(q=c(function(){r=!0,i(b)},t.minDuration)),a&&a.then?(h(b),a.finally(function(){s=!0,i(b)})):a&&a.$promise&&(h(b),a.$promise.finally(function(){s=!0,i(b)}))})}function k(a){return a.split(";").map(function(a){return b(a)})}function l(a){a.append(d(t.spinnerTpl)(e))}function m(a){t.addClassToCurrentBtnOnly&&a.on(t.CLICK_EVENT,function(){a.addClass(t.btnLoadingClass)}),t.disableCurrentBtnOnly&&a.on(t.CLICK_EVENT,function(){a.attr("disabled","disabled")})}function n(a,b,c){e.$evalAsync(function(){var d=k(g[b]);f.unbind(a),f.bind(a,function(){e.$apply(function(){d.forEach(function(b){var d=b(e.$parent,{$event:a});p||(p=j(function(){return d},c))})})})})}function o(b){for(var c=[],d=b.find(a.config.BTN_SELECTOR),e=0;e<d.length;e++){var f=d[e];"submit"===angular.element(f).attr("type")&&c.push(f)}return angular.element(c)}var p,q,r,s,t=a.config;if(g.promiseBtn)l(f),m(f),j(function(){return e.promiseBtn},f);else if(g.hasOwnProperty(t.CLICK_ATTR))l(f),m(f),n(t.CLICK_EVENT,t.CLICK_ATTR,f);else if(g.hasOwnProperty(t.SUBMIT_ATTR)){var u=o(f);l(u),m(u),n(t.SUBMIT_EVENT,t.SUBMIT_ATTR,u)}e.$watch("promiseBtnOptions",function(a){angular.isObject(a)&&(t=angular.extend({},t,a))},!0),e.$on("$destroy",function(){c.cancel(q)})}}}]),angular.module("angularPromiseButtons").provider("angularPromiseButtons",function(){"use strict";var a={spinnerTpl:'<span class="btn-spinner"></span>',priority:0,disableBtn:!0,btnLoadingClass:"is-loading",addClassToCurrentBtnOnly:!1,disableCurrentBtnOnly:!1,minDuration:!1,CLICK_EVENT:"click",CLICK_ATTR:"ngClick",SUBMIT_EVENT:"submit",SUBMIT_ATTR:"ngSubmit",BTN_SELECTOR:"button"};return{extendConfig:function(b){a=angular.extend(a,b)},$get:function(){return{config:a}}}});
\ No newline at end of file
<!doctype html>
<!--[if lt IE 9]>
<html class="old-browser no-js"><![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js"><!--<![endif]-->
<head>
<meta charset="utf-8">
<title>angular-promise-buttons example</title>
<meta name="viewport"
content="width=device-width">
<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
<!-- bower:css -->
<!-- endbower -->
<link rel="stylesheet"
href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
<link rel="stylesheet"
href="//cdnjs.cloudflare.com/ajax/libs/octicons/2.1.2/octicons.css">
<link rel="stylesheet"
href="style.css">
</head>
<body>
<div class="container"
ng-app="exampleApp"
ng-controller="exampleCtrl">
<a name="demo"></a>
<h1>Demos</h1>
<div ng-include="'example1.html'"
class="example"></div>
</div>
<!-- /add ga tracking -->
<!-- bower:js -->
<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/angular-animate/angular-animate.js"></script>
<script src="bower_components/angular-mocks/angular-mocks.js"></script>
<!-- endbower -->
<!-- build:js({.tmp,src}) angular-promise-buttons.min.js -->
<!-- fileblock:js module -->
<script src="_angular-promise-buttons.js"></script>
<script src="promise-btn-d.js"></script>
<script src="angular-promise-buttons-p.js"></script>
<script src="tpls.js"></script>
<!-- endfileblock -->
<!-- endbuild -->
<!-- fileblock:js example -->
<script src="scripts/example.js"></script>
<!-- endfileblock -->
</body>
</html>
{
"name": "angular-resource",
"version": "1.6.1",
"license": "MIT",
"main": "./angular-resource.js",
"ignore": [],
"dependencies": {
"angular": "1.6.1"
},
"homepage": "https://github.com/angular/bower-angular-resource",
"_release": "1.6.1",
"_resolution": {
"type": "version",
"tag": "v1.6.1",
"commit": "d203a7dae4943f2ef39693b5e4b456be6369ec53"
},
"_source": "https://github.com/angular/bower-angular-resource.git",
"_target": ">=1.2.*",
"_originalSource": "angular-resource"
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment