Permalink
Browse files

Recommit

  • Loading branch information...
0 parents commit 45934fc273017c5c4415579b8e900ef6ec529d3e @Fluidbyte Fluidbyte committed Sep 15, 2012
Showing with 95,720 additions and 0 deletions.
  1. +4 −0 .gitignore_global
  2. +28 −0 README.md
  3. +85 −0 common.php
  4. +100 −0 components/active/class.active.php
  5. +59 −0 components/active/controller.php
  6. +206 −0 components/active/init.js
  7. +14 −0 components/active/screen.css
  8. +15,689 −0 components/editor/ace-editor/ace.js
  9. +367 −0 components/editor/ace-editor/keybinding-emacs.js
  10. +1,635 −0 components/editor/ace-editor/keybinding-vim.js
  11. +275 −0 components/editor/ace-editor/mode-c9search.js
  12. +744 −0 components/editor/ace-editor/mode-c_cpp.js
  13. +364 −0 components/editor/ace-editor/mode-clojure.js
  14. +527 −0 components/editor/ace-editor/mode-coffee.js
  15. +1,966 −0 components/editor/ace-editor/mode-coldfusion.js
  16. +633 −0 components/editor/ace-editor/mode-csharp.js
  17. +499 −0 components/editor/ace-editor/mode-css.js
  18. +250 −0 components/editor/ace-editor/mode-diff.js
  19. +822 −0 components/editor/ace-editor/mode-glsl.js
  20. +681 −0 components/editor/ace-editor/mode-golang.js
  21. +1,240 −0 components/editor/ace-editor/mode-groovy.js
  22. +633 −0 components/editor/ace-editor/mode-haxe.js
  23. +2,064 −0 components/editor/ace-editor/mode-html.js
  24. +1,202 −0 components/editor/ace-editor/mode-java.js
  25. +1,069 −0 components/editor/ace-editor/mode-javascript.js
  26. +588 −0 components/editor/ace-editor/mode-json.js
  27. +646 −0 components/editor/ace-editor/mode-jsx.js
  28. +95 −0 components/editor/ace-editor/mode-latex.js
  29. +512 −0 components/editor/ace-editor/mode-less.js
  30. +1,125 −0 components/editor/ace-editor/mode-liquid.js
  31. +551 −0 components/editor/ace-editor/mode-lua.js
  32. +2,415 −0 components/editor/ace-editor/mode-luahtml.js
  33. +2,604 −0 components/editor/ace-editor/mode-luapage.js
  34. +2,369 −0 components/editor/ace-editor/mode-markdown.js
  35. +464 −0 components/editor/ace-editor/mode-ocaml.js
  36. +432 −0 components/editor/ace-editor/mode-perl.js
  37. +970 −0 components/editor/ace-editor/mode-pgsql.js
  38. +1,718 −0 components/editor/ace-editor/mode-php.js
  39. +610 −0 components/editor/ace-editor/mode-powershell.js
  40. +397 −0 components/editor/ace-editor/mode-python.js
  41. +318 −0 components/editor/ace-editor/mode-ruby.js
  42. +732 −0 components/editor/ace-editor/mode-scad.js
  43. +1,237 −0 components/editor/ace-editor/mode-scala.js
  44. +537 −0 components/editor/ace-editor/mode-scss.js
  45. +250 −0 components/editor/ace-editor/mode-sh.js
  46. +140 −0 components/editor/ace-editor/mode-sql.js
  47. +1,681 −0 components/editor/ace-editor/mode-svg.js
  48. +320 −0 components/editor/ace-editor/mode-tcl.js
  49. 0 components/editor/ace-editor/mode-text.js
  50. +182 −0 components/editor/ace-editor/mode-textile.js
  51. +829 −0 components/editor/ace-editor/mode-xml.js
  52. +605 −0 components/editor/ace-editor/mode-xquery.js
  53. +189 −0 components/editor/ace-editor/mode-yaml.js
  54. +213 −0 components/editor/ace-editor/theme-chrome.js
  55. +167 −0 components/editor/ace-editor/theme-clouds.js
  56. +168 −0 components/editor/ace-editor/theme-clouds_midnight.js
  57. +194 −0 components/editor/ace-editor/theme-cobalt.js
  58. +200 −0 components/editor/ace-editor/theme-crimson_editor.js
  59. +198 −0 components/editor/ace-editor/theme-dawn.js
  60. +230 −0 components/editor/ace-editor/theme-dreamweaver.js
  61. +157 −0 components/editor/ace-editor/theme-eclipse.js
  62. +182 −0 components/editor/ace-editor/theme-github.js
  63. +186 −0 components/editor/ace-editor/theme-idle_fingers.js
  64. +189 −0 components/editor/ace-editor/theme-kr_theme.js
  65. +189 −0 components/editor/ace-editor/theme-merbivore.js
  66. +195 −0 components/editor/ace-editor/theme-merbivore_soft.js
  67. +197 −0 components/editor/ace-editor/theme-mono_industrial.js
  68. +194 −0 components/editor/ace-editor/theme-monokai.js
  69. +199 −0 components/editor/ace-editor/theme-pastel_on_dark.js
  70. +180 −0 components/editor/ace-editor/theme-solarized_dark.js
  71. +179 −0 components/editor/ace-editor/theme-solarized_light.js
  72. +216 −0 components/editor/ace-editor/theme-textmate.js
  73. +213 −0 components/editor/ace-editor/theme-tomorrow.js
  74. +213 −0 components/editor/ace-editor/theme-tomorrow_night.js
  75. +213 −0 components/editor/ace-editor/theme-tomorrow_night_blue.js
  76. +213 −0 components/editor/ace-editor/theme-tomorrow_night_bright.js
  77. +209 −0 components/editor/ace-editor/theme-tomorrow_night_eighties.js
  78. +211 −0 components/editor/ace-editor/theme-twilight.js
  79. +190 −0 components/editor/ace-editor/theme-vibrant_ink.js
  80. +7,187 −0 components/editor/ace-editor/worker-coffee.js
  81. +10,914 −0 components/editor/ace-editor/worker-css.js
  82. +10,417 −0 components/editor/ace-editor/worker-javascript.js
  83. +2,920 −0 components/editor/ace-editor/worker-json.js
  84. +201 −0 components/editor/init.js
  85. +16 −0 components/editor/screen.css
  86. +351 −0 components/filemanager/class.filemanager.php
  87. +61 −0 components/filemanager/controller.php
  88. +78 −0 components/filemanager/dialog.php
  89. +64 −0 components/filemanager/dialog_upload.php
  90. +56 −0 components/filemanager/download.php
  91. BIN components/filemanager/images/application.png
  92. BIN components/filemanager/images/box.png
  93. BIN components/filemanager/images/code.png
  94. BIN components/filemanager/images/config.png
  95. BIN components/filemanager/images/css.png
  96. BIN components/filemanager/images/db.png
  97. BIN components/filemanager/images/directory.png
  98. BIN components/filemanager/images/directory_open.png
  99. BIN components/filemanager/images/doc.png
  100. BIN components/filemanager/images/file.png
  101. BIN components/filemanager/images/film.png
  102. BIN components/filemanager/images/flash.png
  103. BIN components/filemanager/images/html.png
  104. BIN components/filemanager/images/java.png
  105. BIN components/filemanager/images/linux.png
  106. BIN components/filemanager/images/music.png
  107. BIN components/filemanager/images/pdf.png
  108. BIN components/filemanager/images/php.png
  109. BIN components/filemanager/images/picture.png
  110. BIN components/filemanager/images/ppt.png
  111. BIN components/filemanager/images/progress_bar.png
  112. BIN components/filemanager/images/psd.png
  113. BIN components/filemanager/images/ruby.png
  114. BIN components/filemanager/images/script.png
  115. BIN components/filemanager/images/spinner.gif
  116. BIN components/filemanager/images/text-plain.png
  117. BIN components/filemanager/images/xls.png
  118. BIN components/filemanager/images/zip.png
  119. +391 −0 components/filemanager/init.js
  120. +119 −0 components/filemanager/screen.css
  121. +1,080 −0 components/filemanager/upload_scripts/jquery.fileupload.js
  122. +172 −0 components/filemanager/upload_scripts/jquery.iframe-transport.js
  123. +282 −0 components/filemanager/upload_scripts/jquery.ui.widget.js
  124. +129 −0 components/install/process.php
  125. +195 −0 components/install/view.php
  126. +46 −0 components/keybindings/init.js
  127. +1 −0 components/load.json
  128. +142 −0 components/project/class.project.php
  129. +68 −0 components/project/controller.php
  130. +101 −0 components/project/dialog.php
  131. +104 −0 components/project/init.js
  132. +1 −0 components/project/screen.css
  133. +149 −0 components/user/class.user.php
  134. +77 −0 components/user/controller.php
  135. +118 −0 components/user/dialog.php
  136. +133 −0 components/user/init.js
  137. 0 config.php
  138. +21 −0 css/fonts.css
  139. +24 −0 css/reset.css
  140. +129 −0 css/screen.css
  141. BIN favicon.ico
  142. BIN fonts/entypo-webfont.eot
  143. +198 −0 fonts/entypo-webfont.svg
  144. BIN fonts/entypo-webfont.ttf
  145. BIN fonts/entypo-webfont.woff
  146. BIN fonts/ubuntu-webfont.eot
  147. +245 −0 fonts/ubuntu-webfont.svg
  148. BIN fonts/ubuntu-webfont.ttf
  149. BIN fonts/ubuntu-webfont.woff
  150. +141 −0 icon_sheet.php
  151. BIN images/loading.gif
  152. +167 −0 index.php
  153. +21 −0 install.txt
  154. +4 −0 js/jquery-1.7.2.min.js
  155. +37 −0 js/jquery-ui-1.8.23.custom.min.js
  156. 0 js/jquery.css3.min.js
  157. +205 −0 js/jquery.easing.js
  158. +168 −0 js/system.js
  159. +20 −0 license.txt
@@ -0,0 +1,4 @@
+# Ignore the following:
+config.php
+workspace
+data
@@ -0,0 +1,28 @@
+# Codiad Web IDE
+
+Codiad is a web-based IDE framework with a small footprint and minimal requirements. The system is still early in development, and while it has been proven extremely stable please be sure to backup regularly if you use it in any production work.
+
+Keep up to date with the latest changes and news on **[Twitter](http://twitter.com/codiadide)** or **[Facebook](http://www.facebook.com/Codiad)**
+
+## Getting Started
+
+Installation of Codiad requires uploading the files and making several directories and a config file writeable. There is no database and no other server components are required. PHP 5.3 or above is recommended, however, the system will work with any version of PHP over v.5.
+
+For more information please **[read the installation instructions](https://github.com/Fluidbyte/Codiad/wiki/Installation)** on the Wiki.
+
+## Interface
+
+Codiad consists of three panels; a left panel which houses the file manager and active files, center panel which is where editors reside, and a right panel which contains system and other controls. The two side panels collapse to give full-window focus to the code editor.
+
+![Codiad Screenshot](http://codiad.com/screenshot.jpg)
+
+
+## Getting More Advanced
+
+Codiad is a very complete package, however, it was designed to allow developers to easily expand upon the base platform.
+
+If you're looking to develop components or custom functionality please **[check out the Wiki](https://github.com/Fluidbyte/Codiad/wiki)** for information about the architecture and API.
+
+***
+
+_Project developed by [Kent Safranski](http://www.fluidbyte.net) with support from [Tictonix](http://www.tictonix.com)_
@@ -0,0 +1,85 @@
+<?php
+
+ /*
+ * Copyright (c) Codiad & Kent Safranski (codiad.com), distributed
+ * as-is and without warranty under the MIT License. See
+ * [root]/license.txt for more. This information must remain intact.
+ */
+
+ //////////////////////////////////////////////////////////////////
+ // Check Session / Key
+ //////////////////////////////////////////////////////////////////
+
+ function checkSession(){
+ // Set any API keys
+ $api_keys = array();
+ // Check API Key or Session Authentication
+ $key = "";
+ if(isset($_GET['key'])){ $key = $_GET['key']; }
+ if(!isset($_SESSION['user']) && !in_array($key,$api_keys)){
+ exit('Authentication Failure');
+ }
+ }
+
+ //////////////////////////////////////////////////////////////////
+ // Get JSON
+ //////////////////////////////////////////////////////////////////
+
+ function getJSON($file){
+ $json = file_get_contents(BASE_PATH . "/data/" . $file);
+ $json = str_replace("|*/?>","",str_replace("<?php/*|","",$json));
+ $json = json_decode($json,true);
+ return $json;
+ }
+
+ //////////////////////////////////////////////////////////////////
+ // Save JSON
+ //////////////////////////////////////////////////////////////////
+
+ function saveJSON($file,$data){
+ $data = "<?php/*|" . json_encode($data) . "|*/?>";
+ $write = fopen(BASE_PATH . "/data/" . $file, 'w') or die("can't open file");
+ fwrite($write, $data);
+ fclose($write);
+ }
+
+ //////////////////////////////////////////////////////////////////
+ // Format JSEND Response
+ //////////////////////////////////////////////////////////////////
+
+ function formatJSEND($status,$data=false){
+
+ // Success ///////////////////////////////////////////////
+ if($status=="success"){
+ if($data){
+ $jsend = '{"status":"success","data":'.json_encode($data).'}';
+ }else{
+ $jsend = '{"status":"success","data":null}';
+ }
+
+ // Error /////////////////////////////////////////////////
+ }else{
+ $jsend = '{"status":"error","message":"'.$data.'"}';
+ }
+
+ // Return ////////////////////////////////////////////////
+ return $jsend;
+
+ }
+
+ //////////////////////////////////////////////////////////////////
+ // Check Function Availability
+ //////////////////////////////////////////////////////////////////
+
+ function isAvailable($func) {
+ if (ini_get('safe_mode')) return false;
+ $disabled = ini_get('disable_functions');
+ if ($disabled) {
+ $disabled = explode(',', $disabled);
+ $disabled = array_map('trim', $disabled);
+ return !in_array($func, $disabled);
+ }
+ return true;
+ }
+
+?>
@@ -0,0 +1,100 @@
+<?php
+
+/*
+* Copyright (c) Codiad & Kent Safranski (codiad.com), distributed
+* as-is and without warranty under the MIT License. See
+* [root]/license.txt for more. This information must remain intact.
+*/
+
+class Active {
+
+ //////////////////////////////////////////////////////////////////
+ // PROPERTIES
+ //////////////////////////////////////////////////////////////////
+
+ public $username = "";
+ public $path = "";
+ public $actives = "";
+
+ //////////////////////////////////////////////////////////////////
+ // METHODS
+ //////////////////////////////////////////////////////////////////
+
+ // -----------------------------||----------------------------- //
+
+ //////////////////////////////////////////////////////////////////
+ // Construct
+ //////////////////////////////////////////////////////////////////
+
+ public function __construct(){
+ $this->actives = getJSON('active.php');
+ }
+
+ //////////////////////////////////////////////////////////////////
+ // List User's Active Files
+ //////////////////////////////////////////////////////////////////
+
+ public function ListActive(){
+ $active_list = array();
+ if($this->actives){
+ foreach($this->actives as $active=>$data){
+ if($data['username']==$this->username){
+ $active_list[] = $data['path'];
+ }
+ }
+ }
+ echo formatJSEND("success",$active_list);
+ }
+
+ //////////////////////////////////////////////////////////////////
+ // Check File
+ //////////////////////////////////////////////////////////////////
+
+ public function Check(){
+ $cur_users = array();
+ foreach($this->actives as $active=>$data){
+ if($data['username']!=$this->username && $data['path']==$this->path){
+ $cur_users[] = $data['username'];
+ }
+ }
+ if(count($cur_users)!=0){
+ echo formatJSEND("error","Warning: File Currently Opened By: " . implode(", ",$cur_users));
+ }else{
+ echo formatJSEND("success");
+ }
+ }
+
+ //////////////////////////////////////////////////////////////////
+ // Add File
+ //////////////////////////////////////////////////////////////////
+
+ public function Add(){
+ $process_add = true;
+ foreach($this->actives as $active=>$data){
+ if($data['username']==$this->username && $data['path']==$this->path){
+ $process_add = false;
+ }
+ }
+ if($process_add){
+ $this->actives[] = array("username"=>$this->username,"path"=>$this->path);
+ saveJSON('active.php',$this->actives);
+ echo formatJSEND("success");
+ }
+ }
+
+ //////////////////////////////////////////////////////////////////
+ // Remove File
+ //////////////////////////////////////////////////////////////////
+
+ public function Remove(){
+ foreach($this->actives as $active=>$data){
+ if($this->username==$data['username'] && $this->path==$data['path']){
+ //$revised_list[] = array("username"=>$data['username'],"path"=>$data['path']);
+ unset($this->actives[$active]);
+ }
+ }
+ saveJSON('active.php',$this->actives);
+ echo formatJSEND("success");
+ }
+
+}
@@ -0,0 +1,59 @@
+<?php
+
+ /*
+ * Copyright (c) Codiad & Kent Safranski (codiad.com), distributed
+ * as-is and without warranty under the MIT License. See
+ * [root]/license.txt for more. This information must remain intact.
+ */
+
+ require_once('../../config.php');
+ require_once('class.active.php');
+
+ $Active = new Active();
+
+ //////////////////////////////////////////////////////////////////
+ // Verify Session or Key
+ //////////////////////////////////////////////////////////////////
+
+ checkSession();
+
+ //////////////////////////////////////////////////////////////////
+ // Get user's active files
+ //////////////////////////////////////////////////////////////////
+
+ if($_GET['action']=='list'){
+ $Active->username = $_SESSION['user'];
+ $Active->ListActive();
+ }
+
+ //////////////////////////////////////////////////////////////////
+ // Add active record
+ //////////////////////////////////////////////////////////////////
+
+ if($_GET['action']=='add'){
+ $Active->username = $_SESSION['user'];
+ $Active->path = $_GET['path'];
+ $Active->Add();
+ }
+
+ //////////////////////////////////////////////////////////////////
+ // Check if file is active
+ //////////////////////////////////////////////////////////////////
+
+ if($_GET['action']=='check'){
+ $Active->username = $_SESSION['user'];
+ $Active->path = $_GET['path'];
+ $Active->Check();
+ }
+
+ //////////////////////////////////////////////////////////////////
+ // Remove active record
+ //////////////////////////////////////////////////////////////////
+
+ if($_GET['action']=='remove'){
+ $Active->username = $_SESSION['user'];
+ $Active->path = $_GET['path'];
+ $Active->Remove();
+ }
+
+?>
Oops, something went wrong.

0 comments on commit 45934fc

Please sign in to comment.