_binary From 0829fff4dffee701915254409ac9ec2d5bdfc24f Mon Sep 17 00:00:00 2001
From: epinapala <epinapala@ebay.com>
Date: Sat, 18 Oct 2014 20:11:38 -0700
Subject: [PATCH 1/2] Made all suggested changes by Professor, See a summary
 below: (1) basic.js is not allowed to have hard-coded constants or make use
 of PHP. X (2) You are using 8 spaces rather than 4 spaces for tabbing on code
 you introduced in basic.js. X (3) Although I said to put renderHelpButton in
 View, you should instead make a Helper subclass. That way your code isn't
 loaded every time any view is made (even on those pages that don't have
 wiki-help). (4) I still can't get any wiki help pages to work. I just get
 data equal null errors in the Javascript console when I set the group id to
 be of an existing group.X (5) The word Edit is hard-coded and not localizable
 in displayHelpForId. (6) The point of the square brackets around Edit is
 accessibility. But you put them as part of the link text rather than outside
 the link text which defeats their purpose.X (7) Don't have global uses of
 anonymous function definitions like you did for the function get in basic.js.
 Make it match the other function definitions in basic.jsX (8) The function
 name get is too vague and non-specific. There is already a getPage function
 in basic.js. Your code seems to be adding some functionality related to it,
 so maybe call it getPageWithCallback.X (9) Output html should be XHTML 5. So
 you can't write things like <hr>. Instead it should be <hr />X (10) Each
 parameter or return value in a comment needs a short description next to it.X
 (11) target_c --> target_controller (no abbreviations in variable names)X
 (12) {type} as the type is too vague.X (13) Don't use braces around types.
 Write String not {String}.X (14) Javascript has a Function object type, it
 does not have a function type.X (15) @returns --> @returnX

Created a new subclass for helper- help button.
Fixes some undefined vars.
Few more bug fixes.

Removed Preview button
Now the Localization content is sent as data-tl attribute and eval'd on the client side to retrieve tl object.
Removed localization entry for Preview button.
---
 .idea/.name                                 |   1 +
 .idea/encodings.xml                         |   5 +
 .idea/misc.xml                              |   6 +
 .idea/modules.xml                           |   9 +
 .idea/scopes/scope_settings.xml             |   5 +
 .idea/vcs.xml                               |   7 +
 .idea/workspace.xml                         | 196 +++++++++++++++++++
 .idea/yioop.iml                             |   9 +
 controllers/components/social_component.php |   4 +-
 css/editor.css                              |   6 +-
 css/search.css                              |  18 +-
 lib/utility.php                             |   5 +-
 lib/wiki_parser.php                         |  27 ++-
 locale/ar/configure.ini                     |   3 -
 locale/bn/configure.ini                     |   3 -
 locale/de/configure.ini                     |   3 -
 locale/en-US/configure.ini                  |   5 +-
 locale/es/configure.ini                     |   3 -
 locale/fa/configure.ini                     |   3 -
 locale/fr-FR/configure.ini                  |   3 -
 locale/he/configure.ini                     |   3 -
 locale/hi/configure.ini                     |   3 -
 locale/in-ID/configure.ini                  |   3 -
 locale/it/configure.ini                     |   3 -
 locale/ja/configure.ini                     |   3 -
 locale/kn/configure.ini                     |   3 -
 locale/ko/configure.ini                     |   3 -
 locale/pl/configure.ini                     |   3 -
 locale/pt/configure.ini                     |   3 -
 locale/ru/configure.ini                     |   3 -
 locale/te/configure.ini                     |   3 -
 locale/th/configure.ini                     |   3 -
 locale/tr/configure.ini                     |   3 -
 locale/vi-VN/configure.ini                  |   3 -
 locale/zh-CN/configure.ini                  |   3 -
 models/group_model.php                      |  17 +-
 scripts/basic.js                            | 286 +++++++++++++---------------
 scripts/wiki.js                             |  27 +--
 views/elements/api_element.php              |   1 +
 views/elements/element.php                  |  21 --
 views/elements/help_element.php             |   2 +
 views/elements/managegroups_element.php     |   8 +-
 views/elements/wiki_element.php             |  16 +-
 views/helpers/helpbutton_helper.php         |  88 +++++++++
 44 files changed, 512 insertions(+), 320 deletions(-)
 create mode 100644 .idea/.name
 create mode 100644 .idea/encodings.xml
 create mode 100644 .idea/misc.xml
 create mode 100644 .idea/modules.xml
 create mode 100644 .idea/scopes/scope_settings.xml
 create mode 100644 .idea/vcs.xml
 create mode 100644 .idea/workspace.xml
 create mode 100644 .idea/yioop.iml
 create mode 100644 views/helpers/helpbutton_helper.php

diff --git a/.idea/.name b/.idea/.name
new file mode 100644
index 0000000..64245e6
--- /dev/null
+++ b/.idea/.name
@@ -0,0 +1 @@
+yioop
\ No newline at end of file
diff --git a/.idea/encodings.xml b/.idea/encodings.xml
new file mode 100644
index 0000000..e206d70
--- /dev/null
+++ b/.idea/encodings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
+</project>
+
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..24c7d2a
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="PhpProjectSharedConfiguration" php_language_level="5.5.0" />
+  <component name="ProjectRootManager" version="2" />
+</project>
+
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..345dcbf
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectModuleManager">
+    <modules>
+      <module fileurl="file://$PROJECT_DIR$/.idea/yioop.iml" filepath="$PROJECT_DIR$/.idea/yioop.iml" />
+    </modules>
+  </component>
+</project>
+
diff --git a/.idea/scopes/scope_settings.xml b/.idea/scopes/scope_settings.xml
new file mode 100644
index 0000000..922003b
--- /dev/null
+++ b/.idea/scopes/scope_settings.xml
@@ -0,0 +1,5 @@
+<component name="DependencyValidationManager">
+  <state>
+    <option name="SKIP_IMPORT_STATEMENTS" value="false" />
+  </state>
+</component>
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..c80f219
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="$PROJECT_DIR$" vcs="Git" />
+  </component>
+</project>
+
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
new file mode 100644
index 0000000..e4d3729
--- /dev/null
+++ b/.idea/workspace.xml
@@ -0,0 +1,196 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ChangeListManager">
+    <list default="true" id="f3aea52d-9728-42ee-a249-6dfcb9d933f1" name="Default" comment="">
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/scripts/basic.js" afterPath="$PROJECT_DIR$/scripts/basic.js" />
+    </list>
+    <ignored path="yioop.iws" />
+    <ignored path=".idea/workspace.xml" />
+    <ignored path=".idea/dataSources.local.xml" />
+    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
+    <option name="TRACKING_ENABLED" value="true" />
+    <option name="SHOW_DIALOG" value="false" />
+    <option name="HIGHLIGHT_CONFLICTS" value="true" />
+    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
+    <option name="LAST_RESOLUTION" value="IGNORE" />
+  </component>
+  <component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
+  <component name="CreatePatchCommitExecutor">
+    <option name="PATCH_PATH" value="" />
+  </component>
+  <component name="DaemonCodeAnalyzer">
+    <disable_hints />
+  </component>
+  <component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
+  <component name="FavoritesManager">
+    <favorites_list name="yioop" />
+  </component>
+  <component name="FileEditorManager">
+    <leaf />
+  </component>
+  <component name="FindManager">
+    <FindUsagesManager>
+      <setting name="OPEN_NEW_TAB" value="true" />
+    </FindUsagesManager>
+  </component>
+  <component name="Git.Settings">
+    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
+  </component>
+  <component name="IdeDocumentHistory">
+    <option name="changedFiles">
+      <list>
+        <option value="$PROJECT_DIR$/scripts/basic.js" />
+      </list>
+    </option>
+  </component>
+  <component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" interpreter_name="PHP" />
+  <component name="ProjectFrameBounds">
+    <option name="y" value="23" />
+    <option name="width" value="1440" />
+    <option name="height" value="812" />
+  </component>
+  <component name="ProjectLevelVcsManager" settingsEditedManually="false">
+    <OptionsSetting value="true" id="Add" />
+    <OptionsSetting value="true" id="Remove" />
+    <OptionsSetting value="true" id="Checkout" />
+    <OptionsSetting value="true" id="Update" />
+    <OptionsSetting value="true" id="Status" />
+    <OptionsSetting value="true" id="Edit" />
+    <ConfirmationsSetting value="0" id="Add" />
+    <ConfirmationsSetting value="0" id="Remove" />
+  </component>
+  <component name="ProjectReloadState">
+    <option name="STATE" value="0" />
+  </component>
+  <component name="ProjectView">
+    <navigator currentView="ProjectPane" proportions="" version="1">
+      <flattenPackages />
+      <showMembers />
+      <showModules />
+      <showLibraryContents />
+      <hideEmptyPackages />
+      <abbreviatePackageNames />
+      <autoscrollToSource />
+      <autoscrollFromSource />
+      <sortByType />
+    </navigator>
+    <panes>
+      <pane id="ProjectPane">
+        <subPane>
+          <PATH>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="yioop" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+            </PATH_ELEMENT>
+          </PATH>
+          <PATH>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="yioop" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="yioop" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+          </PATH>
+          <PATH>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="yioop" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="yioop" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="scripts" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+          </PATH>
+        </subPane>
+      </pane>
+      <pane id="Scope" />
+    </panes>
+  </component>
+  <component name="PropertiesComponent">
+    <property name="last_opened_file_path" value="$PROJECT_DIR$/../../bin" />
+    <property name="options.lastSelected" value="preferences.sourceCode.General" />
+    <property name="options.splitter.main.proportions" value="0.3" />
+    <property name="options.splitter.details.proportions" value="0.2" />
+    <property name="WebServerToolWindowFactoryState" value="true" />
+  </component>
+  <component name="RunManager">
+    <list size="0" />
+  </component>
+  <component name="ShelveChangesManager" show_recycled="false" />
+  <component name="TaskManager">
+    <task active="true" id="Default" summary="Default task">
+      <changelist id="f3aea52d-9728-42ee-a249-6dfcb9d933f1" name="Default" comment="" />
+      <created>1413686670446</created>
+      <option name="number" value="Default" />
+      <updated>1413686670446</updated>
+    </task>
+    <servers />
+  </component>
+  <component name="ToolWindowManager">
+    <frame x="0" y="23" width="1440" height="812" extended-state="6" />
+    <editor active="false" />
+    <layout>
+      <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
+      <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
+      <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
+      <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
+      <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
+      <window_info id="Application Servers" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
+      <window_info id="Remote Host" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
+      <window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.25" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
+      <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
+      <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
+      <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
+      <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
+      <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
+      <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
+      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
+      <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
+      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
+      <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
+      <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
+      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
+    </layout>
+  </component>
+  <component name="Vcs.Log.UiProperties">
+    <option name="RECENTLY_FILTERED_USER_GROUPS">
+      <collection />
+    </option>
+    <option name="RECENTLY_FILTERED_BRANCH_GROUPS">
+      <collection />
+    </option>
+  </component>
+  <component name="VcsContentAnnotationSettings">
+    <option name="myLimit" value="2678400000" />
+  </component>
+  <component name="VcsManagerConfiguration">
+    <option name="myTodoPanelSettings">
+      <TodoPanelSettings />
+    </option>
+  </component>
+  <component name="XDebuggerManager">
+    <breakpoint-manager>
+      <option name="time" value="1" />
+    </breakpoint-manager>
+    <watches-manager />
+  </component>
+  <component name="editorHistoryManager">
+    <entry file="file://$PROJECT_DIR$/scripts/basic.js">
+      <provider selected="true" editor-type-id="text-editor">
+        <state vertical-scroll-proportion="1.5034965" vertical-offset="6155" max-vertical-offset="7320">
+          <caret line="482" column="1" selection-start-line="482" selection-start-column="1" selection-end-line="482" selection-end-column="1" />
+          <folding>
+            <element signature="n#!!doc" expanded="true" />
+          </folding>
+        </state>
+      </provider>
+    </entry>
+  </component>
+</project>
+
diff --git a/.idea/yioop.iml b/.idea/yioop.iml
new file mode 100644
index 0000000..6b8184f
--- /dev/null
+++ b/.idea/yioop.iml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="WEB_MODULE" version="4">
+  <component name="NewModuleRootManager">
+    <content url="file://$MODULE_DIR$" />
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+</module>
+
diff --git a/controllers/components/social_component.php b/controllers/components/social_component.php
index e21994e..633f201 100644
--- a/controllers/components/social_component.php
+++ b/controllers/components/social_component.php
@@ -1632,7 +1632,7 @@ EOD;
                     $name_parts = pathinfo($media_name);
                     $file_name = $name_parts['filename'];
                     $data['MEDIA_NAME'] = $media_name;
-                    $page_string = "((resource:$media_name|$file_name))";
+                    $page_string = "{{resource:$media_name|$file_name}}";
                     $data["PAGE"] = $group_model->insertResourcesParsePage(
                         $group_id, $page_id, $page_string);
                     $data["PAGE_ID"] = $page_id;
@@ -2243,4 +2243,4 @@ EOD;
         }
         $data['SCRIPT'] .= ']; drawFragments();';
     }
-}
+}
\ No newline at end of file
diff --git a/css/editor.css b/css/editor.css
index b036579..292d7cc 100755
--- a/css/editor.css
+++ b/css/editor.css
@@ -161,13 +161,11 @@
 }
 .wikibtn-table
 {
-    background: url(
-        ../resources/wiki_button_images/wikibtn-table.png) no-repeat;
+    background: url(../resources/wiki_button_images/wikibtn-table.png) no-repeat;
 }
 .wikibtn-search-widget
 {
-    background: url(
-        ../resources/wiki_button_images/wikibtn-search-widget.png)
+    background: url(../resources/wiki_button_images/wikibtn-search-widget.png)
         no-repeat;
 }
 
diff --git a/css/search.css b/css/search.css
index 696c537..9e32717 100755
--- a/css/search.css
+++ b/css/search.css
@@ -305,22 +305,6 @@ a.echo-link:hover
     clear: both;
 }
 
-.width-half
-{
-    width:50%;
-}
-
-.width-three-quarter
-{
-    width:75%;
-}
-
-.width-half img,
-.width-three-quarter img
-{
-    width:100%;
-}
-
 .frame
 {
     border: 1px solid #ccc;
@@ -2860,4 +2844,4 @@ top: 1in;
 }
 .wiki-resource-image{
     max-width:100%;
-}
+}
\ No newline at end of file
diff --git a/lib/utility.php b/lib/utility.php
index 138adc4..50ff4d8 100755
--- a/lib/utility.php
+++ b/lib/utility.php
@@ -1748,9 +1748,6 @@ function readMessage()
 function mimeType($file_name)
 {
     $mime_type = "unknown";
-    if(!file_exists($file_name)) {
-        return $mime_type;
-    }
     if(class_exists("finfo")) {
         $finfo = new finfo(FILEINFO_MIME);
         $mime_type = $finfo->file($file_name);
@@ -2167,4 +2164,4 @@ function bchexdec($hex)
     }
     return $dec;
 }
-?>
+?>
\ No newline at end of file
diff --git a/lib/wiki_parser.php b/lib/wiki_parser.php
index 157c251..09f5cb6 100644
--- a/lib/wiki_parser.php
+++ b/lib/wiki_parser.php
@@ -75,7 +75,6 @@ class WikiParser implements CrawlConstants
     {
         $esc = $this->esc;
         $not_braces = '(?:[^\}]|\}[^\}])*';
-        $not_paragraph = '(?:\A|[^\n]|[^\n]\n)';
         $class_or_id = '0-9a-zA-Z\_\-\s';
         $this->minimal = $minimal;
         //assume substitutions are applied after htmlentities called on string
@@ -205,10 +204,10 @@ class WikiParser implements CrawlConstants
             array('/\r/', ""),
         );
         $braces_substitutions = array(
-            array('/'.$not_paragraph.'{{\s*class\s*\=\s*'.
+            array('/[^\n]{{\s*class\s*\=\s*'.
                 "&quot;([$class_or_id]+)&quot;\s+()}}/",
                 "$esc<span class=\"$1\" >\t\n$2$esc</span>\t"),
-            array('/'.$not_paragraph.'{{\s*class\s*\=\s*'.
+            array('/[^\n]{{\s*class\s*\=\s*'.
                 "&#039;([$class_or_id]+)&#039;\s+(".$not_braces .")}}/",
                 "$esc<span class=\"$1\" >\t\n$2$esc</span>\t"),
             array('/\n*?{{\s*class\s*\=\s*'.
@@ -226,20 +225,20 @@ class WikiParser implements CrawlConstants
             array("/\n*?{{\s*id\s*\=\s*&#039;([$class_or_id]+)&#039;\s+("
                 .$not_braces .')}}/',
                 "\n\n$esc<div id='$1'>\n\n$2\n\n$esc</div>"),
-            array('/'.$not_paragraph.'{{\s*style\s*\=\s*'.
-                '&quot;([0-9a-zA-Z\/\#\_\-\.\;\:\s\n\%]+)&quot;\s+('.
+            array('/\n*?{{\s*style\s*\=\s*'.
+                '&quot;([0-9a-zA-Z\/\#\_\-\.\;\:\s\n]+)&quot;\s+('.
                  $not_braces .')}}/',
                 "$esc<span style=\"$1\">$2$esc</span>"),
             array('/\n*?{{\s*style\s*\=\s*'.
-                '&quot;([0-9a-zA-Z\/\#\_\-\.\;\:\s\n\%]+)&quot;\s+('.
+                '&quot;([0-9a-zA-Z\/\#\_\-\.\;\:\s\n]+)&quot;\s+('.
                 $not_braces .')}}/',
                 "\n\n$esc<div style=\"$1\">\n\n$2\n\n$esc</div>"),
-            array('/'.$not_paragraph.'{{\s*style\s*\=\s*'.
-                '&#039;([0-9a-zA-Z\_\-\.\;\:\s\n\%]+)&#039;'.
+            array('/\n*?{{\s*style\s*\=\s*'.
+                '&#039;([0-9a-zA-Z\_\-\.\;\:\s\n]+)&#039;'.
                 '\s+('.$not_braces .')}}/',
                 "$esc<span style='$1'>\t$2$esc</span>\t"),
             array('/\n*?{{\s*style\s*\=\s*'.
-                '&#039;([0-9a-zA-Z\_\-\.\;\:\s\n\%]+)&#039;\s+('.
+                '&#039;([0-9a-zA-Z\_\-\.\;\:\s\n]+)&#039;\s+('.
                 $not_braces .')}}/',
                 "\n\n$esc<div style='$1'>\n\n$2\n\n$esc</div>"),
             array('/\n*{{center\s*\|\s*('.$not_braces .')}}/',
@@ -381,7 +380,7 @@ class WikiParser implements CrawlConstants
         return $document;
     }
     /**
-     * @param string $document
+     *
      */
     function processRegexes($document)
     {
@@ -398,9 +397,7 @@ class WikiParser implements CrawlConstants
         return $document;
     }
     /**
-     * @param array $matches
-     * @param array $replaces
-     * @param string $document
+     *
      */
     function processProvidedRegexes($matches, $replaces, $document)
     {
@@ -418,7 +415,7 @@ class WikiParser implements CrawlConstants
         return $document;
     }
     /**
-     *  @param string $document
+     *
      */
     function cleanLinksAndParagraphs($document)
     {
@@ -837,4 +834,4 @@ function base64DecodeCallback($matches)
 {
     return "<pre>".base64_decode($matches[1])."</pre>";
 }
-?>
+?>
\ No newline at end of file
diff --git a/locale/ar/configure.ini b/locale/ar/configure.ini
index d6bc5e2..08844aa 100755
--- a/locale/ar/configure.ini
+++ b/locale/ar/configure.ini
@@ -3242,9 +3242,6 @@ wiki_element_media_list = ""
 ; wiki_element.php line: 397
 wiki_element_ml_description = ""
 ;
-; wiki_element.php line: 399
-wiki_element_previewbutton = ""
-;
 ; wiki_element.php line: 414
 wiki_view_page_resources = ""
 ;
diff --git a/locale/bn/configure.ini b/locale/bn/configure.ini
index 0e1c73f..0f6bb07 100755
--- a/locale/bn/configure.ini
+++ b/locale/bn/configure.ini
@@ -3242,9 +3242,6 @@ wiki_element_media_list = ""
 ; wiki_element.php line: 397
 wiki_element_ml_description = ""
 ;
-; wiki_element.php line: 399
-wiki_element_previewbutton = ""
-;
 ; wiki_element.php line: 414
 wiki_view_page_resources = ""
 ;
diff --git a/locale/de/configure.ini b/locale/de/configure.ini
index 9c92c70..384c3bc 100755
--- a/locale/de/configure.ini
+++ b/locale/de/configure.ini
@@ -3242,9 +3242,6 @@ wiki_element_media_list = ""
 ; wiki_element.php line: 397
 wiki_element_ml_description = ""
 ;
-; wiki_element.php line: 399
-wiki_element_previewbutton = ""
-;
 ; wiki_element.php line: 414
 wiki_view_page_resources = ""
 ;
diff --git a/locale/en-US/configure.ini b/locale/en-US/configure.ini
index bd9552d..dc5715f 100755
--- a/locale/en-US/configure.ini
+++ b/locale/en-US/configure.ini
@@ -3233,7 +3233,7 @@ wiki_element_archive_info = "To archive a page so it won&#039;t appear in search
 ; wiki_element.php line: 384
 wiki_element_edit_reason = "Edit Reason:"
 ;
-; wiki_element.php line: 393
+; wiki_element.php line: 392
 wiki_element_savebutton = "Save"
 ;
 ; wiki_element.php line: 396
@@ -3242,9 +3242,6 @@ wiki_element_media_list = "Media List Page"
 ; wiki_element.php line: 397
 wiki_element_ml_description = "The uploaded items below will all appear when this page is read as a gallery or media list."
 ;
-; wiki_element.php line: 399
-wiki_element_previewbutton = "Preview"
-;
 ; wiki_element.php line: 414
 wiki_view_page_resources = "Page Resources"
 ;
diff --git a/locale/es/configure.ini b/locale/es/configure.ini
index ecaf8cf..dcd55af 100755
--- a/locale/es/configure.ini
+++ b/locale/es/configure.ini
@@ -3242,9 +3242,6 @@ wiki_element_media_list = ""
 ; wiki_element.php line: 397
 wiki_element_ml_description = ""
 ;
-; wiki_element.php line: 399
-wiki_element_previewbutton = ""
-;
 ; wiki_element.php line: 414
 wiki_view_page_resources = ""
 ;
diff --git a/locale/fa/configure.ini b/locale/fa/configure.ini
index a76687a..4a60883 100755
--- a/locale/fa/configure.ini
+++ b/locale/fa/configure.ini
@@ -3242,9 +3242,6 @@ wiki_element_media_list = ""
 ; wiki_element.php line: 397
 wiki_element_ml_description = ""
 ;
-; wiki_element.php line: 399
-wiki_element_previewbutton = ""
-;
 ; wiki_element.php line: 414
 wiki_view_page_resources = ""
 ;
diff --git a/locale/fr-FR/configure.ini b/locale/fr-FR/configure.ini
index 98e4562..c3a16cb 100755
--- a/locale/fr-FR/configure.ini
+++ b/locale/fr-FR/configure.ini
@@ -3242,9 +3242,6 @@ wiki_element_media_list = ""
 ; wiki_element.php line: 397
 wiki_element_ml_description = ""
 ;
-; wiki_element.php line: 399
-wiki_element_previewbutton = ""
-;
 ; wiki_element.php line: 414
 wiki_view_page_resources = ""
 ;
diff --git a/locale/he/configure.ini b/locale/he/configure.ini
index 0564177..c528da5 100755
--- a/locale/he/configure.ini
+++ b/locale/he/configure.ini
@@ -3242,9 +3242,6 @@ wiki_element_media_list = ""
 ; wiki_element.php line: 397
 wiki_element_ml_description = ""
 ;
-; wiki_element.php line: 399
-wiki_element_previewbutton = ""
-;
 ; wiki_element.php line: 414
 wiki_view_page_resources = ""
 ;
diff --git a/locale/hi/configure.ini b/locale/hi/configure.ini
index 47af7cf..b6f6e8f 100755
--- a/locale/hi/configure.ini
+++ b/locale/hi/configure.ini
@@ -3242,9 +3242,6 @@ wiki_element_media_list = ""
 ; wiki_element.php line: 397
 wiki_element_ml_description = ""
 ;
-; wiki_element.php line: 399
-wiki_element_previewbutton = ""
-;
 ; wiki_element.php line: 414
 wiki_view_page_resources = ""
 ;
diff --git a/locale/in-ID/configure.ini b/locale/in-ID/configure.ini
index 5282a5c..76d2840 100755
--- a/locale/in-ID/configure.ini
+++ b/locale/in-ID/configure.ini
@@ -3242,9 +3242,6 @@ wiki_element_media_list = ""
 ; wiki_element.php line: 397
 wiki_element_ml_description = ""
 ;
-; wiki_element.php line: 399
-wiki_element_previewbutton = ""
-;
 ; wiki_element.php line: 414
 wiki_view_page_resources = ""
 ;
diff --git a/locale/it/configure.ini b/locale/it/configure.ini
index acad5ee..11c9844 100755
--- a/locale/it/configure.ini
+++ b/locale/it/configure.ini
@@ -3242,9 +3242,6 @@ wiki_element_media_list = ""
 ; wiki_element.php line: 397
 wiki_element_ml_description = ""
 ;
-; wiki_element.php line: 399
-wiki_element_previewbutton = ""
-;
 ; wiki_element.php line: 414
 wiki_view_page_resources = ""
 ;
diff --git a/locale/ja/configure.ini b/locale/ja/configure.ini
index 6dfebc3..06dc5e7 100755
--- a/locale/ja/configure.ini
+++ b/locale/ja/configure.ini
@@ -3242,9 +3242,6 @@ wiki_element_media_list = ""
 ; wiki_element.php line: 397
 wiki_element_ml_description = ""
 ;
-; wiki_element.php line: 399
-wiki_element_previewbutton = ""
-;
 ; wiki_element.php line: 414
 wiki_view_page_resources = ""
 ;
diff --git a/locale/kn/configure.ini b/locale/kn/configure.ini
index c70e3df..74f46af 100755
--- a/locale/kn/configure.ini
+++ b/locale/kn/configure.ini
@@ -3242,9 +3242,6 @@ wiki_element_media_list = ""
 ; wiki_element.php line: 397
 wiki_element_ml_description = ""
 ;
-; wiki_element.php line: 399
-wiki_element_previewbutton = ""
-;
 ; wiki_element.php line: 414
 wiki_view_page_resources = ""
 ;
diff --git a/locale/ko/configure.ini b/locale/ko/configure.ini
index c42163b..11b84f7 100755
--- a/locale/ko/configure.ini
+++ b/locale/ko/configure.ini
@@ -3242,9 +3242,6 @@ wiki_element_media_list = ""
 ; wiki_element.php line: 397
 wiki_element_ml_description = ""
 ;
-; wiki_element.php line: 399
-wiki_element_previewbutton = ""
-;
 ; wiki_element.php line: 414
 wiki_view_page_resources = ""
 ;
diff --git a/locale/pl/configure.ini b/locale/pl/configure.ini
index c8ca748..3e8a064 100755
--- a/locale/pl/configure.ini
+++ b/locale/pl/configure.ini
@@ -3242,9 +3242,6 @@ wiki_element_media_list = ""
 ; wiki_element.php line: 397
 wiki_element_ml_description = ""
 ;
-; wiki_element.php line: 399
-wiki_element_previewbutton = ""
-;
 ; wiki_element.php line: 414
 wiki_view_page_resources = ""
 ;
diff --git a/locale/pt/configure.ini b/locale/pt/configure.ini
index 30e71bd..4310ca6 100755
--- a/locale/pt/configure.ini
+++ b/locale/pt/configure.ini
@@ -3242,9 +3242,6 @@ wiki_element_media_list = ""
 ; wiki_element.php line: 397
 wiki_element_ml_description = ""
 ;
-; wiki_element.php line: 399
-wiki_element_previewbutton = ""
-;
 ; wiki_element.php line: 414
 wiki_view_page_resources = ""
 ;
diff --git a/locale/ru/configure.ini b/locale/ru/configure.ini
index 60f17dd..a6e4185 100755
--- a/locale/ru/configure.ini
+++ b/locale/ru/configure.ini
@@ -3242,9 +3242,6 @@ wiki_element_media_list = ""
 ; wiki_element.php line: 397
 wiki_element_ml_description = ""
 ;
-; wiki_element.php line: 399
-wiki_element_previewbutton = ""
-;
 ; wiki_element.php line: 414
 wiki_view_page_resources = ""
 ;
diff --git a/locale/te/configure.ini b/locale/te/configure.ini
index 91e47d4..50a739c 100755
--- a/locale/te/configure.ini
+++ b/locale/te/configure.ini
@@ -3242,9 +3242,6 @@ wiki_element_media_list = ""
 ; wiki_element.php line: 397
 wiki_element_ml_description = ""
 ;
-; wiki_element.php line: 399
-wiki_element_previewbutton = ""
-;
 ; wiki_element.php line: 414
 wiki_view_page_resources = ""
 ;
diff --git a/locale/th/configure.ini b/locale/th/configure.ini
index 0ffb090..e7ed27d 100755
--- a/locale/th/configure.ini
+++ b/locale/th/configure.ini
@@ -3242,9 +3242,6 @@ wiki_element_media_list = ""
 ; wiki_element.php line: 397
 wiki_element_ml_description = ""
 ;
-; wiki_element.php line: 399
-wiki_element_previewbutton = ""
-;
 ; wiki_element.php line: 414
 wiki_view_page_resources = ""
 ;
diff --git a/locale/tr/configure.ini b/locale/tr/configure.ini
index a459061..82fe851 100755
--- a/locale/tr/configure.ini
+++ b/locale/tr/configure.ini
@@ -3242,9 +3242,6 @@ wiki_element_media_list = ""
 ; wiki_element.php line: 397
 wiki_element_ml_description = ""
 ;
-; wiki_element.php line: 399
-wiki_element_previewbutton = ""
-;
 ; wiki_element.php line: 414
 wiki_view_page_resources = ""
 ;
diff --git a/locale/vi-VN/configure.ini b/locale/vi-VN/configure.ini
index 7a761bc..5c99ae9 100755
--- a/locale/vi-VN/configure.ini
+++ b/locale/vi-VN/configure.ini
@@ -3242,9 +3242,6 @@ wiki_element_media_list = ""
 ; wiki_element.php line: 397
 wiki_element_ml_description = ""
 ;
-; wiki_element.php line: 399
-wiki_element_previewbutton = ""
-;
 ; wiki_element.php line: 414
 wiki_view_page_resources = ""
 ;
diff --git a/locale/zh-CN/configure.ini b/locale/zh-CN/configure.ini
index 7914cc0..87bd5b6 100755
--- a/locale/zh-CN/configure.ini
+++ b/locale/zh-CN/configure.ini
@@ -3242,9 +3242,6 @@ wiki_element_media_list = ""
 ; wiki_element.php line: 397
 wiki_element_ml_description = ""
 ;
-; wiki_element.php line: 399
-wiki_element_previewbutton = ""
-;
 ; wiki_element.php line: 414
 wiki_view_page_resources = ""
 ;
diff --git a/models/group_model.php b/models/group_model.php
index c35d847..37a00b7 100644
--- a/models/group_model.php
+++ b/models/group_model.php
@@ -1148,7 +1148,7 @@ class GroupModel extends Model
             $page_id);
         if(!$folders) { return $parsed_page; }
         list($folder, $thumb_folder) = $folders;
-        if(!preg_match_all('/\(\(resource:(.+?)\|(.+?)\)\)/ui',
+        if(!preg_match_all('/{{resource:(.+?)\|(.+?)}}/ui',
             $parsed_page, $matches)){
             return $parsed_page;
         }
@@ -1193,8 +1193,7 @@ class GroupModel extends Model
                     }
                 }
                 $replace_string .= $resource_description."\n"."</video>";
-                $parsed_page = preg_replace('/'.
-                    preg_quote($match_string, '/').'/u',
+                $parsed_page = preg_replace('/'.preg_quote($match_string).'/u',
                     $replace_string, $parsed_page);
             } else if (in_array($mime_type, array('audio/basic', 'audio/L24',
                 'audio/mp4', 'audio/mpeg', 'audio/ogg', 'audio/opus',
@@ -1204,13 +1203,13 @@ class GroupModel extends Model
                     "<source src='$resource_url'  >\n".
                     $resource_description."\n".
                     "</audio>";
-                $parsed_page = preg_replace('/'.preg_quote($match_string, '/')
-                    .'/u', $replace_string, $parsed_page);
+                $parsed_page = preg_replace('/'.preg_quote($match_string).'/u',
+                    $replace_string, $parsed_page);
             } else {
-                $replace_string = "<a href='$resource_url' >".
+                $replace_string = "$mime_type<a href='$resource_url' >".
                     "$resource_description</a>";
-                $parsed_page = preg_replace('/'.preg_quote($match_string, '/')
-                    .'/u',  $replace_string, $parsed_page);
+                $parsed_page = preg_replace('/'.preg_quote($match_string).'/u',
+                    $replace_string, $parsed_page);
             }
         }
         return $parsed_page;
@@ -1408,4 +1407,4 @@ class GroupModel extends Model
         return array($total, $pages);
     }
 }
-?>
+?>
\ No newline at end of file
diff --git a/scripts/basic.js b/scripts/basic.js
index bc12ea2..8c70092 100755
--- a/scripts/basic.js
+++ b/scripts/basic.js
@@ -180,22 +180,22 @@ function toggleDisplay(id)
     }
     obj.style.display = value;
 }
-
 current_activity_closed = true;
 current_activity_top = 0;
 /*
  * Toggles Help element from display:none and display block.
  * Also changes the width of the Current activity accordingly.
- * @param {String} help element's id to toggle.
- * @param {String} isMobile flag true/false.
+ * @param String help element's id to toggle.
+ * @param String isMobile flag true/false.
+ * @param String target_controller Edit page's controller name.
+ * @return none
  */
-function toggleHelp(id, isMobile, target_c)
-{
-    var activity = (target_c === "admin") ? 'current-activity'
-    : 'small-margin-current-activity';
+function toggleHelp(id, isMobile, target_controller) {
+    var activity = (target_controller === "admin") ? 'current-activity' :
+        'small-margin-current-activity';
     var images = document.querySelectorAll(".wiki-resource-image");
     var all_help_elements =
-            document.getElementsByClassName(activity);
+        document.getElementsByClassName(activity);
     var help_node = all_help_elements[0];
     if (current_activity_closed === true) {
         current_activity_top = getCssProperty(help_node, 'top');
@@ -208,11 +208,11 @@ function toggleHelp(id, isMobile, target_c)
         var decrease_width_by = Math.floor(getCssProperty(obj, 'width') / 3);
         //Calculate pixel to inch. clientWidth only returns in pixels.
         if (obj.style.display === "none") {
-            new_width = Math.floor(getCssProperty(help_node, 'width'))
-                    + decrease_width_by;
+            new_width = Math.floor(getCssProperty(help_node, 'width')) +
+                decrease_width_by;
         } else if (obj.style.display === "block") {
-            new_width = Math.floor(getCssProperty(help_node, 'width'))
-                    - decrease_width_by;
+            new_width = Math.floor(getCssProperty(help_node, 'width')) -
+                decrease_width_by;
         }
 
         if (new_width !== undefined) {
@@ -227,8 +227,8 @@ function toggleHelp(id, isMobile, target_c)
             help_node.style.top = current_activity_top + "px";
             current_activity_closed = true;
         } else if (obj.style.display === "block") {
-            help_node.style.top = current_activity_top
-                    + height_after_toggle + "px";
+            help_node.style.top = current_activity_top +
+                height_after_toggle + "px";
             /* The div.clientHeight doesnt include the height
             of the images inside the div before the images are completely
             loaded. So we iterate through the
@@ -236,9 +236,9 @@ function toggleHelp(id, isMobile, target_c)
             height to the top of the current_activity div dynamically. */
             for (var i = 0; i < images.length; i++) {
                 var image = images[i];
-                image.onload = function(){
-                    help_node.style.top =  getCssProperty(help_node, 'top')
-                            + this.height + 'px';
+                image.onload = function() {
+                    help_node.style.top = getCssProperty(help_node,
+                        'top') + this.height + 'px';
                 };
             }
             current_activity_closed = false;
@@ -247,12 +247,12 @@ function toggleHelp(id, isMobile, target_c)
 }
 
 /*
- * gets the Css property given an element and property name.
- * @param {Element} elm to get the Css property for
- * @param {String} Css property name.
+ * Gets the Css property given an element and property name.
+ * @param Object elm Element to get the Css property for.
+ * @param String property Css property name.
+ * @return String Css property value
  */
-function getCssProperty(elm, property)
-{
+function getCssProperty(elm, property) {
     //always returns in px
     return parseInt(window.getComputedStyle(elm, null)
         .getPropertyValue(property));
@@ -261,11 +261,10 @@ function getCssProperty(elm, property)
 /**
  * This is a JS function to convert yioop wiki markup to
  * html.
- * @param {String} wiki_text tobe parsed as HTML
- * @returns {String} parsed html
+ * @param String wiki_text to be parsed as HTML
+ * @return String parsed html.
  */
-function parseWikiContent(wiki_text, group_id, page_id)
-{
+function parseWikiContent(wiki_text, group_id, page_id) {
     var html = wiki_text;
 
     /* note that line breaks from a text area are sent
@@ -276,68 +275,63 @@ function parseWikiContent(wiki_text, group_id, page_id)
     html = parseLists(html);
 
     //Regex replace normal links
-    html = html.replace(/[^\[](http[^\[\s]*)/g, function (m, l) {
-    // normal link
+    html = html.replace(/[^\[](http[^\[\s]*)/g, function(m, l) {
+        // normal link
         return '<a href="' + l + '">' + l + '</a>';
     });
 
     //Regex replace for external links
-    html = html.replace(/[\[](http.*)[!\]]/g, function (m, l) {
-    // external link
+    html = html.replace(/[\[](http.*)[!\]]/g, function(m, l) {
+        // external link
         var p = l.replace(/[\[\]]/g, '').split(/ /);
         var link = p.shift();
-        return '<a href="' + link + '">'
-        + (p.length ? p.join(' ') : link) + '</a>';
+        return '<a href="' + link + '">' + (p.length ? p.join(' ') :
+            link) + '</a>';
     });
 
     //Regex replace for headings
     html = html.replace(/(?:^|\n)([=]+)(.*)\1/g,
-            function (match, contents, t) {
-                return '<h'
-                        + contents.length + '>'
-                        + t
-                        + '</h'
-                        + contents.length
-                        + '>';
-            });
+        function(match, contents, t) {
+            return '<h' + contents.length + '>' + t + '</h' + contents.length +
+                '>';
+        });
 
     //Regex replace for Bold characters
-    html = html.replace(/'''(.*?)'''/g, function (match, contents) {
+    html = html.replace(/'''(.*?)'''/g, function(match, contents) {
         return '<b>' + contents + '</b>';
     });
 
     //Regex replace for Italic characters
-    html = html.replace(/''(.*?)''/g, function (match, contents) {
+    html = html.replace(/''(.*?)''/g, function(match, contents) {
         return '<i>' + contents + '</i>';
     });
 
     //Regex for resource extraction.
     html = html.replace(/{{resource:(.+?)\|(.+?)}}/g,
-            function (match, contents, desc) {
-                return '<img src="' + "?c=resource&a=get&f=resources&g="
-                + group_id
-                + "&p=" + page_id
-                + "&n=" + contents + '" alt="' + desc
-                + '" class="wiki-resource-image"/>';
-            });
+        function(match, contents, desc) {
+            return '<img src="' + "?c=resource&a=get&f=resources&g=" +
+                group_id + "&p=" + page_id + "&n=" + contents +
+                '" alt="' + desc + '" class="wiki-resource-image"/>';
+        });
 
     //Regex replace for HR
-    html = html.replace(/----(.*?)/g, function (match, contents) {
-        return '<hr>' + contents + '</hr>';
+    html = html.replace(/----(.*?)/g, function(match, contents) {
+        return contents + '<hr />';
     });
 
     //replace nowiki with pre tags
-    html = html.replace(/<nowiki>(.*?)<\/nowiki>/g, function(match, contents) {
+    html = html.replace(/<nowiki>(.*?)<\/nowiki>/g, function(match,
+        contents) {
         return '<pre>' + contents + '</pre>';
     });
 
     //Regex replace for blocks
     html = html.replace(/(?:^|\n+)([^# =\*<].+)(?:\n+|$)/gm,
-            function (match, contents) {
-                if (contents.match(/^\^+$/))
-                    return contents;
-                return "\n<div>" + contents + "</div>\n";
-            });
+        function(match, contents) {
+            if (contents.match(/^\^+$/))
+                return contents;
+            return "\n<div>" + contents + "</div>\n";
+        });
 
     return html;
 }
@@ -345,40 +339,38 @@ function parseWikiContent(wiki_text, group_id, page_id)
 /**
  * Lists need to be recursively parsed. So the below function is used
  * to recursively convert wiki markup to html.
- * @param {String} str
- * @returns {String}
- */
-function parseLists(str)
-{
-    return str.replace(/(?:(?:(?:^|\n)[\*#].*)+)/g, function (match) {
+ * @param String str usually the content string in which the UL/OL lists are
+ * needed to be parsed to html.
+ * @return String parsed html.
+ **/
+function parseLists(str) {
+    return str.replace(/(?:(?:(?:^|\n)[\*#].*)+)/g, function(match) {
         var listType = match.match(/(^|\n)#/) ? 'ol' : 'ul';
         match = match.replace(/(^|\n)[\*#][ ]{0,1}/g, "$1");
         match = parseLists(match);
-        return '<'
-                + listType + '><li>'
-                + match.replace(/^\n/, '')
-                .split(/\n/).join('</li><li>')
-                + '</li></' + listType
-                + '>';
+        return '<' + listType + '><li>' + match.replace(/^\n/, '')
+            .split(/\n/).join('</li><li>') + '</li></' + listType +
+            '>';
     });
 }
 
 /**
- * get does a GET HTTP call on the url passed.
+ * getPageWithCallback does a GET HTTP call on the url passed.
  * Also fires the callback functions passed as
  * params appropriately.
  *
- * @param {String} url
- * @param {String} response_type
- * @param {function} success_call_back
- * @param {function} error_handler
- */
-var get = function (url, response_type, success_call_back, error_handler)
-{
+ * @param String url the url used for making GET HTTP call.
+ * @param String response_type The response type expected.
+ * @param Function object success_call_back Callback function on success.
+ * @param Function object error_handler Callback function on failure.
+ * @return none
+ * */
+function getPageWithCallback(url, response_type,
+    success_call_back, error_handler) {
     var request = makeRequest();
     request.open('GET', url, true);
     request.responseType = response_type;
-    request.onload = function () {
+    request.onload = function() {
         var status = request.status;
         if (status == 200) {
             success_call_back && success_call_back(request.response);
@@ -390,92 +382,82 @@ var get = function (url, response_type, success_call_back, error_handler)
 };
 
 /**
+ * /**
  * takes in the help point id, uses it to fetch wiki content, then
  * wiki content is being eval'd to be painted int he help pane.
  * Ajax call happens only if help needs to be displayed.
- * @param {object} help_point element
- * @param {String} is_mobile flag to check if the client is mobile
+ * @param Object help_point element
+ * @param String is_mobile flag to check if the client is mobile
  * or not.
+ * @param String target_controller Wiki page's controller name.
+ * @param String csrf_token_key teh dynamic name used for CSRF token var.
+ * @param String csrf_token_value The CSRF token to render edit page.
+ * @param String help_group_id  help's group_id required to render resources.
+ * @param String api_controller api's controller name.
+ * @param String api_action api's action name.
+ * @param String mode r/w mode , usually read.
+ * @return none
  */
-function displayHelpForId(help_point, is_mobile,target_c, csrf_token_key,
-    csrf_token_value)
-{
-    var help_group_id = 1;
-    var c = 'api';
-    var a = "wiki";
-    var arg = "read";
+function displayHelpForId(
+    help_point,
+    is_mobile,
+    target_controller,
+    csrf_token_key,
+    csrf_token_value,
+    help_group_id,
+    api_controller,
+    api_action,
+    mode) {
     if ((elt("help-frame").style.display) === "block") {
-        toggleHelp('help-frame', is_mobile,target_c);
+        toggleHelp('help-frame', is_mobile, target_controller);
         return;
     }
-    get("?c=" + c + "&group_id=" + help_group_id + "&" +
-            "arg=" + arg + "&" +
-            "a=" + a + "&" +
-            csrf_token_key +'=' + csrf_token_value + "&" +
-            "page_name=" + help_point.getAttribute("data-pagename"),
-            'json',
-            function (data) {
-                elt("help-frame-body").innerHTML = parseWikiContent(
-                        data.wiki_content,
-                        data.group_id,
-                        data.page_id
-                        );
-                elt('page_name').innerHTML = data.page_name + ' <a href="'+
-                        getEditLink(
-                        target_c,
-                        csrf_token_key,
-                        csrf_token_value,
-                        help_group_id,
-                        data.page_name) +'">'+
-                        '[Edit]</a>';
+    var tl = eval( '(' + help_point.getAttribute("data-tl") + ')' );
+    getPageWithCallback("?c=" + api_controller + "&group_id=" +
+        help_group_id + "&" +
+        "arg=" + mode + "&" +
+        "a=" + api_action + "&" +
+        csrf_token_key + '=' + csrf_token_value + "&" +
+        "page_name=" + help_point.getAttribute("data-pagename"),
+        'json',
+        function(data) {
+            elt("help-frame-body").innerHTML = parseWikiContent(
+                data.wiki_content,
+                data.group_id,
+                data.page_id
+            );
+            elt('page_name').innerHTML = data.page_name + ' [<a href="' +
+                getEditLink(
+                    target_controller,
+                    csrf_token_key,
+                    csrf_token_value,
+                    help_group_id,
+                    data.page_name) + '">' +
+                tl["wiki_view_edit"] + '</a>]';
 
-                toggleHelp('help-frame', is_mobile,target_c);
-            },
-            function (status) {
-                toggleHelp('help-frame', is_mobile,target_c);
-            });
+            toggleHelp('help-frame', is_mobile, target_controller);
+        },
+        function(status) {
+            toggleHelp('help-frame', is_mobile, target_controller);
+        });
     event.preventDefault();
 }
 
 /**
  * Simple function to construct the Wiki Edit hyperlink with passed in params.
- * @param {type} target_c
- * @param {type} csrf_token
- * @param {type} group_id
- * @param {type} page_name
- * @returns {String}
+ * @param String target_controller Edit page's controller name.
+ * @param String csrf_token_key teh dynamic name used for CSRF token var.
+ * @param String csrf_token_value The CSRF token to render edit page.
+ * @param String group_id GroupId of the group which has the wiki.
+ * @param String page_name Page name,unique Identifier for wiki edit page.
+ * @return String
  */
-function getEditLink(target_c,
-                csrf_token_key, csrf_token_value, group_id, page_name)
-{
-    return '?c=' + target_c +
-            '&'+ csrf_token_key +'=' + csrf_token_value +
-            '&group_id=' + group_id +
-            '&arg=edit' +
-            '&a=wiki' +
-            '&page_name=' + page_name;
-}
-
-
-/**
- * this function grabs the contents of the wiki text area,
- * converts them into html then populates the preview
- * div with parsed html contents. It takes in a page id and group id that are
- * required to render image urls, If any exist.
- * @param {type} page_id
- * @param {type} group_id
- */
-function renderPreview(page_id, group_id)
-{
-    if (event.preventDefault)
-        event.preventDefault();
-    event.returnValue = false;
-    var textArea = document.getElementById('wiki-page');
-    var div = document.getElementById('wiki-preview');
-    div.innerHTML = "<hr>"
-            + "<p>"
-            + parseWikiContent(
-            textArea.value,
-            group_id,
-            page_id) + "</p> <hr>";
-}
+function getEditLink(target_controller, csrf_token_key, csrf_token_value,
+    group_id, page_name) {
+    return '?c=' + target_controller +
+        '&' + csrf_token_key + '=' + csrf_token_value +
+        '&group_id=' + group_id +
+        '&arg=edit' +
+        '&a=wiki' +
+        '&page_name=' + page_name;
+}
\ No newline at end of file
diff --git a/scripts/wiki.js b/scripts/wiki.js
index 17a8025..a4ed428 100755
--- a/scripts/wiki.js
+++ b/scripts/wiki.js
@@ -131,6 +131,7 @@ function editorize(id)
     var editor_toolbar = '<div id="wiki-popup-prompt-' + id +
         '" class="wiki-popup-prompt" style="display: none;"></div>' +
         '<form><div class="wiki-buttons">' + button_string;
+
     /*
         check if heading was desired and render if was.
      */
@@ -174,7 +175,7 @@ function editorize(id)
 /**
  * Method to return standard buttons as an object.
  *
- * @return Object
+ * @returns Object
  */
 function getStandardButtonsObject()
 {
@@ -189,10 +190,10 @@ function getStandardButtonsObject()
         'wikibtn-numbers': ['# ' + tl['wiki_js_enum'] + ' \n'],
         'wikibtn-hr': ['---- \n'],
         'wikibtn-slide': ['='+ tl['wiki_js_slide_sample_title'] +'=\n'
-            + '* '+ tl['wiki_js_slide_sample_bullet'] +'\n'
-            + '* '+ tl['wiki_js_slide_sample_bullet'] + '\n'
-            + '* '+ tl['wiki_js_slide_sample_bullet'] + '\n'
-            + '....' + '\n']
+                    + '* '+ tl['wiki_js_slide_sample_bullet'] +'\n'
+                    + '* '+ tl['wiki_js_slide_sample_bullet'] + '\n'
+                    + '* '+ tl['wiki_js_slide_sample_bullet'] + '\n'
+                    + '....' + '\n']
     };
 }
 /**
@@ -289,10 +290,11 @@ function getSelection(id)
         text_area.selectionEnd = sleft.text.length + sel.text.length;
         text_area.selectedText = sel.text;
         var selected_text_prefix = text_area.value.substring(0,
-            text_area.selectionStart);
+                text_area.selectionStart);
         var selection = sel.text;
         var selected_text_suffix = text_area.value.substring(
-            text_area.selectionEnd, text_area.textLength);
+                text_area.selectionEnd,
+                text_area.textLength);
     } else if (typeof (text_area.selectionStart) !== "undefined") {
         /**
          Things are pretty straightforward in Mozilla based
@@ -302,12 +304,12 @@ function getSelection(id)
          Then compute the prefix and suffix using substr method.
          */
         var selected_text_prefix = text_area.value.substr(0,
-            text_area.selectionStart);
+                text_area.selectionStart);
         var selection = text_area.value.substr(
-            text_area.selectionStart,
-            text_area.selectionEnd - text_area.selectionStart);
+                text_area.selectionStart,
+                text_area.selectionEnd - text_area.selectionStart);
         var selected_text_suffix = text_area.value.substr(
-            text_area.selectionEnd);
+                text_area.selectionEnd);
     }
     var obj = {};
     obj.selection = selection;
@@ -468,6 +470,7 @@ function createWikiTable(rows, cols, example_text, header_text)
         }
         table = table + "|- " + br;
         table = table + "| ";
+
         for(j = 0; j < cols; j++) {
             table = table + example_text + " ";
             if (j < (cols - 1)) {
@@ -739,4 +742,4 @@ function createSearchWidgetForm(id)
         '</button></form></div></div>';
     search_elt.innerHTML = search_form;
     return search_elt;
-}
+}
\ No newline at end of file
diff --git a/views/elements/api_element.php b/views/elements/api_element.php
index 59e9920..f847cf3 100644
--- a/views/elements/api_element.php
+++ b/views/elements/api_element.php
@@ -75,6 +75,7 @@ class ApiElement extends Element implements CrawlConstants {
      */
     function renderJsonDocument($data, $can_edit, $logged_in) {
         $out_array = array();
+        $http_code = 0;
         if ($data["PAGE"]) {
             $out_array["wiki_content"] = html_entity_decode($data['PAGE'],
                     ENT_QUOTES);
diff --git a/views/elements/element.php b/views/elements/element.php
index 3910c02..e48cbd6 100755
--- a/views/elements/element.php
+++ b/views/elements/element.php
@@ -67,27 +67,6 @@ abstract class Element
      * that should be used in drawing the view
      */
     public abstract function render($data);
-
-    /**
-     * This method is used to render the help button,
-     * given a help point  csrf token and target controller name.
-     *
-     * @param  $help_point_id - used to set as help button id
-     * @param  $csrf_token_value - csrf token to make api call/open edit link
-     * @param  $target_c - target controller to remember the view.
-     * @return String button html.
-     */
-    public function renderHelpButton($help_point_id,
-            $csrf_token_value, $target_c) {
-        $is_mobile = MOBILE ? "true" : "false";
-        return '<button type="button"
-                    href=""
-                    onclick="javascript:displayHelpForId(this,'
-                . $is_mobile . ',\'' . $target_c . '\',\''. CSRF_TOKEN .'\',\''
-                . $csrf_token_value . '\')" '
-                . 'data-pagename="' . $help_point_id . '">?</button>';
-    }
-
 }
 
 ?>
diff --git a/views/elements/help_element.php b/views/elements/help_element.php
index 8a54055..f1a32ff 100644
--- a/views/elements/help_element.php
+++ b/views/elements/help_element.php
@@ -70,6 +70,8 @@ class HelpElement extends Element {
                     </div>
                 </div>
             <?php } else {
+                $help_class_add = "";
+                $help_id = "";
                 if($data['c'] != 'admin'){
                     $help_class_add = "small-margin-help-pane";
                     $help_id ="small-margin-help";
diff --git a/views/elements/managegroups_element.php b/views/elements/managegroups_element.php
index 48a8806..1016ee7 100755
--- a/views/elements/managegroups_element.php
+++ b/views/elements/managegroups_element.php
@@ -162,7 +162,7 @@ class ManagegroupsElement extends Element
                                 "</span>");
                         } else {
                         ?>
-                            <form  method="get" action='./' >
+                            <form  method="get" action='#' >
                             <input type="hidden" name="c" value="admin" />
                             <input type="hidden" name="<?php e(CSRF_TOKEN); ?>"
                                 value="<?php e($data[CSRF_TOKEN]); ?>" />
@@ -328,8 +328,8 @@ class ManagegroupsElement extends Element
                     <td>[<a href="<?php e($browse_url); ?>"><?php
                         e(tl('managegroups_element_browse')); ?></a>]
                     <?php
-                    e($this->renderHelpButton("browse_url", $data[CSRF_TOKEN],
-                            $_REQUEST['c']));
+                    e($this->view->helper("helpbutton")->render(
+                            "browse_url", $data[CSRF_TOKEN],$_REQUEST['c']));
                     ?></td>
                 <?php
                 }
@@ -642,4 +642,4 @@ class ManagegroupsElement extends Element
             $view, $title, $return_form_name, $fields, $dropdowns);
     }
 }
-?>
+?>
\ No newline at end of file
diff --git a/views/elements/wiki_element.php b/views/elements/wiki_element.php
index b7e63f9..870131d 100644
--- a/views/elements/wiki_element.php
+++ b/views/elements/wiki_element.php
@@ -383,25 +383,15 @@ class WikiElement extends Element implements CrawlConstants
             <div class="top-margin">
             <label for="edit-reason"><b><?php
             e(tl('wiki_element_edit_reason'));
-            ?></b></label><input type="text" id='edit-reason'
-                name="edit_reason" value=""
-                maxlength="<?php e(SHORT_TITLE_LEN); ?>" class="wide-field"/>
-            </div>
+            ?></b></label><input type="text" id='edit-reason' name="edit_reason"
+                  value="" maxlength="<?php e(SHORT_TITLE_LEN); ?>" 
+                  class="wide-field"/></div>
             </div>
             <div id="save-container" class="top-margin center">
             <button class="button-box" type="submit"><?php
                 e(tl('wiki_element_savebutton')); ?></button>
-            <button id="wiki-preview-btn"
-                    onclick="javascript:renderPreview('<?php
-                        e($data["PAGE_ID"] . "','"
-                      . $data['GROUP']['GROUP_ID']);
-            ?>')" class="button-box"><?php
-                e(tl('wiki_element_previewbutton')); ?></button>
             </div>
         </form>
-        <div id="wiki-preview">
-
-        </div>
         <div class="top-margin" id="media-list-page">
         <h2><?php e(tl('wiki_element_media_list'))?></h2>
         <p><?php e(tl('wiki_element_ml_description'))?></p>
diff --git a/views/helpers/helpbutton_helper.php b/views/helpers/helpbutton_helper.php
new file mode 100644
index 0000000..ad7154d
--- /dev/null
+++ b/views/helpers/helpbutton_helper.php
@@ -0,0 +1,88 @@
+<?php
+/**
+ * SeekQuarry/Yioop --
+ * Open Source Pure PHP Search Engine, Crawler, and Indexer
+ *
+ * Copyright (C) 2009 - 2014  Chris Pollett chris@pollett.org
+ *
+ * LICENSE:
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * END LICENSE
+ *
+ * @author Eswara Rajesh Pinapala epinapala@live.com
+ * @package seek_quarry
+ * @subpackage helper
+ * @license http://www.gnu.org/licenses/ GPL3
+ * @link http://www.seekquarry.com/
+ * @copyright 2009 - 2014
+ * @filesource
+ */
+if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();}
+/**
+ * Load base helper class if needed
+ */
+require_once BASE_DIR."/views/helpers/helper.php";
+/**
+ * This is a helper class is used to
+ * draw help button for context sensitive
+ * help.
+ *
+ * @author Eswara Rajesh Pinapala
+ * @package seek_quarry
+ * @subpackage helper
+ */
+class HelpbuttonHelper extends Helper
+{
+    /**
+     * The constructor at this point initializes the
+     * all the required code for Wiki Help initialization.
+     */
+    function __construct()
+    {
+        $this->localizationdata = "{".
+            'wiki_view_edit :"'.tl('wiki_view_edit').'",'.
+            'wiki_view_read :"'.tl('wiki_view_read').'"'.
+            "}";
+        parent::__construct();
+    }
+
+    /**
+     * This method is used to render the help button,
+     * given a help point  csrf token and target controller name.
+     *
+     * @param  $help_point_id - used to set as help button id
+     * @param  $csrf_token_value - csrf token to make api call/open edit link
+     * @param  $target_c - target controller to remember the view.
+     * @return String button html.
+     */
+    public function render($help_point_id,
+                           $csrf_token_value, $target_c) {
+        $is_mobile = MOBILE ? "true" : "false";
+        $wiki_group_id = "7";
+        $api_controller = "api";
+        $api_wiki_action ="wiki";
+        $api_wiki_mode = "read";
+
+        return '<button type="button"
+                    data-tl=\''.$this->localizationdata.'\'
+                    onclick="javascript:displayHelpForId(this,'
+        . $is_mobile . ',\'' . $target_c . '\',\''. CSRF_TOKEN .'\',\''
+        . $csrf_token_value ."','$wiki_group_id','$api_controller',"
+        . "'$api_wiki_action','$api_wiki_mode" . '\')" '
+        . 'data-pagename="' . $help_point_id . '">?</button>';
+    }
+}
+?>
-- 
1.9.3 (Apple Git-50)


From c1936a62747844315294208faaaf96df8ba97d79 Mon Sep 17 00:00:00 2001
From: epinapala <epinapala@ebay.com>
Date: Sat, 18 Oct 2014 20:20:15 -0700
Subject: [PATCH 2/2] removing unneeded .idea IDE files

---
 .idea/.name                     |   1 -
 .idea/encodings.xml             |   5 -
 .idea/misc.xml                  |   6 --
 .idea/modules.xml               |   9 --
 .idea/scopes/scope_settings.xml |   5 -
 .idea/vcs.xml                   |   7 --
 .idea/workspace.xml             | 196 ----------------------------------------
 .idea/yioop.iml                 |   9 --
 8 files changed, 238 deletions(-)
 delete mode 100644 .idea/.name
 delete mode 100644 .idea/encodings.xml
 delete mode 100644 .idea/misc.xml
 delete mode 100644 .idea/modules.xml
 delete mode 100644 .idea/scopes/scope_settings.xml
 delete mode 100644 .idea/vcs.xml
 delete mode 100644 .idea/workspace.xml
 delete mode 100644 .idea/yioop.iml

diff --git a/.idea/.name b/.idea/.name
deleted file mode 100644
index 64245e6..0000000
--- a/.idea/.name
+++ /dev/null
@@ -1 +0,0 @@
-yioop
\ No newline at end of file
diff --git a/.idea/encodings.xml b/.idea/encodings.xml
deleted file mode 100644
index e206d70..0000000
--- a/.idea/encodings.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
-  <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
-</project>
-
diff --git a/.idea/misc.xml b/.idea/misc.xml
deleted file mode 100644
index 24c7d2a..0000000
--- a/.idea/misc.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
-  <component name="PhpProjectSharedConfiguration" php_language_level="5.5.0" />
-  <component name="ProjectRootManager" version="2" />
-</project>
-
diff --git a/.idea/modules.xml b/.idea/modules.xml
deleted file mode 100644
index 345dcbf..0000000
--- a/.idea/modules.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
-  <component name="ProjectModuleManager">
-    <modules>
-      <module fileurl="file://$PROJECT_DIR$/.idea/yioop.iml" filepath="$PROJECT_DIR$/.idea/yioop.iml" />
-    </modules>
-  </component>
-</project>
-
diff --git a/.idea/scopes/scope_settings.xml b/.idea/scopes/scope_settings.xml
deleted file mode 100644
index 922003b..0000000
--- a/.idea/scopes/scope_settings.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<component name="DependencyValidationManager">
-  <state>
-    <option name="SKIP_IMPORT_STATEMENTS" value="false" />
-  </state>
-</component>
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
deleted file mode 100644
index c80f219..0000000
--- a/.idea/vcs.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
-  <component name="VcsDirectoryMappings">
-    <mapping directory="$PROJECT_DIR$" vcs="Git" />
-  </component>
-</project>
-
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
deleted file mode 100644
index e4d3729..0000000
--- a/.idea/workspace.xml
+++ /dev/null
@@ -1,196 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
-  <component name="ChangeListManager">
-    <list default="true" id="f3aea52d-9728-42ee-a249-6dfcb9d933f1" name="Default" comment="">
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/scripts/basic.js" afterPath="$PROJECT_DIR$/scripts/basic.js" />
-    </list>
-    <ignored path="yioop.iws" />
-    <ignored path=".idea/workspace.xml" />
-    <ignored path=".idea/dataSources.local.xml" />
-    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
-    <option name="TRACKING_ENABLED" value="true" />
-    <option name="SHOW_DIALOG" value="false" />
-    <option name="HIGHLIGHT_CONFLICTS" value="true" />
-    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
-    <option name="LAST_RESOLUTION" value="IGNORE" />
-  </component>
-  <component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
-  <component name="CreatePatchCommitExecutor">
-    <option name="PATCH_PATH" value="" />
-  </component>
-  <component name="DaemonCodeAnalyzer">
-    <disable_hints />
-  </component>
-  <component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
-  <component name="FavoritesManager">
-    <favorites_list name="yioop" />
-  </component>
-  <component name="FileEditorManager">
-    <leaf />
-  </component>
-  <component name="FindManager">
-    <FindUsagesManager>
-      <setting name="OPEN_NEW_TAB" value="true" />
-    </FindUsagesManager>
-  </component>
-  <component name="Git.Settings">
-    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
-  </component>
-  <component name="IdeDocumentHistory">
-    <option name="changedFiles">
-      <list>
-        <option value="$PROJECT_DIR$/scripts/basic.js" />
-      </list>
-    </option>
-  </component>
-  <component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" interpreter_name="PHP" />
-  <component name="ProjectFrameBounds">
-    <option name="y" value="23" />
-    <option name="width" value="1440" />
-    <option name="height" value="812" />
-  </component>
-  <component name="ProjectLevelVcsManager" settingsEditedManually="false">
-    <OptionsSetting value="true" id="Add" />
-    <OptionsSetting value="true" id="Remove" />
-    <OptionsSetting value="true" id="Checkout" />
-    <OptionsSetting value="true" id="Update" />
-    <OptionsSetting value="true" id="Status" />
-    <OptionsSetting value="true" id="Edit" />
-    <ConfirmationsSetting value="0" id="Add" />
-    <ConfirmationsSetting value="0" id="Remove" />
-  </component>
-  <component name="ProjectReloadState">
-    <option name="STATE" value="0" />
-  </component>
-  <component name="ProjectView">
-    <navigator currentView="ProjectPane" proportions="" version="1">
-      <flattenPackages />
-      <showMembers />
-      <showModules />
-      <showLibraryContents />
-      <hideEmptyPackages />
-      <abbreviatePackageNames />
-      <autoscrollToSource />
-      <autoscrollFromSource />
-      <sortByType />
-    </navigator>
-    <panes>
-      <pane id="ProjectPane">
-        <subPane>
-          <PATH>
-            <PATH_ELEMENT>
-              <option name="myItemId" value="yioop" />
-              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
-            </PATH_ELEMENT>
-          </PATH>
-          <PATH>
-            <PATH_ELEMENT>
-              <option name="myItemId" value="yioop" />
-              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
-            </PATH_ELEMENT>
-            <PATH_ELEMENT>
-              <option name="myItemId" value="yioop" />
-              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
-            </PATH_ELEMENT>
-          </PATH>
-          <PATH>
-            <PATH_ELEMENT>
-              <option name="myItemId" value="yioop" />
-              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
-            </PATH_ELEMENT>
-            <PATH_ELEMENT>
-              <option name="myItemId" value="yioop" />
-              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
-            </PATH_ELEMENT>
-            <PATH_ELEMENT>
-              <option name="myItemId" value="scripts" />
-              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
-            </PATH_ELEMENT>
-          </PATH>
-        </subPane>
-      </pane>
-      <pane id="Scope" />
-    </panes>
-  </component>
-  <component name="PropertiesComponent">
-    <property name="last_opened_file_path" value="$PROJECT_DIR$/../../bin" />
-    <property name="options.lastSelected" value="preferences.sourceCode.General" />
-    <property name="options.splitter.main.proportions" value="0.3" />
-    <property name="options.splitter.details.proportions" value="0.2" />
-    <property name="WebServerToolWindowFactoryState" value="true" />
-  </component>
-  <component name="RunManager">
-    <list size="0" />
-  </component>
-  <component name="ShelveChangesManager" show_recycled="false" />
-  <component name="TaskManager">
-    <task active="true" id="Default" summary="Default task">
-      <changelist id="f3aea52d-9728-42ee-a249-6dfcb9d933f1" name="Default" comment="" />
-      <created>1413686670446</created>
-      <option name="number" value="Default" />
-      <updated>1413686670446</updated>
-    </task>
-    <servers />
-  </component>
-  <component name="ToolWindowManager">
-    <frame x="0" y="23" width="1440" height="812" extended-state="6" />
-    <editor active="false" />
-    <layout>
-      <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
-      <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
-      <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
-      <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
-      <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
-      <window_info id="Application Servers" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
-      <window_info id="Remote Host" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
-      <window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.25" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
-      <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
-      <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
-      <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
-      <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
-      <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
-      <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
-      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
-      <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
-      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
-      <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
-      <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
-      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
-    </layout>
-  </component>
-  <component name="Vcs.Log.UiProperties">
-    <option name="RECENTLY_FILTERED_USER_GROUPS">
-      <collection />
-    </option>
-    <option name="RECENTLY_FILTERED_BRANCH_GROUPS">
-      <collection />
-    </option>
-  </component>
-  <component name="VcsContentAnnotationSettings">
-    <option name="myLimit" value="2678400000" />
-  </component>
-  <component name="VcsManagerConfiguration">
-    <option name="myTodoPanelSettings">
-      <TodoPanelSettings />
-    </option>
-  </component>
-  <component name="XDebuggerManager">
-    <breakpoint-manager>
-      <option name="time" value="1" />
-    </breakpoint-manager>
-    <watches-manager />
-  </component>
-  <component name="editorHistoryManager">
-    <entry file="file://$PROJECT_DIR$/scripts/basic.js">
-      <provider selected="true" editor-type-id="text-editor">
-        <state vertical-scroll-proportion="1.5034965" vertical-offset="6155" max-vertical-offset="7320">
-          <caret line="482" column="1" selection-start-line="482" selection-start-column="1" selection-end-line="482" selection-end-column="1" />
-          <folding>
-            <element signature="n#!!doc" expanded="true" />
-          </folding>
-        </state>
-      </provider>
-    </entry>
-  </component>
-</project>
-
diff --git a/.idea/yioop.iml b/.idea/yioop.iml
deleted file mode 100644
index 6b8184f..0000000
--- a/.idea/yioop.iml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<module type="WEB_MODULE" version="4">
-  <component name="NewModuleRootManager">
-    <content url="file://$MODULE_DIR$" />
-    <orderEntry type="inheritedJdk" />
-    <orderEntry type="sourceFolder" forTests="false" />
-  </component>
-</module>
-
-- 
1.9.3 (Apple Git-50)

