Skip to content

Instantly share code, notes, and snippets.

@signalpoint
Last active January 6, 2017 06:10
Show Gist options
  • Save signalpoint/10896ce4917c3668625e to your computer and use it in GitHub Desktop.
Save signalpoint/10896ce4917c3668625e to your computer and use it in GitHub Desktop.
jdrupal.easystreet3.com
.idea
7
8
node_modules
#!/bin/bash
echo "Clearing remote web server..."
ssh [email protected] 'bash -s' < remote-clear
echo "zipping up local files..."
zip jdrupal-web.zip `find index.html 7/ 8/ -not -iwholename '*.git*' -print`
echo "deploying..."
scp jdrupal-web.zip [email protected]:~/www/jdrupal/
rm jdrupal-web.zip
echo "unzipping remote files..."
ssh [email protected] 'bash -s' < remote-unzip
echo "adjusting permissions..."
ssh [email protected] 'bash -s' < remote-permissions
echo "done."
#!/bin/bash
# Generates api docs for jDrupal 7 and 8.
if [ -d "out" ]
then
rm -rf out
fi
if [ -d "7/api" ]
then
rm -rf 7/api
fi
if [ -d "8/api" ]
then
rm -rf 8/api
fi
echo "Generating jDrupal 7 api... "
./node_modules/.bin/jsdoc -c 7/jDrupal/jsdoc/conf.json -r
mv out/ 7/
cd 7
echo "<?php header('Location: http://jdrupal.tylerfrankenstein.com/7/docs'); ?>" > index.php
mv out api
cd ..
echo "generating jDrupal 8 api... "
./node_modules/.bin/jsdoc -c 8/jDrupal/jsdoc/conf.json -r
mv out/ 8/
cd 8
echo "<?php header('Location: http://jdrupal.tylerfrankenstein.com/8/docs'); ?>" > index.php
mv out api
echo "all done."
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Application Development Tools for Drupal | jDrupal</title>
<meta name="description" content="Drupal 8 JavaScript library and API for app development." />
<!-- Bootstrap -->
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
</head>
<body>
<nav class="navbar navbar-inverse">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="#">jDrupal</a>
</div>
<ul class="nav navbar-nav navbar-right">
<li><a href="http://drupalgap.org">Best Friends with DrupalGap</a></li>
</ul>
</div>
</nav>
<div class="container" style="margin-top: 1em;">
<div class="panel panel-default">
<div class="panel-body">
<h2>Application Development Tools for Drupal</h2>
<p class="lead">A simple Vanilla JS Library and API</p>
<p>
<a class="btn btn-primary" href="https://drupal.org/project/jdrupal" role="button">Drupal Module »</a>
<a class="btn btn-default" href="https://github.com/signalpoint/jDrupal" role="button">GitHub Project »</a>
</p>
</div>
</div>
</div>
<div class="container">
<div class="jumbotron">
<div class="container">
<div class="row">
<div class="col-lg-4">
<h2>Types of Apps</h2>
<ul class="list-group">
<li class="list-group-item">Mobile Applications (Android, iOS, etc)</li>
<li class="list-group-item">Web Applications</li>
<li class="list-group-item">Headless Drupal / Decoupled Drupal</li>
<li class="list-group-item"><a href="http://phonegap.com">PhoneGap</a> (<a href="https://cordova.apache.org/">Cordova</a>)</li>
</ul>
</div>
<div class="col-lg-4">
<h2>Drupal 8 REST</h2>
<ul class="list-group">
<li class="list-group-item">Connect</li>
<li class="list-group-item">User Login / Logout & Account Load</li>
<li class="list-group-item">Create, Retrieve, Update & Delete Nodes</li>
<li class="list-group-item">Views Integration</li>
</ul>
<p>
<a class="btn btn-success" href="https://raw.githubusercontent.com/signalpoint/jDrupal/8.x-1.x/jdrupal.min.js" role="button" title="Download jDrupal 8 Minified">jdrupal-8.min.js &raquo;</a>
</p>
</div>
<div class="col-lg-4">
<h2>Drupal 7 Services</h2>
<ul class="list-group">
<li class="list-group-item">User Login, Logout and Registration</li>
<li class="list-group-item">Create, Retrieve, Update & Delete Entities</li>
<li class="list-group-item">Supports Core Entity Types</li>
<li class="list-group-item">Views Integration</li>
</ul>
<p>
<a class="btn btn-warning" href="https://raw.githubusercontent.com/signalpoint/jDrupal/7.x-1.x/jdrupal.min.js" role="button" title="Download jDrupal 7 Minified">jdrupal-7.min.js &raquo;</a>
<a class="btn btn-danger" href="https://raw.githubusercontent.com/signalpoint/jDrupal/7.x-1.x/jdrupal.js" role="button" title="Download jDrupal 7">jdrupal-7.js &raquo;</a>
</p>
</div>
</div>
</div>
</div>
<div class="container">
<div class="row">
<blockquote style="border-left-color: #286090;">jDrupal...</blockquote>
<ul class="list-group">
<li class="list-group-item"> solves many common development needs for Drupal based applications.</li>
<li class="list-group-item"> provides a familiar Drupal coding experience and syntax for developers.</li>
<li class="list-group-item"> runs alongside any frontend client side framework, or with no framework at all.</li>
<li class="list-group-item"> utilizes JavaScript prototypes and promises.</li>
</ul>
<h3>Quick Examples for Drupal 8</h3>
<p>
<a class="btn btn-success" href="8/docs/Hello_World" role="button">Hello World »</a>
<a class="btn btn-info" href="8/docs" role="button" title="View jDrupal 8 Documentation">Docs &raquo;</a>
<a class="btn btn-default" href="8/api" role="button" title="View the jDrupal 8 API">API &raquo;</a>
</p>
<pre>// Connect to Drupal and say hello to the current user.
jDrupal.connect().then(function() {
var user = jDrupal.currentUser();
var msg = user.isAuthenticated() ?
'Hello ' + user.getAccountName() : 'Hello World';
alert(msg);
});</pre>
<pre>// Load a node and display the title.
jDrupal.nodeLoad(123).then(function(node) {
alert(node.getTitle());
});</pre>
<pre>// Login and show the user their id.
jDrupal.userLogin('bob', 'secret').then(function() {
alert(jDrupal.currentUser().id());
});</pre>
<pre>// Get results from a view and print the node ids to the console.
jDrupal.viewsLoad('my-view-url').then(function(view) {
var results = view.getResults();
for (var i = 0; i < results.length; i ++) {
var node = new jDrupal.Node(results[i]);
console.log('node id: ' + node.id());
}
});</pre>
<h3>Quick Examples for Drupal 7</h3>
<p>
<a class="btn btn-warning" href="7/docs/Hello_World" role="button">Hello World »</a>
<a class="btn btn-danger" href="7/docs" role="button" title="View jDrupal 7 Documentation">Docs &raquo;</a>
<a class="btn btn-default" href="7/api" role="button" title="View the jDrupal 7 API">API &raquo;</a>
</p>
<pre>// Connect to Drupal and say hello to the current user.
system_connect({
success: function(result) {
var msg = Drupal.user.uid == 0 ?
'Hello World' : 'Hello ' + Drupal.user.name;
alert(msg);
}
});</pre>
<pre>// Load a node and display the title.
node_load(123, {
success: function(node) {
alert(node.title);
}
});</pre>
<pre>// Login and show the user their id.
user_login("bob", "secret", {
success: function(result) {
alert(Drupal.user.id);
}
});</pre>
<h3>Getting Started</h3>
<p>For complete details, refer to the docs for <a href="8/docs">jDrupal 8</a> or <a href="7/docs">jDrupal 7</a>.</p>
<div class="alert alert-success" role="alert">
jDrupal is best friends with <a href="http://drupalgap.org">DrupalGap</a>, the open source application development kit for Drupal websites.
</div>
</div>
</div>
<!-- Site footer -->
<footer class="footer">
<div class="navbar">
<ul class="nav navbar-nav navbar-nav">
<li><a href="https://drupal.org/project/jdrupal">Drupal Module</a></li>
<li><a href="https://github.com/signalpoint/jDrupal">GitHub Project</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="https://github.com/signalpoint/jDrupal/issues">Support</a></li>
<li><a href="http://drupal.stackexchange.com/questions/ask">Ask a Question</a></li>
</ul>
</div>
</footer>
</div> <!-- /container -->
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<!--<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>-->
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script>
if (window.location.toString().indexOf('localhost') == -1) {
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-36188740-5', 'auto');
ga('send', 'pageview');
}
// var req = new XMLHttpRequest();
// req.open('GET', 'https://api.github.com/repos/signalpoint/jDrupal');
// req.onload = function() {
// if (req.status == 200) {
// console.log(req);
// }
// };
// req.onerror = function() {};
// req.send();
</script>
</body>
</html>
#!/bin/bash
echo "Installing jsdoc"
npm install jsdoc
echo "Installing jDrupal 7"
mkdir 7
cd 7
git clone --branch 7.x-1.x [email protected]:signalpoint/jDrupal.git
git clone --branch development [email protected]:signalpoint/daux.io.git
mv daux.io docs
cd docs
ln -s ../jDrupal/docs docs
cd ../..
echo "Installing jDrupal 8"
mkdir 8
cd 8
git clone --branch 8.x-1.x [email protected]:signalpoint/jDrupal.git
git clone --branch development [email protected]:signalpoint/daux.io.git
mv daux.io docs
cd docs
ln -s ../jDrupal/docs docs
#!/bin/bash
clear
echo "==== JDRUPAL WEB ===="
git push origin master
echo "==== JDRUPAL 8 ===="
cd 8/jDrupal
git push origin 8.x-1.x
echo "==== JDRUPAL 8 DOCS ===="
cd ../docs
git push origin development
cd ../..
echo "==== JDRUPAL 7 ===="
cd 7/jDrupal
git push origin 7.x-1.x
echo "==== JDRUPAL 7 DOCS ===="
cd ../docs
git push origin development
#!/bin/bash
cd www
rm -rf jdrupal
mkdir jdrupal
cd ~/www
chmod g-w -R jdrupal
#!/bin/bash
echo "Have a remote message"
cd www/jdrupal
unzip jdrupal-web.zip
rm jdrupal-web.zip
cd 7/docs
rm -rf docs
ln -s ~/www/jdrupal/7/jDrupal/docs docs
cd ../../8/docs
rm -rf docs
ln -s ~/www/jdrupal/8/jDrupal/docs docs
#!/bin/bash
clear
echo "==== JDRUPAL WEB ===="
git status
echo "==== JDRUPAL 8 ===="
cd 8/jDrupal
git status
echo "==== JDRUPAL 8 DOCS ===="
cd ../docs
git status
cd ../..
echo "==== JDRUPAL 7 ===="
cd 7/jDrupal
git status
echo "==== JDRUPAL 7 DOCS ===="
cd ../docs
git status
#!/bin/bash
git pull origin master
cd 8/jDrupal
git pull origin 8.x-1.x
cd ../docs
git pull origin development
cd ../../7/jDrupal
git pull origin 7.x-1.x
cd ../docs
git pull origin development
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment